danny0405 commented on code in PR #9904:
URL: https://github.com/apache/hudi/pull/9904#discussion_r1375599334
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/source/TestIncrementalInputSplits.java:
##########
@@ -191,6 +192,38 @@ void testInputSplitsWithPartitionPruner(
assertEquals(expectedPartitions, partitions);
}
+ @Test
+ void testInputSplitsWithSpeedLimit() throws Exception {
+ Configuration conf = TestConfigurations.getDefaultConf(basePath);
+ conf.set(FlinkOptions.READ_AS_STREAMING, true);
+ conf.set(FlinkOptions.READ_STREAMING_SKIP_CLUSTERING, true);
+ conf.set(FlinkOptions.READ_STREAMING_SKIP_COMPACT, true);
+ conf.set(FlinkOptions.READ_SPEED_LIMIT_ENABLED, true);
+ conf.set(FlinkOptions.READ_SPEED_LIMIT_COMMITS, 1);
+ // insert data
+ TestData.writeData(TestData.DATA_SET_INSERT, conf);
+ TestData.writeData(TestData.DATA_SET_INSERT, conf);
+ TestData.writeData(TestData.DATA_SET_INSERT, conf);
+ TestData.writeData(TestData.DATA_SET_INSERT, conf);
+
+ HoodieTimeline commitsTimeline = metaClient.reloadActiveTimeline()
+ .filter(hoodieInstant ->
hoodieInstant.getAction().equals(HoodieTimeline.COMMIT_ACTION));
+ HoodieInstant firstInstant = commitsTimeline.firstInstant().get();
+ HoodieInstant secondInstant = commitsTimeline.getInstants().get(1);
+ IncrementalInputSplits iis = IncrementalInputSplits.builder()
+ .conf(conf)
+ .path(new Path(basePath))
+ .rowType(TestConfigurations.ROW_TYPE)
+ .partitionPruner(null)
+ .build();
+ IncrementalInputSplits.Result result = iis.inputSplits(metaClient,
firstInstant.getTimestamp(), firstInstant.getCompletionTime(), false);
+ result.getInputSplits().stream().forEach(split -> {
+ InstantRange range = split.getInstantRange().get();
Review Comment:
Can we just assert the commit number as 1.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]