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

    https://github.com/apache/storm/pull/1832#discussion_r99641734
  
    --- Diff: 
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpout.java
 ---
    @@ -87,13 +84,14 @@
     
     
         public KafkaSpout(KafkaSpoutConfig<K, V> kafkaSpoutConfig) {
    -        this(kafkaSpoutConfig, new KafkaConsumerFactoryDefault());
    +        this.kafkaSpoutConfig = kafkaSpoutConfig;
    +        setKafkaConsumerFactory(new KafkaConsumerFactoryDefault());
         }
         
    -    //This constructor is here for testing
    -    KafkaSpout(KafkaSpoutConfig<K, V> kafkaSpoutConfig, 
KafkaConsumerFactory<K, V> kafkaConsumerFactory) {
    -        this.kafkaSpoutConfig = kafkaSpoutConfig;                 // Pass 
in configuration
    +    //This setter is here for testing
    +    final KafkaSpout setKafkaConsumerFactory(KafkaConsumerFactory<K, V> 
kafkaConsumerFactory) {
    --- End diff --
    
    I would rather leave this with the constructor. We shouldn't be making this 
class mutable unless we have a very good reason to do so.


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