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

    https://github.com/apache/storm/pull/1835#discussion_r93364905
  
    --- 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 --
    
    I think just a flag is easier to use since the user has to write code to 
configure it otherwise, especially in the case of using flux to configure storm 
topology. Though your way is more flexible but I don't think we need the 
flexibility here since it's an internal implementation and the user do not need 
to know much about that. Let the user assign the implementation class should be 
used in cases like tuple builder. 


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

Reply via email to