This is an automated email from the ASF dual-hosted git repository.
wchevreuil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/master by this push:
new da87a8e70c3 HBASE-27386 Use encoded size for calculating compression
ratio in block size predicator (#4795)
da87a8e70c3 is described below
commit da87a8e70c3179f845c594b807b5f237adcd44c9
Author: Wellington Ramos Chevreuil <[email protected]>
AuthorDate: Fri Sep 23 10:33:27 2022 +0100
HBASE-27386 Use encoded size for calculating compression ratio in block
size predicator (#4795)
Signed-off-by: Ankit Singhal <[email protected]>
---
.../src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java | 2 +-
.../java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
index 097aaff27c8..c84836bcd53 100644
---
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
+++
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
@@ -933,7 +933,7 @@ public class HFileBlock implements Cacheable {
// We need to cache the unencoded/uncompressed size before changing the
block state
int rawBlockSize = 0;
if (this.getEncodingState() != null) {
- rawBlockSize = blockSizeWritten();
+ rawBlockSize = encodedBlockSizeWritten();
}
// We need to set state before we can package the block up for
cache-on-write. In a way, the
// block is ready, but not yet encoded or compressed.
diff --git
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java
index d71b33e82d5..788cec65ee4 100644
---
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java
+++
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java
@@ -1220,8 +1220,8 @@ public class TestHStoreFile {
public void testDataBlockSizeCompressed() throws Exception {
conf.set(BLOCK_COMPRESSED_SIZE_PREDICATOR,
PreviousBlockCompressionRatePredicator.class.getName());
- testDataBlockSizeWithCompressionRatePredicator(11,
- (s, c) -> (c > 1 && c < 11) ? s >= BLOCKSIZE_SMALL * 10 : true);
+ testDataBlockSizeWithCompressionRatePredicator(12,
+ (s, c) -> (c > 2 && c < 11) ? s >= BLOCKSIZE_SMALL * 10 : true);
}
@Test