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