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

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


The following commit(s) were added to refs/heads/branch-2.5 by this push:
     new 70ebc24c6ba HBASE-29903 hbtop should display default replica id (#7760)
70ebc24c6ba is described below

commit 70ebc24c6baed4108d990143c72b01c50ca9793a
Author: Liu Xiao <[email protected]>
AuthorDate: Wed Feb 18 23:25:15 2026 +0800

    HBASE-29903 hbtop should display default replica id (#7760)
    
    Signed-off-by: Duo Zhang <[email protected]>
    (cherry picked from commit 76abc6bdca9ac465110da32c4f512261c03f8c81)
---
 .../org/apache/hadoop/hbase/hbtop/mode/RegionModeStrategy.java |  2 +-
 .../src/test/java/org/apache/hadoop/hbase/hbtop/TestUtils.java | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/mode/RegionModeStrategy.java
 
b/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/mode/RegionModeStrategy.java
index 5932ffb2279..02a6bd1f464 100644
--- 
a/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/mode/RegionModeStrategy.java
+++ 
b/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/mode/RegionModeStrategy.java
@@ -112,7 +112,7 @@ public final class RegionModeStrategy implements 
ModeStrategy {
       startKey = Bytes.toStringBinary(elements[1]);
       startCode = Bytes.toString(elements[2]);
       replicaId =
-        elements.length == 4 ? 
Integer.valueOf(Bytes.toString(elements[3])).toString() : "";
+        elements.length == 4 ? 
Integer.valueOf(Bytes.toString(elements[3])).toString() : "0";
       region = RegionInfo.encodeRegionName(regionMetrics.getRegionName());
     } catch (IOException ignored) {
       // Exception deliberately ignored
diff --git 
a/hbase-hbtop/src/test/java/org/apache/hadoop/hbase/hbtop/TestUtils.java 
b/hbase-hbtop/src/test/java/org/apache/hadoop/hbase/hbtop/TestUtils.java
index 0968a1d5723..f29b9b82227 100644
--- a/hbase-hbtop/src/test/java/org/apache/hadoop/hbase/hbtop/TestUtils.java
+++ b/hbase-hbtop/src/test/java/org/apache/hadoop/hbase/hbtop/TestUtils.java
@@ -150,35 +150,35 @@ public final class TestUtils {
     for (Record record : records) {
       switch (record.get(Field.REGION_NAME).asString()) {
         case "table1,,1.00000000000000000000000000000000.":
-          assertRecordInRegionMode(record, "default", "1", "", "table1",
+          assertRecordInRegionMode(record, "default", "1", "0", "table1",
             "00000000000000000000000000000000", "host1:1000", 
"host1.apache.com,1000,1", 0L, 0L, 0L,
             0L, new Size(100, Size.Unit.MEGABYTE), new Size(200, 
Size.Unit.MEGABYTE), 1,
             new Size(100, Size.Unit.MEGABYTE), 0.1f, "", 100L, 100L, 100f, 
"2019-07-22 00:00:00");
           break;
 
         case "table1,1,4.00000000000000000000000000000003.":
-          assertRecordInRegionMode(record, "default", "4", "", "table1",
+          assertRecordInRegionMode(record, "default", "4", "0", "table1",
             "00000000000000000000000000000003", "host2:1001", 
"host2.apache.com,1001,2", 0L, 0L, 0L,
             0L, new Size(100, Size.Unit.MEGABYTE), new Size(200, 
Size.Unit.MEGABYTE), 1,
             new Size(100, Size.Unit.MEGABYTE), 0.4f, "1", 100L, 50L, 50f, 
"2019-07-22 00:00:03");
           break;
 
         case "table2,,5.00000000000000000000000000000004.":
-          assertRecordInRegionMode(record, "default", "5", "", "table2",
+          assertRecordInRegionMode(record, "default", "5", "0", "table2",
             "00000000000000000000000000000004", "host2:1001", 
"host2.apache.com,1001,2", 0L, 0L, 0L,
             0L, new Size(200, Size.Unit.MEGABYTE), new Size(400, 
Size.Unit.MEGABYTE), 2,
             new Size(200, Size.Unit.MEGABYTE), 0.5f, "", 200L, 150L, 75f, 
"2019-07-22 00:00:04");
           break;
 
         case "table2,1,2.00000000000000000000000000000001.":
-          assertRecordInRegionMode(record, "default", "2", "", "table2",
+          assertRecordInRegionMode(record, "default", "2", "0", "table2",
             "00000000000000000000000000000001", "host1:1000", 
"host1.apache.com,1000,1", 0L, 0L, 0L,
             0L, new Size(200, Size.Unit.MEGABYTE), new Size(400, 
Size.Unit.MEGABYTE), 2,
             new Size(200, Size.Unit.MEGABYTE), 0.2f, "1", 200L, 50L, 25f, 
"2019-07-22 00:00:01");
           break;
 
         case "namespace:table3,,6.00000000000000000000000000000005.":
-          assertRecordInRegionMode(record, "namespace", "6", "", "table3",
+          assertRecordInRegionMode(record, "namespace", "6", "0", "table3",
             "00000000000000000000000000000005", "host2:1001", 
"host2.apache.com,1001,2", 0L, 0L, 0L,
             0L, new Size(300, Size.Unit.MEGABYTE), new Size(600, 
Size.Unit.MEGABYTE), 3,
             new Size(300, Size.Unit.MEGABYTE), 0.6f, "", 300L, 200L, 66.66667f,

Reply via email to