alexeykudinkin commented on code in PR #5632:
URL: https://github.com/apache/hudi/pull/5632#discussion_r943021599
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/KafkaOffsetGen.java:
##########
@@ -287,6 +292,32 @@ public OffsetRange[] getNextOffsetRanges(Option<String>
lastCheckpointStr, long
return CheckpointUtils.computeOffsetRanges(fromOffsets, toOffsets,
numEvents);
}
+ /**
+ * Fetch partition infos for given topic.
+ *
+ * @param consumer
+ * @param topicName
+ */
+ private List<PartitionInfo> fetchPartitionInfos(KafkaConsumer consumer,
String topicName) {
+ long timeout =
this.props.getLong(Config.KAFKA_FETCH_PARTITION_TIME_OUT.key(),
Config.KAFKA_FETCH_PARTITION_TIME_OUT.defaultValue());
+ long start = System.currentTimeMillis();
+
+ List<PartitionInfo> partitionInfos;
+ do {
+ partitionInfos = consumer.partitionsFor(topicName);
+ try {
+ TimeUnit.SECONDS.sleep(10);
Review Comment:
@wangxianghu can you please elaborate?
--
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]