Package org.apache.hadoop.hbase.quotas
Interface QuotaSnapshotStore<T>
- All Known Implementing Classes:
NamespaceQuotaSnapshotStore,TableQuotaSnapshotStore
A common interface for computing and storing space quota observance/violation for entities. An
entity is presently a table or a namespace.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpaceQuotaSnapshotSingleton to represent a table without a quota defined. -
Method Summary
Modifier and TypeMethodDescriptionfilterBySubject(T subject) Filters the providedregions, returning those which match the givensubject.getCurrentState(T subject) Returns the currentSpaceQuotaSnapshotfor the givensubject.org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotagetSpaceQuota(T subject) Fetch the Quota for the givensubject.getTargetState(T subject, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota spaceQuota) voidsetCurrentState(T subject, SpaceQuotaSnapshot state) Persists the currentSpaceQuotaSnapshotfor thesubject.voidsetRegionUsage(Map<RegionInfo, Long> regionUsage) Updatesthiswith the latest snapshot of filesystem use by region.
-
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 givensubject. May be null.- Parameters:
subject- The object for which the quota should be fetched- Throws:
IOException
-
getCurrentState
Returns the currentSpaceQuotaSnapshotfor the givensubject.- 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 - Parameters:
subject- The object which to determine the target SpaceQuotaSnapshot ofspaceQuota- The quota "definition" for thesubject- Throws:
IOException
-
filterBySubject
Filters the providedregions, returning those which match the givensubject.- Parameters:
subject- The filter criteria. Only regions belonging to this parameter will be returned
-
setCurrentState
Persists the currentSpaceQuotaSnapshotfor thesubject.- Parameters:
subject- The object which theSpaceQuotaSnapshotis being persisted forstate- The current state of thesubject
-
setRegionUsage
Updatesthiswith the latest snapshot of filesystem use by region.- Parameters:
regionUsage- A map ofRegionInfoobjects to their filesystem usage in bytes
-