nsivabalan commented on code in PR #5632:
URL: https://github.com/apache/hudi/pull/5632#discussion_r946216914
##########
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:
yes, I don't see a reason why we sleep here. May be, if first call fails, we
can have a backup before retrying, but why sleep even if the call succeeds.
Also, 10 secs is lot 1 or 2 secs would suffice.
--
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]