@InterfaceAudience.Private @InterfaceStability.Evolving class NoopQuotaLimiter extends Object implements QuotaLimiter
Modifier and Type | Field and Description |
---|---|
private static QuotaLimiter |
instance |
Modifier | Constructor and Description |
---|---|
private |
NoopQuotaLimiter() |
Modifier and Type | Method and Description |
---|---|
void |
checkQuota(long writeReqs,
long estimateWriteSize,
long readReqs,
long estimateReadSize)
Checks if it is possible to execute the specified operation.
|
void |
consumeRead(long size)
Removes or add back some read amount to the quota.
|
void |
consumeWrite(long size)
Removes or add back some write amount to the quota.
|
static QuotaLimiter |
get() |
long |
getReadAvailable() |
long |
getWriteAvailable() |
void |
grabQuota(long writeReqs,
long writeSize,
long readReqs,
long readSize)
Removes the specified write and read amount from the quota.
|
boolean |
isBypass() |
String |
toString() |
private static QuotaLimiter instance
private NoopQuotaLimiter()
public void checkQuota(long writeReqs, long estimateWriteSize, long readReqs, long estimateReadSize) throws RpcThrottlingException
QuotaLimiter
checkQuota
in interface QuotaLimiter
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 quotaRpcThrottlingException
- thrown if not enough available resources to perform operation.public void grabQuota(long writeReqs, long writeSize, long readReqs, long readSize)
QuotaLimiter
grabQuota
in interface QuotaLimiter
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 quotapublic void consumeWrite(long size)
QuotaLimiter
consumeWrite
in interface QuotaLimiter
public void consumeRead(long size)
QuotaLimiter
consumeRead
in interface QuotaLimiter
public boolean isBypass()
isBypass
in interface QuotaLimiter
public long getWriteAvailable()
getWriteAvailable
in interface QuotaLimiter
public long getReadAvailable()
getReadAvailable
in interface QuotaLimiter
public static QuotaLimiter get()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.