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

    https://github.com/apache/metron/pull/584#discussion_r116574075
  
    --- Diff: 
metron-platform/metron-storm-kafka/src/main/java/org/apache/metron/storm/kafka/flux/SimpleStormKafkaBuilder.java
 ---
    @@ -165,13 +177,39 @@ public SimpleStormKafkaBuilder( Map<String, Object> 
kafkaProps
                                     , List<String> fieldsConfiguration
                                     )
       {
    -    super( modifyKafkaProps(kafkaProps, zkQuorum)
    -         , createStreams(fieldsConfiguration, topic)
    -         , createTuplesBuilder(fieldsConfiguration, topic)
    -         );
    +    super( getBootstrapServers(zkQuorum, kafkaProps)
    +         , 
createDeserializer(Optional.ofNullable((String)kafkaProps.get(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG)),
 DEFAULT_DESERIALIZER)
    +         , 
createDeserializer(Optional.ofNullable((String)kafkaProps.get(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG)),
 DEFAULT_DESERIALIZER)
    +         , topic
    +    );
    +    setProp(kafkaProps);
    +    setRecordTranslator(new 
SpoutRecordTranslator<>(FieldsConfiguration.toList(fieldsConfiguration)));
         this.topic = topic;
       }
     
    +  private static <T> Class<Deserializer<T>> createDeserializer( 
Optional<String> deserializerClass
    --- End diff --
    
    I'm not super keen on passing in possibly null values around.  I rather 
like the notion of passing in that something is optional in the type signature.


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