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>
This commit is contained in:
bsglz 2021-06-10 09:37:31 +08:00 committed by GitHub
parent 7f7a293cb5
commit 329f0baa98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -270,11 +270,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

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