Interface QuotaSnapshotStore<T>

All Known Implementing Classes:
NamespaceQuotaSnapshotStore, TableQuotaSnapshotStore

@Private public interface QuotaSnapshotStore<T>
A common interface for computing and storing space quota observance/violation for entities. An entity is presently a table or a namespace.
  • Field Details

    • NO_QUOTA

      Singleton to represent a table without a quota defined. It is never in violation.
  • Method Details

    • getSpaceQuota

      org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota getSpaceQuota(T subject) throws IOException
      Fetch the Quota for the given subject. May be null.
      Parameters:
      subject - The object for which the quota should be fetched
      Throws:
      IOException
    • getCurrentState

      Returns the current SpaceQuotaSnapshot for the given subject.
      Parameters:
      subject - The object which the quota snapshot should be fetched
    • getTargetState

      SpaceQuotaSnapshot getTargetState(T subject, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota spaceQuota) throws IOException
      Computes the target SpaceQuotaSnapshot for the given subject and spaceQuota.
      Parameters:
      subject - The object which to determine the target SpaceQuotaSnapshot of
      spaceQuota - The quota "definition" for the subject
      Throws:
      IOException
    • filterBySubject

      Filters the provided regions, returning those which match the given subject.
      Parameters:
      subject - The filter criteria. Only regions belonging to this parameter will be returned
    • setCurrentState

      void setCurrentState(T subject, SpaceQuotaSnapshot state)
      Persists the current SpaceQuotaSnapshot for the subject.
      Parameters:
      subject - The object which the SpaceQuotaSnapshot is being persisted for
      state - The current state of the subject
    • setRegionUsage

      void setRegionUsage(Map<RegionInfo,Long> regionUsage)
      Updates this with the latest snapshot of filesystem use by region.
      Parameters:
      regionUsage - A map of RegionInfo objects to their filesystem usage in bytes