Repository: flink
Updated Branches:
  refs/heads/master c39ad31f3 -> 96d24445e


[hotfix] [FLINK-3679] Improve Javadocs of DeserializationSchemas

Javadocs of the `deserialize(...)` method should inform that returning
null from the method is allowed, if the message cannot be deserialized.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/96d24445
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/96d24445
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/96d24445

Branch: refs/heads/master
Commit: 96d24445e3fb9540091a01e0fe34fcb51bc0dd58
Parents: c39ad31
Author: Tzu-Li (Gordon) Tai <tzuli...@apache.org>
Authored: Thu Mar 9 14:34:53 2017 +0800
Committer: Tzu-Li (Gordon) Tai <tzuli...@apache.org>
Committed: Thu Mar 9 14:34:53 2017 +0800

----------------------------------------------------------------------
 .../util/serialization/KeyedDeserializationSchema.java   | 11 +++++++----
 .../util/serialization/DeserializationSchema.java        |  3 ++-
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/96d24445/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/util/serialization/KeyedDeserializationSchema.java
----------------------------------------------------------------------
diff --git 
a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/util/serialization/KeyedDeserializationSchema.java
 
b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/util/serialization/KeyedDeserializationSchema.java
index 01e72ca..b5a33bc 100644
--- 
a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/util/serialization/KeyedDeserializationSchema.java
+++ 
b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/util/serialization/KeyedDeserializationSchema.java
@@ -34,10 +34,12 @@ public interface KeyedDeserializationSchema<T> extends 
Serializable, ResultTypeQ
        /**
         * Deserializes the byte message.
         *
-        * @param messageKey the key as a byte array (null if no key has been 
set)
-        * @param message The message, as a byte array. (null if the message 
was empty or deleted)
-        * @param partition The partition the message has originated from
-        * @param offset the offset of the message in the original source (for 
example the Kafka offset)  @return The deserialized message as an object.
+        * @param messageKey the key as a byte array (null if no key has been 
set).
+        * @param message The message, as a byte array (null if the message was 
empty or deleted).
+        * @param partition The partition the message has originated from.
+        * @param offset the offset of the message in the original source (for 
example the Kafka offset).
+        *
+        * @return The deserialized message as an object (null if the message 
cannot be deserialized).
         */
        T deserialize(byte[] messageKey, byte[] message, String topic, int 
partition, long offset) throws IOException;
 
@@ -46,6 +48,7 @@ public interface KeyedDeserializationSchema<T> extends 
Serializable, ResultTypeQ
         * true is returned the element won't be emitted.
         * 
         * @param nextElement The element to test for the end-of-stream signal.
+        *
         * @return True, if the element signals end of stream, false otherwise.
         */
        boolean isEndOfStream(T nextElement);

http://git-wip-us.apache.org/repos/asf/flink/blob/96d24445/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/serialization/DeserializationSchema.java
----------------------------------------------------------------------
diff --git 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/serialization/DeserializationSchema.java
 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/serialization/DeserializationSchema.java
index 2e27ba6..03cab20 100644
--- 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/serialization/DeserializationSchema.java
+++ 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/serialization/DeserializationSchema.java
@@ -40,7 +40,8 @@ public interface DeserializationSchema<T> extends 
Serializable, ResultTypeQuerya
         * Deserializes the byte message.
         * 
         * @param message The message, as a byte array.
-        * @return The deserialized message as an object.
+        *
+        * @return The deserialized message as an object (null if the message 
cannot be deserialized).
         */
        T deserialize(byte[] message) throws IOException;
 

Reply via email to