apurtell commented on a change in pull request #3244:
URL: https://github.com/apache/hbase/pull/3244#discussion_r630662113
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCellCodec.java
##########
@@ -349,6 +424,42 @@ private static void checkLength(int len, int max) throws
IOException {
throw new IOException("Invalid length for compresesed portion of
keyvalue: " + len);
}
}
+
+ private void readCompressedValue(InputStream in, byte[] outArray, int
outOffset,
+ int expectedLength) throws IOException {
+ // Read the size of the compressed value. We serialized it as a vint32.
+ int compressedLength = StreamUtils.readRawVarint32(in);
+ // Read all of the compressed value into a buffer for the Inflater.
+ byte[] buffer = new byte[compressedLength];
+ IOUtils.readFully(in, buffer, 0, compressedLength);
+ // Inflate the compressed value. We know the uncompressed size.
Inflator#inflate will
+ // return nonzero for as long as some compressed input remains, and 0
when done.
+ Inflater inflater = compression.getValueCompressor().getInflater();
Review comment:
Here I think it is better to use the buffer based API instead of a
stream, because we are inflating into place into the backing array for cell
data.
--
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:
[email protected]