Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1437#discussion_r46835390
  
    --- Diff: 
flink-streaming-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumer.java
 ---
    @@ -303,25 +300,29 @@ public FlinkKafkaConsumer(String topic, 
KeyedDeserializationSchema<T> deserializ
                        validateZooKeeperConfig(props);
                }
                
    -           // Connect to a broker to get the partitions
    -           List<PartitionInfo> partitionInfos = 
getPartitionsForTopic(topic, props);
    +           // Connect to a broker to get the partitions for all topics
    +           this.partitionInfos = getPartitionsForTopic(topics, props);
     
                if (partitionInfos.size() == 0) {
    -                   throw new RuntimeException("Unable to retrieve any 
partitions for topic " + topic + "." +
    +                   throw new RuntimeException("Unable to retrieve any 
partitions for the requested topics " + StringUtils.join(topics, ",") + "." +
                                        "Please check previous log entries");
                }
     
    -           // get initial partitions list. The order of the partitions is 
important for consistent 
    -           // partition id assignment in restart cases.
    -           this.partitions = new int[partitionInfos.size()];
    -           for (int i = 0; i < partitionInfos.size(); i++) {
    -                   partitions[i] = partitionInfos.get(i).partition();
    -                   
    -                   if (partitions[i] >= partitions.length) {
    -                           throw new RuntimeException("Kafka partition 
numbers are sparse");
    +           Map<String, Integer> countPerTopic = new HashMap<>();
    --- End diff --
    
    How about guarding this section with `if (LOG.isInfoEnabled())`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to