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:
parent
7f7a293cb5
commit
329f0baa98
|
@ -270,12 +270,10 @@ class RegionScannerImpl implements RegionScanner, Shipper, RpcCallback {
|
||||||
outResults.addAll(tmpList);
|
outResults.addAll(tmpList);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!outResults.isEmpty()) {
|
|
||||||
region.addReadRequestsCount(1);
|
region.addReadRequestsCount(1);
|
||||||
if (region.getMetrics() != null) {
|
if (region.getMetrics() != null) {
|
||||||
region.getMetrics().updateReadRequestCount();
|
region.getMetrics().updateReadRequestCount();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// If the size limit was reached it means a partial Result is being returned. Returning a
|
// If the size limit was reached it means a partial Result is being returned. Returning a
|
||||||
// partial Result means that we should not reset the filters; filters should only be reset in
|
// partial Result means that we should not reset the filters; filters should only be reset in
|
||||||
|
|
|
@ -142,7 +142,9 @@ public class TestTransitRegionStateProcedure {
|
||||||
long openSeqNum2 = region2.getOpenSeqNum();
|
long openSeqNum2 = region2.getOpenSeqNum();
|
||||||
// confirm that the region is successfully opened
|
// confirm that the region is successfully opened
|
||||||
assertTrue(openSeqNum2 > openSeqNum);
|
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());
|
assertEquals(2, region2.getWriteRequestsCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue