Class NoopQuotaLimiter

java.lang.Object
org.apache.hadoop.hbase.quotas.NoopQuotaLimiter
All Implemented Interfaces:
QuotaLimiter

@Private @Evolving class NoopQuotaLimiter extends Object implements QuotaLimiter
Noop quota limiter returned when no limiter is associated to the user/table
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static QuotaLimiter
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkQuota(long writeReqs, long estimateWriteSize, long readReqs, long estimateReadSize, long estimateWriteCapacityUnit, long estimateReadCapacityUnit)
    Checks if it is possible to execute the specified operation.
    void
    consumeRead(long size, long capacityUnit)
    Removes or add back some read amount to the quota.
    void
    consumeWrite(long size, long capacityUnit)
    Removes or add back some write amount to the quota.
    get()
     
    long
    Returns the number of bytes available to read to avoid exceeding the quota
    long
    Returns the maximum number of bytes ever available to read
    long
    Returns the maximum number of reads to allow per TimeUnit
    long
    Returns the maximum number of requests to allow per TimeUnit
    long
    Returns the number of bytes available to write to avoid exceeding the quota
    long
    Returns the maximum number of bytes ever available to write
    long
    Returns the maximum number of writes to allow per TimeUnit
    void
    grabQuota(long writeReqs, long writeSize, long readReqs, long readSize, long writeCapacityUnit, long readCapacityUnit)
    Removes the specified write and read amount from the quota.
    boolean
    Returns true if the limiter is a noop
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • checkQuota

      public void checkQuota(long writeReqs, long estimateWriteSize, long readReqs, long estimateReadSize, long estimateWriteCapacityUnit, long estimateReadCapacityUnit) throws RpcThrottlingException
      Description copied from interface: QuotaLimiter
      Checks if it is possible to execute the specified operation.
      Specified by:
      checkQuota in interface QuotaLimiter
      Parameters:
      writeReqs - the write requests that will be checked against the available quota
      estimateWriteSize - the write size that will be checked against the available quota
      readReqs - the read requests that will be checked against the available quota
      estimateReadSize - the read size that will be checked against the available quota
      estimateWriteCapacityUnit - the write capacity unit that will be checked against the available quota
      estimateReadCapacityUnit - 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: QuotaLimiter
      Removes 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:
      grabQuota in interface QuotaLimiter
      Parameters:
      writeReqs - the write requests that will be removed from the current quota
      writeSize - the write size that will be removed from the current quota
      readReqs - the read requests that will be removed from the current quota
      readSize - the read size that will be removed from the current quota
      writeCapacityUnit - the write capacity unit that will be removed from the current quota
      readCapacityUnit - the read capacity unit num that will be removed from the current quota
    • consumeWrite

      public void consumeWrite(long size, long capacityUnit)
      Description copied from interface: QuotaLimiter
      Removes 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:
      consumeWrite in interface QuotaLimiter
    • consumeRead

      public void consumeRead(long size, long capacityUnit)
      Description copied from interface: QuotaLimiter
      Removes 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:
      consumeRead in interface QuotaLimiter
    • isBypass

      public boolean isBypass()
      Description copied from interface: QuotaLimiter
      Returns true if the limiter is a noop
      Specified by:
      isBypass in interface QuotaLimiter
    • getWriteAvailable

      public long getWriteAvailable()
      Description copied from interface: QuotaLimiter
      Returns the number of bytes available to write to avoid exceeding the quota
      Specified by:
      getWriteAvailable in interface QuotaLimiter
    • getRequestNumLimit

      public long getRequestNumLimit()
      Description copied from interface: QuotaLimiter
      Returns the maximum number of requests to allow per TimeUnit
      Specified by:
      getRequestNumLimit in interface QuotaLimiter
    • getReadNumLimit

      public long getReadNumLimit()
      Description copied from interface: QuotaLimiter
      Returns the maximum number of reads to allow per TimeUnit
      Specified by:
      getReadNumLimit in interface QuotaLimiter
    • getWriteNumLimit

      public long getWriteNumLimit()
      Description copied from interface: QuotaLimiter
      Returns the maximum number of writes to allow per TimeUnit
      Specified by:
      getWriteNumLimit in interface QuotaLimiter
    • getReadAvailable

      public long getReadAvailable()
      Description copied from interface: QuotaLimiter
      Returns the number of bytes available to read to avoid exceeding the quota
      Specified by:
      getReadAvailable in interface QuotaLimiter
    • getReadLimit

      public long getReadLimit()
      Description copied from interface: QuotaLimiter
      Returns the maximum number of bytes ever available to read
      Specified by:
      getReadLimit in interface QuotaLimiter
    • getWriteLimit

      public long getWriteLimit()
      Description copied from interface: QuotaLimiter
      Returns the maximum number of bytes ever available to write
      Specified by:
      getWriteLimit in interface QuotaLimiter
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • get

      public static QuotaLimiter get()