huginn created HBASE-30395:
------------------------------
Summary: Avoid heap buffer copy in decompression stream fallback
Key: HBASE-30395
URL: https://issues.apache.org/jira/browse/HBASE-30395
Project: HBase
Issue Type: Improvement
Reporter: huginn
Motivation
The decompression stream fallback currently uses
BlockIOUtils.readFullyWithHeapBuffer, which allocates a temporary 1 KiB heap
buffer and copies each read into the destination ByteBuff. This adds an
avoidable heap buffer copy for on-heap ByteBuff destinations.
Proposed change
* Add a readFully(InputStream, ByteBuff, int) helper.
* Read directly into the backing array when the destination ByteBuff is on heap.
* Preserve the existing temporary-buffer fallback for direct or non-array
ByteBuff instances.
* Update the compressed and uncompressed stream fallback paths in
HFileBlockDefaultDecodingContext.
* Add regression tests for the direct-read and fallback paths.
Compatibility
This change does not modify the HFile file format, wire format, or
configuration behavior.
Related context: HBASE-27049
Related change: https://github.com/apache/hbase/pull/8665
--
This message was sent by Atlassian Jira
(v8.20.10#820010)