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

    https://github.com/apache/storm/pull/1808#discussion_r96779395
  
    --- Diff: 
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/trident/KafkaTridentSpoutManager.java
 ---
    @@ -44,29 +43,30 @@
         // Bookkeeping
         private final KafkaSpoutConfig<K, V> kafkaSpoutConfig;
         // Declare some KafkaSpoutConfig references for convenience
    -    private KafkaSpoutStreams kafkaSpoutStreams;                // Object 
that wraps all the logic to declare output fields and emit tuples
    -    private KafkaSpoutTuplesBuilder<K, V> tuplesBuilder;        // Object 
that contains the logic to build tuples for each ConsumerRecord
    +    private final Fields fields;
     
         public KafkaTridentSpoutManager(KafkaSpoutConfig<K, V> 
kafkaSpoutConfig) {
             this.kafkaSpoutConfig = kafkaSpoutConfig;
    -        kafkaSpoutStreams = kafkaSpoutConfig.getKafkaSpoutStreams();
    -        tuplesBuilder = kafkaSpoutConfig.getTuplesBuilder();
    +        RecordTranslator<K, V> translator = 
kafkaSpoutConfig.getTranslator();
    +        Fields fields = null;
    --- End diff --
    
    I would put all of this logic in a method called `setFields`. However, this 
is going to make this class hard to unit test. So we should even create a 
static factory method just wrapping this logic, and the constructor with two 
parameters, `KafkaTridentSpoutManager(KafkaSpoutConfig<K, V> kafkaSpoutConfig, 
Fields fields)`


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to