1
0

[HUDI-402]: code clean up in test cases

This commit is contained in:
Pratyaksh Sharma
2019-12-29 15:00:06 +05:30
committed by vinoth chandar
parent 98c0d8cf60
commit dde21e7315
62 changed files with 320 additions and 619 deletions

View File

@@ -291,7 +291,7 @@ public class TestHoodieDeltaStreamer extends UtilitiesTestBase {
}
@Test
public void testProps() throws IOException {
public void testProps() {
TypedProperties props =
new DFSPropertiesConfiguration(dfs, new Path(dfsBasePath + "/" + PROPS_FILENAME_TEST_SOURCE)).getConfig();
assertEquals(2, props.getInteger("hoodie.upsert.shuffle.parallelism"));
@@ -547,7 +547,7 @@ public class TestHoodieDeltaStreamer extends UtilitiesTestBase {
}
@Test
public void testDistributedTestDataSource() throws Exception {
public void testDistributedTestDataSource() {
TypedProperties props = new TypedProperties();
props.setProperty(TestSourceConfig.MAX_UNIQUE_RECORDS_PROP, "1000");
props.setProperty(TestSourceConfig.NUM_SOURCE_PARTITIONS_PROP, "1");

View File

@@ -229,7 +229,7 @@ public class UtilitiesTestBase {
}
}
public static String[] jsonifyRecords(List<HoodieRecord> records) throws IOException {
public static String[] jsonifyRecords(List<HoodieRecord> records) {
return records.stream().map(Helpers::toJsonString).toArray(String[]::new);
}
}

View File

@@ -30,7 +30,6 @@ import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.sql.SparkSession;
import java.util.Iterator;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@@ -77,8 +76,7 @@ public class DistributedTestDataSource extends AbstractBaseTestSource {
if (!dataGeneratorMap.containsKey(p)) {
initDataGen(newProps, p);
}
Iterator<GenericRecord> itr = fetchNextBatch(newProps, perPartitionSourceLimit, commitTime, p).iterator();
return itr;
return fetchNextBatch(newProps, perPartitionSourceLimit, commitTime, p).iterator();
}, true);
return new InputBatch<>(Option.of(avroRDD), commitTime);
}