[HUDI-402]: code clean up in test cases
This commit is contained in:
committed by
vinoth chandar
parent
98c0d8cf60
commit
dde21e7315
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user