-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-27687: support consumption of block bytes scanned in operation quota
#5654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
2c083b7
31a7882
e7c8a05
433a699
7f660d4
c36ab49
d167196
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -690,6 +690,7 @@ private Result increment(final HRegion region, final OperationQuota quota, | |
| if (metricsRegionServer != null) { | ||
| long blockBytesScanned = | ||
| context != null ? context.getBlockBytesScanned() - blockBytesScannedBefore : 0; | ||
| quota.addBlockBytesScanned(blockBytesScanned); | ||
|
||
| metricsRegionServer.updateIncrement(region, EnvironmentEdgeManager.currentTime() - before, | ||
| blockBytesScanned); | ||
| } | ||
|
|
@@ -2506,6 +2507,9 @@ public GetResponse get(final RpcController controller, final GetRequest request) | |
| if (r != null && r.rawCells() != null) { | ||
| quota.addGetResult(r); | ||
| } | ||
| if (context != null) { | ||
| quota.addBlockBytesScanned(context.getBlockBytesScanned()); | ||
| } | ||
| return builder.build(); | ||
| } catch (IOException ie) { | ||
| throw new ServiceException(ie); | ||
|
|
@@ -2841,6 +2845,9 @@ public MultiResponse multi(final RpcController rpcc, final MultiRequest request) | |
| spaceQuotaEnforcement); | ||
| } | ||
| } finally { | ||
| if (context != null) { | ||
|
||
| quota.addBlockBytesScanned(context.getBlockBytesScanned()); | ||
| } | ||
| quota.close(); | ||
| } | ||
|
|
||
|
|
@@ -3041,6 +3048,7 @@ private CheckAndMutateResult checkAndMutate(HRegion region, OperationQuota quota | |
| long after = EnvironmentEdgeManager.currentTime(); | ||
| long blockBytesScanned = | ||
| context != null ? context.getBlockBytesScanned() - blockBytesScannedBefore : 0; | ||
| quota.addBlockBytesScanned(blockBytesScanned); | ||
|
||
| metricsRegionServer.updateCheckAndMutate(region, after - before, blockBytesScanned); | ||
|
|
||
| MutationType type = mutation.getMutateType(); | ||
|
|
@@ -3645,6 +3653,9 @@ public ScanResponse scan(final RpcController controller, final ScanRequest reque | |
| } | ||
|
|
||
| quota.addScanResult(results); | ||
| if (rpcCall != null) { | ||
| quota.addBlockBytesScanned(rpcCall.getBlockBytesScanned()); | ||
| } | ||
| addResults(builder, results, (HBaseRpcController) controller, | ||
| RegionReplicaUtil.isDefaultReplica(region.getRegionInfo()), | ||
| isClientCellBlockSupport(rpcCall)); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a nit, but can you move the writeConsumed out of the if blocks so we don't duplicate?