HBASE-27408 Improve BucketAllocatorException log to always include HFile name (#4886)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
This commit is contained in:
Bryan Beaudreault 2022-11-21 08:21:29 -05:00 committed by GitHub
parent f68b61a027
commit 9462933179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -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: ");
if (fileContext.getHFileName() != null) {
sb.append(fileContext.getHFileName());
} else {
sb.append(re.getKey());
}
} else {
sb.append(" HFile: ");