You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "dartiga (via GitHub)" <gi...@apache.org> on 2023/01/26 07:30:08 UTC

[GitHub] [beam] dartiga opened a new issue, #25184: [Feature Request]: Use `partitionsFor` instead of `listTopics` in `ReadFromKafkaDoFn`

dartiga opened a new issue, #25184:
URL: https://github.com/apache/beam/issues/25184

   ### What would you like to happen?
   
   For brokers with a huge amount of partitions, using `listTopics` adds unnecessary overhead. Using `partitionsFor` would be preferable.
   
   ### Issue Priority
   
   Priority: 2 (default / most feature requests should be filed as P2)
   
   ### Issue Components
   
   - [ ] Component: Python SDK
   - [X] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [X] Component: IO connector
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
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: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] dartiga commented on issue #25184: [Feature Request]: Use `partitionsFor` instead of `listTopics` in `ReadFromKafkaDoFn`

Posted by "dartiga (via GitHub)" <gi...@apache.org>.
dartiga commented on issue #25184:
URL: https://github.com/apache/beam/issues/25184#issuecomment-1406110008

   So instead of
   ```java
   for (List<PartitionInfo> topicPartitionList : consumer.listTopics().values()) {
       topicPartitionList.forEach(
           partitionInfo -> {
             existingTopicPartitions.add(
                 new TopicPartition(partitionInfo.topic(), partitionInfo.partition()));
           });
   }
   ```
   Have something like:
   ```java
   List<PartitionInfo> topicPartitionList =
             consumer.partitionsFor(kafkaSourceDescriptor.getTopicPartition().topic());
   topicPartitionList.forEach(
       partitionInfo -> {
            existingTopicPartitions.add(
                 new TopicPartition(partitionInfo.topic(), partitionInfo.partition()));
       });
   ```


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org