Skip to content

Commit 329f0ba

Browse files
bsglzZheng Wang
andauthored
HBASE-25967 The readRequestsCount does not calculate when the outResu… (#3351)
* HBASE-25967 The readRequestsCount does not calculate when the outResults is empty Co-authored-by: Zheng Wang <wangzheng@apache.org>
1 parent 7f7a293 commit 329f0ba

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,9 @@ public boolean nextRaw(List<Cell> outResults, ScannerContext scannerContext) thr
270270
outResults.addAll(tmpList);
271271
}
272272

273-
if (!outResults.isEmpty()) {
274-
region.addReadRequestsCount(1);
275-
if (region.getMetrics() != null) {
276-
region.getMetrics().updateReadRequestCount();
277-
}
273+
region.addReadRequestsCount(1);
274+
if (region.getMetrics() != null) {
275+
region.getMetrics().updateReadRequestCount();
278276
}
279277

280278
// If the size limit was reached it means a partial Result is being returned. Returning a

hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestTransitRegionStateProcedure.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ public void testRecoveryAndDoubleExecutionReopen() throws Exception {
142142
long openSeqNum2 = region2.getOpenSeqNum();
143143
// confirm that the region is successfully opened
144144
assertTrue(openSeqNum2 > openSeqNum);
145-
assertEquals(1, region2.getReadRequestsCount());
145+
// we check the available by scan after table created,
146+
// so the readRequestsCount should be 2 here
147+
assertEquals(2, region2.getReadRequestsCount());
146148
assertEquals(2, region2.getWriteRequestsCount());
147149
}
148150

0 commit comments

Comments
 (0)