AHeise commented on a change in pull request #11507: [FLINK-16587] Add basic CheckpointBarrierHandler for unaligned checkpoint URL: https://github.com/apache/flink/pull/11507#discussion_r402574161
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpillingAdaptiveSpanningRecordDeserializer.java ########## @@ -557,6 +579,28 @@ private void addNextChunkFromMemorySegment(MemorySegment segment, int offset, in } } + @Nullable + MemorySegment copyToTargetSegment() { + // for the case of only partial length, no data + final int position = lengthBuffer.position(); + if (position > 0) { + MemorySegment segment = MemorySegmentFactory.allocateUnpooledSegment(lengthBuffer.remaining()); + segment.put(0, lengthBuffer, lengthBuffer.remaining()); + lengthBuffer.position(position); + return segment; + } + + // for the case of full length, partial data in buffer + if (recordLength != -1) { + // In the PoC we skip the case of large record which size exceeds THRESHOLD_FOR_SPILLING, Review comment: What is the solution here? Have one big memory segment/buffer to store everything? Return all the record in smaller buffers? I fear that everything more elaborate would be hard to implement with the current ChannelStateWriter interface. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services