diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java index a59f643322f..612bb5c9e37 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java @@ -269,11 +269,9 @@ class RegionScannerImpl implements RegionScanner, Shipper, RpcCallback { outResults.addAll(tmpList); } - if (!outResults.isEmpty()) { - region.addReadRequestsCount(1); - if (region.getMetrics() != null) { - region.getMetrics().updateReadRequestCount(); - } + region.addReadRequestsCount(1); + if (region.getMetrics() != null) { + region.getMetrics().updateReadRequestCount(); } // If the size limit was reached it means a partial Result is being returned. Returning a diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestTransitRegionStateProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestTransitRegionStateProcedure.java index c55a9f966b6..477069092fd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestTransitRegionStateProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestTransitRegionStateProcedure.java @@ -142,7 +142,9 @@ public class TestTransitRegionStateProcedure { long openSeqNum2 = region2.getOpenSeqNum(); // confirm that the region is successfully opened assertTrue(openSeqNum2 > openSeqNum); - assertEquals(1, region2.getReadRequestsCount()); + // we check the available by scan after table created, + // so the readRequestsCount should be 2 here + assertEquals(2, region2.getReadRequestsCount()); assertEquals(2, region2.getWriteRequestsCount()); }