@InterfaceAudience.Private @InterfaceStability.Evolving class NoopOperationQuota extends Object implements OperationQuota
OperationQuota.OperationType
Modifier and Type | Field and Description |
---|---|
private static OperationQuota |
instance |
USE_RESULT_SIZE_BYTES, USE_RESULT_SIZE_BYTES_DEFAULT
Modifier | Constructor and Description |
---|---|
private |
NoopOperationQuota() |
Modifier and Type | Method and Description |
---|---|
void |
addGetResult(Result result)
Add a get result.
|
void |
addMutation(Mutation mutation)
Add a mutation result.
|
void |
addScanResult(List<Result> results)
Add a scan result.
|
void |
checkBatchQuota(int numWrites,
int numReads)
Checks if it is possible to execute the specified operation.
|
void |
checkScanQuota(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest scanRequest,
long maxScannerResultSize,
long maxBlockBytesScanned,
long prevBlockBytesScannedDifference)
Checks if it is possible to execute the scan.
|
void |
close()
Cleanup method on operation completion
|
static OperationQuota |
get() |
long |
getReadAvailable()
Returns the number of bytes available to read to avoid exceeding the quota
|
long |
getReadConsumed()
Returns the number of bytes consumed from the quota by the operation
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMaxResultSize
private static OperationQuota instance
private NoopOperationQuota()
public static OperationQuota get()
public void checkBatchQuota(int numWrites, int numReads) throws RpcThrottlingException
OperationQuota
checkBatchQuota
in interface OperationQuota
numWrites
- number of write operation that will be performednumReads
- number of small-read operation that will be performedRpcThrottlingException
- if the operation cannot be performed because RPC quota is
exceeded.public void checkScanQuota(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest scanRequest, long maxScannerResultSize, long maxBlockBytesScanned, long prevBlockBytesScannedDifference) throws RpcThrottlingException
OperationQuota
checkScanQuota
in interface OperationQuota
scanRequest
- the given scan operationmaxScannerResultSize
- the maximum bytes to be returned by the scannermaxBlockBytesScanned
- the maximum bytes scanned in a single RPC call by the
scannerprevBlockBytesScannedDifference
- the difference between BBS of the previous two next
callsRpcThrottlingException
- if the operation cannot be performed because RPC quota is
exceeded.public void close()
OperationQuota
close
in interface OperationQuota
public void addGetResult(Result result)
OperationQuota
addGetResult
in interface OperationQuota
public void addScanResult(List<Result> results)
OperationQuota
addScanResult
in interface OperationQuota
public void addMutation(Mutation mutation)
OperationQuota
addMutation
in interface OperationQuota
public long getReadAvailable()
OperationQuota
getReadAvailable
in interface OperationQuota
public long getReadConsumed()
OperationQuota
getReadConsumed
in interface OperationQuota
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.