Permalink
Browse files

MINOR: Small enhancement to Deserializer Javadoc

I’ve implemented my own custom Deserializer and been using it with `KStream.reduceByKey`; I observed that `reduceByKey` was passing null to my implementation, but it wasn’t clear to me what my implementation was expected to do in this case. So this attempts to clarify it.

This is my original work and I license this work to the Kafka project under Kafka’s open source license (the Apache License 2.0).

Author: Avi Flax <avi@aviflax.com>

Reviewers: Eno Thereska <eno.thereska@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Guozhang Wang <wangguoz@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #1503 from aviflax/patch-1

(cherry picked from commit 6b1a6d9)
Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
  • Loading branch information...
aviflax authored and ewencp committed Jul 25, 2016
1 parent 932bb84 commit aebab7cab6af88f777c1fb83604a1573554549a9
Showing with 4 additions and 4 deletions.
  1. +4 −4 clients/src/main/java/org/apache/kafka/common/serialization/Deserializer.java
@@ -32,13 +32,13 @@
public void configure(Map<String, ?> configs, boolean isKey);
/**
*
* Deserialize a record value from a bytearray into a value or object.
* @param topic topic associated with the data
* @param data serialized bytes
* @return deserialized typed data
* @param data serialized bytes; may be null; implementations are recommended to handle null by returning a value or null rather than throwing an exception.
* @return deserialized typed data; may be null
*/
public T deserialize(String topic, byte[] data);
@Override
public void close();
}
}

0 comments on commit aebab7c

Please sign in to comment.