Package org.apache.hadoop.hbase.quotas
Class NoopQuotaLimiter
java.lang.Object
org.apache.hadoop.hbase.quotas.NoopQuotaLimiter
- All Implemented Interfaces:
QuotaLimiter
Noop quota limiter returned when no limiter is associated to the user/table
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckQuota(long writeReqs, long estimateWriteSize, long readReqs, long estimateReadSize, long estimateWriteCapacityUnit, long estimateReadCapacityUnit, boolean isAtomic, long estimateHandlerThreadUsageMs) Checks if it is possible to execute the specified operation.voidconsumeRead(long size, long capacityUnit, boolean isAtomic) Removes or add back some read amount to the quota.voidconsumeTime(long handlerMillisUsed) Removes or add back some handler thread usage milliseconds to the quota.voidconsumeWrite(long size, long capacityUnit, boolean isAtomic) Removes or add back some write amount to the quota.static QuotaLimiterget()longReturns the number of bytes available to read to avoid exceeding the quotalongReturns the maximum number of bytes ever available to readlongReturns the maximum number of reads to allow per TimeUnitlongReturns the maximum number of requests to allow per TimeUnitlongReturns the number of bytes available to write to avoid exceeding the quotalongReturns the maximum number of bytes ever available to writelongReturns the maximum number of writes to allow per TimeUnitvoidgrabQuota(long writeReqs, long writeSize, long readReqs, long readSize, long writeCapacityUnit, long readCapacityUnit, boolean isAtomic, long estimateHandlerThreadUsageMs) Removes the specified write and read amount from the quota.booleanisBypass()Returns true if the limiter is a nooptoString()
-
Field Details
-
instance
-
-
Constructor Details
-
NoopQuotaLimiter
private NoopQuotaLimiter()
-
-
Method Details
-
checkQuota
public void checkQuota(long writeReqs, long estimateWriteSize, long readReqs, long estimateReadSize, long estimateWriteCapacityUnit, long estimateReadCapacityUnit, boolean isAtomic, long estimateHandlerThreadUsageMs) throws RpcThrottlingException Description copied from interface:QuotaLimiterChecks if it is possible to execute the specified operation.- Specified by:
checkQuotain interfaceQuotaLimiter- Parameters:
writeReqs- the write requests that will be checked against the available quotaestimateWriteSize- the write size that will be checked against the available quotareadReqs- the read requests that will be checked against the available quotaestimateReadSize- the read size that will be checked against the available quotaestimateWriteCapacityUnit- the write capacity unit that will be checked against the available quotaestimateReadCapacityUnit- the read capacity unit that will be checked against the available quotaisAtomic- if the request performs an atomic operationestimateHandlerThreadUsageMs- the estimated handler usage time in ms that will be checked against the available quota- Throws:
RpcThrottlingException- thrown if not enough available resources to perform operation.
-
grabQuota
public void grabQuota(long writeReqs, long writeSize, long readReqs, long readSize, long writeCapacityUnit, long readCapacityUnit, boolean isAtomic, long estimateHandlerThreadUsageMs) Description copied from interface:QuotaLimiterRemoves the specified write and read amount from the quota. At this point the write and read amount will be an estimate, that will be later adjusted with a consumeWrite()/consumeRead() call.- Specified by:
grabQuotain interfaceQuotaLimiter- Parameters:
writeReqs- the write requests that will be removed from the current quotawriteSize- the write size that will be removed from the current quotareadReqs- the read requests that will be removed from the current quotareadSize- the read size that will be removed from the current quotawriteCapacityUnit- the write capacity unit that will be removed from the current quotareadCapacityUnit- the read capacity unit num that will be removed from the current quotaisAtomic- if the request performs an atomic operationestimateHandlerThreadUsageMs- the estimated handler usage time in ms that will be removed from the available quota
-
consumeWrite
Description copied from interface:QuotaLimiterRemoves or add back some write amount to the quota. (called at the end of an operation in case the estimate quota was off)- Specified by:
consumeWritein interfaceQuotaLimiter
-
consumeRead
Description copied from interface:QuotaLimiterRemoves or add back some read amount to the quota. (called at the end of an operation in case the estimate quota was off)- Specified by:
consumeReadin interfaceQuotaLimiter
-
consumeTime
Description copied from interface:QuotaLimiterRemoves or add back some handler thread usage milliseconds to the quota. (called at the end of an operation in case the estimate quota was off)- Specified by:
consumeTimein interfaceQuotaLimiter- Parameters:
handlerMillisUsed- the actual elapsed time used processing the request
-
isBypass
Description copied from interface:QuotaLimiterReturns true if the limiter is a noop- Specified by:
isBypassin interfaceQuotaLimiter
-
getWriteAvailable
Description copied from interface:QuotaLimiterReturns the number of bytes available to write to avoid exceeding the quota- Specified by:
getWriteAvailablein interfaceQuotaLimiter
-
getRequestNumLimit
Description copied from interface:QuotaLimiterReturns the maximum number of requests to allow per TimeUnit- Specified by:
getRequestNumLimitin interfaceQuotaLimiter
-
getReadNumLimit
Description copied from interface:QuotaLimiterReturns the maximum number of reads to allow per TimeUnit- Specified by:
getReadNumLimitin interfaceQuotaLimiter
-
getWriteNumLimit
Description copied from interface:QuotaLimiterReturns the maximum number of writes to allow per TimeUnit- Specified by:
getWriteNumLimitin interfaceQuotaLimiter
-
getReadAvailable
Description copied from interface:QuotaLimiterReturns the number of bytes available to read to avoid exceeding the quota- Specified by:
getReadAvailablein interfaceQuotaLimiter
-
getReadLimit
Description copied from interface:QuotaLimiterReturns the maximum number of bytes ever available to read- Specified by:
getReadLimitin interfaceQuotaLimiter
-
getWriteLimit
Description copied from interface:QuotaLimiterReturns the maximum number of bytes ever available to write- Specified by:
getWriteLimitin interfaceQuotaLimiter
-
toString
-
get
-