xintongsong commented on a change in pull request #14904: URL: https://github.com/apache/flink/pull/14904#discussion_r576076365
########## File path: flink-core/src/main/java/org/apache/flink/core/memory/HybridMemorySegment.java ########## @@ -357,4 +385,9 @@ public final void put(int offset, ByteBuffer source, int numBytes) { } } } + + @Override + public <T> T processAsByteBuffer(Function<ByteBuffer, T> processFunction) { + return Preconditions.checkNotNull(processFunction).apply(wrapInternal(0, size)); + } Review comment: I'll look into them together with the follow-up refactor effort. Since not all `wrap` calls are on the entire segment, I'll need to check the performance impact from using `Function` on those calls. ---------------------------------------------------------------- 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