Repository: flink
Updated Branches:
  refs/heads/master 9d5a7857f -> fa024726b


[hotfix][network] Invert if check in SpanningRecordSerializer to improve 
readability


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

Branch: refs/heads/master
Commit: c520f6bbace837ef8e18e9f466839541c6bbfee8
Parents: 9d5a785
Author: Piotr Nowojski <piotr.nowoj...@gmail.com>
Authored: Fri Jan 12 16:01:29 2018 +0100
Committer: Piotr Nowojski <piotr.nowoj...@gmail.com>
Committed: Mon Feb 19 12:21:08 2018 +0100

----------------------------------------------------------------------
 .../api/serialization/SpanningRecordSerializer.java      | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/c520f6bb/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
----------------------------------------------------------------------
diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
index 768c43e..330f31c 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
@@ -138,13 +138,12 @@ public class SpanningRecordSerializer<T extends 
IOReadableWritable> implements R
        }
 
        private SerializationResult getSerializationResult() {
-               if (!dataBuffer.hasRemaining() && !lengthBuffer.hasRemaining()) 
{
-                       return !targetBuffer.isFull()
-                                       ? SerializationResult.FULL_RECORD
-                                       : 
SerializationResult.FULL_RECORD_MEMORY_SEGMENT_FULL;
+               if (dataBuffer.hasRemaining() || lengthBuffer.hasRemaining()) {
+                       return 
SerializationResult.PARTIAL_RECORD_MEMORY_SEGMENT_FULL;
                }
-
-               return SerializationResult.PARTIAL_RECORD_MEMORY_SEGMENT_FULL;
+               return !targetBuffer.isFull()
+                               ? SerializationResult.FULL_RECORD
+                               : 
SerializationResult.FULL_RECORD_MEMORY_SEGMENT_FULL;
        }
 
        @Override

Reply via email to