public class NamespaceQuotaSnapshotStore extends java.lang.Object implements QuotaSnapshotStore<java.lang.String>
QuotaSnapshotStore implementation for namespaces.QuotaSnapshotStore.ViolationStateNO_QUOTA| Constructor and Description |
|---|
NamespaceQuotaSnapshotStore(Connection conn,
QuotaObserverChore chore,
java.util.Map<HRegionInfo,java.lang.Long> regionUsage) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<java.util.Map.Entry<HRegionInfo,java.lang.Long>> |
filterBySubject(java.lang.String namespace)
Filters the provided
regions, returning those which match the given
subject. |
SpaceQuotaSnapshot |
getCurrentState(java.lang.String namespace)
Returns the current
QuotaSnapshotStore.ViolationState for the given subject. |
QuotaProtos.SpaceQuota |
getSpaceQuota(java.lang.String namespace)
Fetch the Quota for the given table.
|
SpaceQuotaSnapshot |
getTargetState(java.lang.String subject,
QuotaProtos.SpaceQuota spaceQuota)
Computes the target
QuotaSnapshotStore.ViolationState for the given subject. |
void |
setCurrentState(java.lang.String namespace,
SpaceQuotaSnapshot snapshot)
Sets the current
QuotaSnapshotStore.ViolationState for the subject. |
void |
setRegionUsage(java.util.Map<HRegionInfo,java.lang.Long> regionUsage)
Updates
this with the latest snapshot of filesystem use by region. |
public NamespaceQuotaSnapshotStore(Connection conn, QuotaObserverChore chore, java.util.Map<HRegionInfo,java.lang.Long> regionUsage)
public QuotaProtos.SpaceQuota getSpaceQuota(java.lang.String namespace) throws java.io.IOException
QuotaSnapshotStoregetSpaceQuota in interface QuotaSnapshotStore<java.lang.String>java.io.IOExceptionpublic SpaceQuotaSnapshot getCurrentState(java.lang.String namespace)
QuotaSnapshotStoreQuotaSnapshotStore.ViolationState for the given subject.getCurrentState in interface QuotaSnapshotStore<java.lang.String>public SpaceQuotaSnapshot getTargetState(java.lang.String subject, QuotaProtos.SpaceQuota spaceQuota)
QuotaSnapshotStoreQuotaSnapshotStore.ViolationState for the given subject.getTargetState in interface QuotaSnapshotStore<java.lang.String>public java.lang.Iterable<java.util.Map.Entry<HRegionInfo,java.lang.Long>> filterBySubject(java.lang.String namespace)
QuotaSnapshotStoreregions, returning those which match the given
subject.filterBySubject in interface QuotaSnapshotStore<java.lang.String>namespace - The filter criteria.public void setCurrentState(java.lang.String namespace,
SpaceQuotaSnapshot snapshot)
QuotaSnapshotStoreQuotaSnapshotStore.ViolationState for the subject.setCurrentState in interface QuotaSnapshotStore<java.lang.String>public void setRegionUsage(java.util.Map<HRegionInfo,java.lang.Long> regionUsage)
QuotaSnapshotStorethis with the latest snapshot of filesystem use by region.setRegionUsage in interface QuotaSnapshotStore<java.lang.String>regionUsage - A map of HRegionInfo objects to their filesystem usage in bytes