You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bb...@apache.org on 2022/11/21 13:23:29 UTC

[hbase] branch branch-2 updated: HBASE-27408 Improve BucketAllocatorException log to always include HFile name (#4886)

This is an automated email from the ASF dual-hosted git repository.

bbeaudreault pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new ad8d38b61fe HBASE-27408 Improve BucketAllocatorException log to always include HFile name (#4886)
ad8d38b61fe is described below

commit ad8d38b61feea34307a819e992aa9c708243993d
Author: Bryan Beaudreault <bb...@apache.org>
AuthorDate: Mon Nov 21 08:21:29 2022 -0500

    HBASE-27408 Improve BucketAllocatorException log to always include HFile name (#4886)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    Signed-off-by: Xiaolin Ha <ha...@apache.org>
---
 .../org/apache/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 b91792a2ee4..ad6510cb2fb 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
@@ -1034,13 +1034,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: ");