HBASE-25967 The readRequestsCount does not calculate when the outResults is empty

This commit is contained in:
Zheng Wang 2021-06-10 11:08:30 +08:00
parent 74d330cf67
commit 1fd584ed2f
2 changed files with 6 additions and 6 deletions

View File

@ -7291,11 +7291,9 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
outResults.addAll(tmpList);
}
if (!outResults.isEmpty()) {
readRequestsCount.increment();
if (metricsRegion != null) {
metricsRegion.updateReadRequestCount();
}
readRequestsCount.increment();
if (metricsRegion != null) {
metricsRegion.updateReadRequestCount();
}
// If the size limit was reached it means a partial Result is being returned. Returning a

View File

@ -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());
}