public class NamespaceQuotaSnapshotStore extends Object implements QuotaSnapshotStore<String>
QuotaSnapshotStore
implementation for namespaces.QuotaSnapshotStore.ViolationState
NO_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
QuotaSnapshotStore
getSpaceQuota
in interface QuotaSnapshotStore<String>
IOException
public SpaceQuotaSnapshot getCurrentState(String namespace)
QuotaSnapshotStore
QuotaSnapshotStore.ViolationState
for the given subject
.getCurrentState
in interface QuotaSnapshotStore<String>
public SpaceQuotaSnapshot getTargetState(String subject, QuotaProtos.SpaceQuota spaceQuota)
QuotaSnapshotStore
QuotaSnapshotStore.ViolationState
for the given subject
.getTargetState
in interface QuotaSnapshotStore<String>
public Iterable<Map.Entry<HRegionInfo,Long>> filterBySubject(String namespace)
QuotaSnapshotStore
regions
, returning those which match the given
subject
.filterBySubject
in interface QuotaSnapshotStore<String>
namespace
- The filter criteria.public void setCurrentState(String namespace, SpaceQuotaSnapshot snapshot)
QuotaSnapshotStore
QuotaSnapshotStore.ViolationState
for the subject
.setCurrentState
in interface QuotaSnapshotStore<String>