From 94629331791ea9dbec171ad9070d8c4d486bd16b Mon Sep 17 00:00:00 2001 From: Bryan Beaudreault Date: Mon, 21 Nov 2022 08:21:29 -0500 Subject: [PATCH] HBASE-27408 Improve BucketAllocatorException log to always include HFile name (#4886) Signed-off-by: Duo Zhang Signed-off-by: Xiaolin Ha --- .../hadoop/hbase/io/hfile/bucket/BucketCache.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java index 6849b176f72..a50e5b46455 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java @@ -1045,13 +1045,19 @@ public class BucketCache implements BlockCache, HeapSize { final HFileContext fileContext = ((HFileBlock) re.getData()).getHFileContext(); final String columnFamily = Bytes.toString(fileContext.getColumnFamily()); final String tableName = Bytes.toString(fileContext.getTableName()); - if (tableName != null && columnFamily != null) { + if (tableName != null) { sb.append(" Table: "); sb.append(tableName); + } + if (columnFamily != null) { sb.append(" CF: "); sb.append(columnFamily); - sb.append(" HFile: "); + } + sb.append(" HFile: "); + if (fileContext.getHFileName() != null) { sb.append(fileContext.getHFileName()); + } else { + sb.append(re.getKey()); } } else { sb.append(" HFile: ");