public class NamespaceQuotaSnapshotStore extends Object implements QuotaSnapshotStore<String>
QuotaSnapshotStore implementation for namespaces.QuotaSnapshotStore.ViolationStateNO_QUOTA| Constructor and Description |
|---|
NamespaceQuotaSnapshotStore(Connection conn,
QuotaObserverChore chore,
Map<HRegionInfo,Long> regionUsage) |
| Modifier and Type | Method and Description |
|---|---|
Iterable<Map.Entry<HRegionInfo,Long>> |
filterBySubject(String namespace)
Filters the provided
regions, returning those which match the given
subject. |
SpaceQuotaSnapshot |
getCurrentState(String namespace)
Returns the current
QuotaSnapshotStore.ViolationState for the given subject. |
QuotaProtos.SpaceQuota |
getSpaceQuota(String namespace)
Fetch the Quota for the given table.
|
SpaceQuotaSnapshot |
getTargetState(String subject,
QuotaProtos.SpaceQuota spaceQuota)
Computes the target
QuotaSnapshotStore.ViolationState for the given subject. |
void |
setCurrentState(String namespace,
SpaceQuotaSnapshot snapshot)
Sets the current
QuotaSnapshotStore.ViolationState for the subject. |
public NamespaceQuotaSnapshotStore(Connection conn, QuotaObserverChore chore, Map<HRegionInfo,Long> regionUsage)
public QuotaProtos.SpaceQuota getSpaceQuota(String namespace) throws IOException
QuotaSnapshotStoregetSpaceQuota in interface QuotaSnapshotStore<String>IOExceptionpublic SpaceQuotaSnapshot getCurrentState(String namespace)
QuotaSnapshotStoreQuotaSnapshotStore.ViolationState for the given subject.getCurrentState in interface QuotaSnapshotStore<String>public SpaceQuotaSnapshot getTargetState(String subject, QuotaProtos.SpaceQuota spaceQuota)
QuotaSnapshotStoreQuotaSnapshotStore.ViolationState for the given subject.getTargetState in interface QuotaSnapshotStore<String>public Iterable<Map.Entry<HRegionInfo,Long>> filterBySubject(String namespace)
QuotaSnapshotStoreregions, returning those which match the given
subject.filterBySubject in interface QuotaSnapshotStore<String>namespace - The filter criteria.public void setCurrentState(String namespace, SpaceQuotaSnapshot snapshot)
QuotaSnapshotStoreQuotaSnapshotStore.ViolationState for the subject.setCurrentState in interface QuotaSnapshotStore<String>