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

    https://github.com/apache/storm/pull/1835#discussion_r93555336
  
    --- 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 --
    
    Agree. If you need to reuse some code across the manual and automatic mode, 
put it in a base abstract class, and then provide two implementations, one for 
auto and another for manual.


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