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
Modifier and TypeFieldDescriptionstatic final SpaceQuotaSnapshot
Singleton 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 currentSpaceQuotaSnapshot
for the givensubject
.org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota
getSpaceQuota
(T subject) Fetch the Quota for the givensubject
.getTargetState
(T subject, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota spaceQuota) void
setCurrentState
(T subject, SpaceQuotaSnapshot state) Persists the currentSpaceQuotaSnapshot
for thesubject
.void
setRegionUsage
(Map<RegionInfo, Long> regionUsage) Updatesthis
with 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 currentSpaceQuotaSnapshot
for 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 currentSpaceQuotaSnapshot
for thesubject
.- Parameters:
subject
- The object which theSpaceQuotaSnapshot
is being persisted forstate
- The current state of thesubject
-
setRegionUsage
Updatesthis
with the latest snapshot of filesystem use by region.- Parameters:
regionUsage
- A map ofRegionInfo
objects to their filesystem usage in bytes
-