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
Fields inherited from interface org.apache.hadoop.hbase.quotas.OperationQuota
USE_RESULT_SIZE_BYTES, USE_RESULT_SIZE_BYTES_DEFAULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
addScanResultCells
(List<Cell> cells) Add a scan result in the form of cells.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 completionstatic OperationQuota
get()
long
Returns the number of bytes available to read to avoid exceeding the quotalong
Returns 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, wait
Methods inherited from interface org.apache.hadoop.hbase.quotas.OperationQuota
getMaxResultSize
-
Field Details
-
instance
-
-
Constructor Details
-
NoopOperationQuota
private NoopOperationQuota()
-
-
Method Details
-
get
-
checkBatchQuota
Description copied from interface:OperationQuota
Checks 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:
checkBatchQuota
in 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:OperationQuota
Checks if it is possible to execute the scan. The quota will be estimated based on the composition of the scan.- Specified by:
checkScanQuota
in 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:OperationQuota
Cleanup method on operation completion- Specified by:
close
in interfaceOperationQuota
-
addGetResult
Description copied from interface:OperationQuota
Add 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:
addGetResult
in interfaceOperationQuota
-
addScanResult
Description copied from interface:OperationQuota
Add 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:
addScanResult
in interfaceOperationQuota
-
addMutation
Description copied from interface:OperationQuota
Add 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:
addMutation
in interfaceOperationQuota
-
getReadAvailable
Description copied from interface:OperationQuota
Returns the number of bytes available to read to avoid exceeding the quota- Specified by:
getReadAvailable
in interfaceOperationQuota
-
getReadConsumed
Description copied from interface:OperationQuota
Returns the number of bytes consumed from the quota by the operation- Specified by:
getReadConsumed
in interfaceOperationQuota
-
addScanResultCells
Description copied from interface:OperationQuota
Add 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:
addScanResultCells
in interfaceOperationQuota
-