From ec0d9d767e697c8d6726d15bf06ce9a19a756263 Mon Sep 17 00:00:00 2001 From: bsglz <18031031@qq.com> Date: Sun, 26 Apr 2020 17:45:31 +0800 Subject: [PATCH] =?UTF-8?q?HBASE-23264=20Resolve=20a=20TODO=20of=20BucketA?= =?UTF-8?q?llocator:=20"Why=20we=20add=20the=20extra=20=E2=80=A6=20(#801)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Viraj Jasani --- .../apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java index 2883ff2f160..bbbce76cf8e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java @@ -269,8 +269,9 @@ public final class BucketAllocator { // Default block size in hbase is 64K, so we choose more sizes near 64K, you'd better // reset it according to your cluster's block size distribution + // The real block size in hfile maybe a little larger than the size we configured , + // so we need add extra 1024 bytes for fit. // TODO Support the view of block size distribution statistics - // TODO: Why we add the extra 1024 bytes? Slop? private static final int DEFAULT_BUCKET_SIZES[] = { 4 * 1024 + 1024, 8 * 1024 + 1024, 16 * 1024 + 1024, 32 * 1024 + 1024, 40 * 1024 + 1024, 48 * 1024 + 1024, 56 * 1024 + 1024, 64 * 1024 + 1024, 96 * 1024 + 1024, 128 * 1024 + 1024,