Github user NicoK commented on a diff in the pull request:
https://github.com/apache/flink/pull/5105#discussion_r156412102
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
---
@@ -169,33 +151,29 @@ public Buffer getCurrentBuffer() {
if (targetBuffer == null) {
return null;
}
-
- targetBuffer.setSize(position);
- return targetBuffer;
+ Buffer result = targetBuffer.build();
+ targetBuffer = null;
+ return result;
--- End diff --
should we also rename this method to more accurately reflect what is
actually being done here? Something like `createCurrentBuffer`?
---