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

    https://github.com/apache/storm/pull/1808#discussion_r91366483
  
    --- Diff: 
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/trident/KafkaTridentSpoutManager.java
 ---
    @@ -44,29 +40,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;
    +        for (String stream: translator.streams()) {
    +            if (fields == null) {
    +                fields = translator.getFieldsFor(stream);
    +            } else {
    +                if (!fields.equals(translator.getFieldsFor(stream))) {
    +                    throw new IllegalArgumentException("Trident Spouts do 
nut support multiple output Fields");
    --- End diff --
    
    Nit: nut -> not. Also maybe rephrase as "must have the same fields for all 
streams"


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