Package org.apache.hadoop.hbase.quotas
Class NoopOperationQuota
java.lang.Object
org.apache.hadoop.hbase.quotas.NoopOperationQuota
- All Implemented Interfaces:
OperationQuota
Noop operation quota returned when no quota is associated to the user/table
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.quotas.OperationQuota
OperationQuota.OperationType -
Field Summary
FieldsFields inherited from interface org.apache.hadoop.hbase.quotas.OperationQuota
USE_RESULT_SIZE_BYTES, USE_RESULT_SIZE_BYTES_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGetResult(Result result) Add a get result.voidaddMutation(Mutation mutation) Add a mutation result.voidaddScanResult(List<Result> results) Add a scan result.voidaddScanResultCells(List<Cell> cells) Add a scan result in the form of cells.voidcheckBatchQuota(int numWrites, int numReads, boolean isAtomic) Checks if it is possible to execute the specified operation.voidcheckScanQuota(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.voidclose()Cleanup method on operation completionstatic OperationQuotaget()longReturns the number of bytes available to read to avoid exceeding the quotalongReturns the number of bytes consumed from the quota by the operationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.quotas.OperationQuota
getMaxResultSize
-
Field Details
-
instance
-
-
Constructor Details
-
NoopOperationQuota
private NoopOperationQuota()
-
-
Method Details
-
get
-
checkBatchQuota
public void checkBatchQuota(int numWrites, int numReads, boolean isAtomic) throws RpcThrottlingException Description copied from interface:OperationQuotaChecks if it is possible to execute the specified operation. The quota will be estimated based on the number of operations to perform and the average size accumulated during time.- Specified by:
checkBatchQuotain interfaceOperationQuota- Parameters:
numWrites- number of write operation that will be performednumReads- number of small-read operation that will be performed- Throws:
RpcThrottlingException- if the operation cannot be performed because RPC quota is exceeded.
-
checkScanQuota
public void checkScanQuota(org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest scanRequest, long maxScannerResultSize, long maxBlockBytesScanned, long prevBlockBytesScannedDifference) throws RpcThrottlingException Description copied from interface:OperationQuotaChecks if it is possible to execute the scan. The quota will be estimated based on the composition of the scan.- Specified by:
checkScanQuotain interfaceOperationQuota- Parameters:
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 calls- Throws:
RpcThrottlingException- if the operation cannot be performed because RPC quota is exceeded.
-
close
Description copied from interface:OperationQuotaCleanup method on operation completion- Specified by:
closein interfaceOperationQuota
-
addGetResult
Description copied from interface:OperationQuotaAdd a get result. This will be used to calculate the exact quota and have a better short-read average size for the next time.- Specified by:
addGetResultin interfaceOperationQuota
-
addScanResult
Description copied from interface:OperationQuotaAdd a scan result. This will be used to calculate the exact quota and have a better long-read average size for the next time.- Specified by:
addScanResultin interfaceOperationQuota
-
addMutation
Description copied from interface:OperationQuotaAdd a mutation result. This will be used to calculate the exact quota and have a better mutation average size for the next time.- Specified by:
addMutationin interfaceOperationQuota
-
getReadAvailable
Description copied from interface:OperationQuotaReturns the number of bytes available to read to avoid exceeding the quota- Specified by:
getReadAvailablein interfaceOperationQuota
-
getReadConsumed
Description copied from interface:OperationQuotaReturns the number of bytes consumed from the quota by the operation- Specified by:
getReadConsumedin interfaceOperationQuota
-
addScanResultCells
Description copied from interface:OperationQuotaAdd a scan result in the form of cells. This will be used to calculate the exact quota and have a better long-read average size for the next time.- Specified by:
addScanResultCellsin interfaceOperationQuota
-