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) Checks if it is possible to execute the specified operation.voidconsumeRead(long size, long capacityUnit) Removes or add back some read amount to the quota.voidconsumeWrite(long size, long capacityUnit) 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 number of bytes available to write to avoid exceeding the quotavoidgrabQuota(long writeReqs, long writeSize, long readReqs, long readSize, long writeCapacityUnit, long readCapacityUnit) 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) 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 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) 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 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
-
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
-
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
-
toString
-
get
-