Skip to content

Commit

Permalink
Revert #525 (#529)
Browse files Browse the repository at this point in the history
* Make java file write wait by using reduce instead of count

* Remove unused pool

* Cleanup unused imports

* Revert "Avro codegen : Split builder constructor and build() if #fields > 50 (#525)"

This reverts commit 656164b.

---------

Co-authored-by: Karthik Ramgopal <kramgopa@linkedin.com>
  • Loading branch information
karthikrg and li-kramgopa authored Jan 11, 2024
1 parent 64d54e9 commit 26ae2c0
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 10,271 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -1830,30 +1829,6 @@ public void testNewBuilder() throws Exception {
compareIndexedRecords(instance, builder.build());
}

@DataProvider
public static Object[][] testPrivateModifierOnChunkMethodProvider() {
return new Object[][]{{vs14.ThousandField.class}, {vs19.ThousandField.class}};
}

@Test(dataProvider = "testPrivateModifierOnChunkMethodProvider")
public <T extends IndexedRecord> void testPrivateModifierOnChunkMethod(Class<T> clazz) {

// All chunk methods in builder
List<Method> chunkMethodNames = Arrays.stream(Arrays.stream(clazz.getClasses())
.filter(internalClazz -> internalClazz.getName().equals(clazz.getName() + "$Builder"))
.collect(Collectors.toList())
.get(0)
.getDeclaredMethods()).filter(method -> method.getName().contains("Chunk")).collect(Collectors.toList());

// chunk methods from main class
chunkMethodNames.addAll(Arrays.stream(clazz.getDeclaredMethods())
.filter(method -> method.getName().contains("Chunk"))
.collect(Collectors.toList()));

Assert.assertFalse(chunkMethodNames.isEmpty());
chunkMethodNames.forEach(method -> Assert.assertTrue(Modifier.isPrivate(method.getModifiers())));
}

@BeforeClass
public void setup() {
System.setProperty("org.apache.avro.specific.use_custom_coders", "true");
Expand Down
3 changes: 0 additions & 3 deletions avro-codegen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ plugins {
id "checkstyle"
id "jacoco"
}
test {
maxHeapSize='1g'
}

dependencies {
api project(":parser")
Expand Down
Loading

0 comments on commit 26ae2c0

Please sign in to comment.