Github user hmcl commented on a diff in the pull request:
https://github.com/apache/storm/pull/2428#discussion_r151886343
--- Diff:
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpoutConfig.java
---
@@ -292,17 +292,21 @@ private Builder(String bootstrapServers,
SerializableDeserializer<K> keyDes, Cla
this.subscription = subscription;
this.translator = new DefaultRecordTranslator<>();
- if (keyDesClazz != null) {
-
this.kafkaProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, keyDesClazz);
- }
- if (keyDes != null) {
-
this.kafkaProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,
keyDes.getClass());
- }
- if (valueDesClazz != null) {
-
this.kafkaProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,
valueDesClazz);
+ if
(!this.kafkaProps.containsKey(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG)) {
--- End diff --
@srdo can you please clarify what you are trying to do? What happens if
this if statement is false? Won't it cause kafkaProps to keep whatever value
they have set and the fields keyClassDeserializer something else? What are the
implications of that ?
The two ifs bellow, on lines 296 and 299, I think they can possibly be both
true and with different values, if you are dealing with subtypes. If so, what
happens in that case?
---