boyuanzz commented on a change in pull request #14217:
URL: https://github.com/apache/beam/pull/14217#discussion_r593366010



##########
File path: 
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaUnboundedSource.java
##########
@@ -66,7 +66,12 @@
     if (partitions.isEmpty()) {
       try (Consumer<?, ?> consumer = 
spec.getConsumerFactoryFn().apply(spec.getConsumerConfig())) {
         for (String topic : spec.getTopics()) {
-          for (PartitionInfo p : consumer.partitionsFor(topic)) {
+          List<PartitionInfo> partitionInfoList = 
consumer.partitionsFor(topic);

Review comment:
       I'm wondering whether it's possible that we get empty list here since 
KafkaConsumer javadoc doesn't state it explicitly.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to