This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch HBASE-28028
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/HBASE-28028 by this push:
new 1417faeb952 HBASE-28028 Read all compressed bytes to a byte array
before submitting them to decompressor
1417faeb952 is described below
commit 1417faeb952c97421ac5b150f2c16b9a8122cec1
Author: Duo Zhang <[email protected]>
AuthorDate: Thu Aug 17 17:05:05 2023 +0800
HBASE-28028 Read all compressed bytes to a byte array before submitting
them to decompressor
---
.../apache/hadoop/hbase/regionserver/wal/CompressionContext.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CompressionContext.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CompressionContext.java
index 73cf4821db0..6a2cd944441 100644
---
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CompressionContext.java
+++
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CompressionContext.java
@@ -17,6 +17,7 @@
*/
package org.apache.hadoop.hbase.regionserver.wal;
+import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -131,6 +132,11 @@ public class CompressionContext {
// such as data loss when splitting wal or replicating wal.
IOUtils.skipFully(in, inLength);
} else {
+ // FIXME: this is just used to confirm whether providing partial
compressed data to decompressor is a problem
+ // if confirmed, should try find other more efficient way to do this.
+ byte[] compressed = new byte[inLength];
+ IOUtils.readFully(in, compressed);
+ lowerIn.setDelegate(new ByteArrayInputStream(compressed));
IOUtils.readFully(compressedIn, outArray, outOffset, outLength);
}
}