waitingF commented on code in PR #8376:
URL: https://github.com/apache/hudi/pull/8376#discussion_r1161196217
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/KafkaOffsetGen.java:
##########
@@ -242,7 +291,15 @@ public OffsetRange[] getNextOffsetRanges(Option<String>
lastCheckpointStr, long
throw new HoodieException("sourceLimit should not be less than the
number of kafka partitions");
}
- return CheckpointUtils.computeOffsetRanges(fromOffsets, toOffsets,
numEvents);
+ OffsetRange[] ranges = CheckpointUtils.computeOffsetRanges(fromOffsets,
toOffsets, numEvents);
+ LOG.info("before split by count: " +
CheckpointUtils.offsetsStringfy(ranges));
+ long maxEventsPerPartition =
props.getLong(KafkaSourceConfig.MAX_EVENTS_PER_KAFKA_PARTITION.key(),
+ KafkaSourceConfig.MAX_EVENTS_PER_KAFKA_PARTITION.defaultValue());
+ LOG.info("getNextOffsetRanges set config " +
KafkaSourceConfig.MAX_EVENTS_PER_KAFKA_PARTITION.key() + " to " +
maxEventsPerPartition);
+
+ ranges = CheckpointUtils.splitRangesByCount(ranges, maxEventsPerPartition);
Review Comment:
sure, It's better to keep such merging and splitting logic together
--
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]