fredia commented on code in PR #25508: URL: https://github.com/apache/flink/pull/25508#discussion_r1798978105
########## flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/fs/ByteBufferWritableFSDataOutputStream.java: ########## @@ -58,6 +69,22 @@ public void write(ByteBuffer bb) throws IOException { } if (bb.hasArray()) { write(bb.array(), bb.arrayOffset() + bb.position(), bb.remaining()); + } else if (bb.isDirect()) { + int len = bb.remaining(); + int segment = Math.min(len, SEGMENT_BUFFER_SIZE); + byte[] bytes = new byte[segment]; + for (int i = 0; i < len;) { + int copy = Math.min(segment, bb.remaining()); + UNSAFE.copyMemory( + null, Review Comment: Oh, I see, because the `MemoryUtils.getByteBufferAddress(bb)` is an address. -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org