Github user HeartSaVioR commented on a diff in the pull request:
https://github.com/apache/storm/pull/2428#discussion_r153033776
--- Diff:
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpoutConfig.java
---
@@ -320,20 +320,17 @@ private Builder(Builder<?, ?> builder,
SerializableDeserializer<K> keyDes, Class
// when they change the key/value types.
this.translator = (RecordTranslator<K, V>) builder.translator;
this.retryService = builder.retryService;
-
- 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 (valueDes != null) {
+ } else if (keyDesClazz != null) {
--- End diff --
I'm not sure why this change is necessary, and if change is necessary, why
we don't change above constructor as well?
---