incubator-uniffle icon indicating copy to clipboard operation
incubator-uniffle copied to clipboard

[Bug] Optimized FileSegmentManagedBuffer.nioByteBuffer to avoid multiple read file

Open xumanbu opened this issue 10 months ago • 0 comments

Code of Conduct

Search before asking

  • [X] I have searched in the issues and found no similar issues.

Describe the bug

FileSegmentManagedBuffer#nioByteBuffer read file directly without cache at now. ShuffleDataResult getData() may read file twice when buffer instanceof FileSegmentManagedBuffer, it‘s not Consistent with NettyManagedBuffer.

   if (buffer.nioByteBuffer().hasArray()) {
      return buffer.nioByteBuffer().array();
    }

expect: FileSegmentManagedBuffer#nioByteBuffer should add a buffer to hold read file result to avoid multiple read file

Affects Version(s)

master

  • [X] Yes I am willing to submit a PR!

xumanbu avatar Apr 18 '24 07:04 xumanbu