Github user harshach commented on a diff in the pull request: https://github.com/apache/storm/pull/1835#discussion_r93501465 --- Diff: external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/internal/fetcher/KafkaRecordsFetchers.java --- @@ -0,0 +1,41 @@ +package org.apache.storm.kafka.spout.internal.fetcher; + +import org.apache.kafka.clients.consumer.ConsumerRebalanceListener; +import org.apache.kafka.clients.consumer.KafkaConsumer; +import org.apache.storm.kafka.spout.KafkaPartitionReader; +import org.apache.storm.kafka.spout.KafkaPartitionReaders; +import org.apache.storm.kafka.spout.KafkaSpout; +import org.apache.storm.kafka.spout.KafkaSpoutConfig; +import org.apache.storm.task.TopologyContext; + +import java.util.concurrent.TimeUnit; + +/** + * Created by liurenjie on 19/12/2016. + */ +public final class KafkaRecordsFetchers { + public static <K, V> KafkaRecordsFetcher<K, V> kafkaRecordsFetcherOf(KafkaSpoutConfig kafkaSpoutConfig, + KafkaConsumer<K, V> consumer, + TopologyContext context, + ConsumerRebalanceListener rebalanceListener) { + if (kafkaSpoutConfig.getManualPartitionAssignment()) { --- End diff -- @liurenjie1024 irrespective of if it's an internal detail or not we should go with the right approach. We have interfaces for a reason. If we keep adding implementations on how the records are being fetched we need to keep adding these if conditions. Given we are already making changes lets go with the right approach.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---