Package org.apache.hadoop.hbase.quotas
Class ExceedOperationQuota
java.lang.Object
org.apache.hadoop.hbase.quotas.DefaultOperationQuota
org.apache.hadoop.hbase.quotas.ExceedOperationQuota
- All Implemented Interfaces:
OperationQuota
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static interface
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.quotas.OperationQuota
OperationQuota.OperationType
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.quotas.DefaultOperationQuota
limiters, readAvailable, readCapacityUnitConsumed, readCapacityUnitDiff, readConsumed, readDiff, writeCapacityUnitConsumed, writeCapacityUnitDiff, writeConsumed, writeDiff
Fields inherited from interface org.apache.hadoop.hbase.quotas.OperationQuota
USE_RESULT_SIZE_BYTES, USE_RESULT_SIZE_BYTES_DEFAULT
-
Constructor Summary
ConstructorDescriptionExceedOperationQuota
(org.apache.hadoop.conf.Configuration conf, int blockSizeBytes, QuotaLimiter regionServerLimiter, QuotaLimiter... limiters) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkBatchQuota
(int numWrites, int numReads) Checks if it is possible to execute the specified operation.private void
checkQuota
(Runnable estimateQuota, ExceedOperationQuota.CheckQuotaRunnable checkQuota, int numWrites, int numReads, int numScans) 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 completionMethods inherited from class org.apache.hadoop.hbase.quotas.DefaultOperationQuota
addGetResult, addMutation, addScanResult, addScanResultCells, getReadAvailable, getReadConsumed, getScanReadConsumeEstimate, updateEstimateConsumeBatchQuota, updateEstimateConsumeScanQuota
Methods 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
-
LOG
-
regionServerLimiter
-
-
Constructor Details
-
ExceedOperationQuota
public ExceedOperationQuota(org.apache.hadoop.conf.Configuration conf, int blockSizeBytes, QuotaLimiter regionServerLimiter, QuotaLimiter... limiters)
-
-
Method Details
-
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
- Overrides:
checkBatchQuota
in classDefaultOperationQuota
- 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
- Overrides:
checkScanQuota
in classDefaultOperationQuota
- 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.
-
checkQuota
private void checkQuota(Runnable estimateQuota, ExceedOperationQuota.CheckQuotaRunnable checkQuota, int numWrites, int numReads, int numScans) throws RpcThrottlingException - Throws:
RpcThrottlingException
-
close
Description copied from interface:OperationQuota
Cleanup method on operation completion- Specified by:
close
in interfaceOperationQuota
- Overrides:
close
in classDefaultOperationQuota
-