public class TableQuotaSnapshotStore extends java.lang.Object implements QuotaSnapshotStore<TableName>
QuotaSnapshotStore for tables.QuotaSnapshotStore.ViolationStateNO_QUOTA| Constructor and Description |
|---|
TableQuotaSnapshotStore(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(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. |
void |
setRegionUsage(java.util.Map<HRegionInfo,java.lang.Long> regionUsage)
Updates
this with the latest snapshot of filesystem use by region. |
public TableQuotaSnapshotStore(Connection conn, QuotaObserverChore chore, java.util.Map<HRegionInfo,java.lang.Long> regionUsage)
public QuotaProtos.SpaceQuota getSpaceQuota(TableName subject) throws java.io.IOException
QuotaSnapshotStoregetSpaceQuota in interface QuotaSnapshotStore<TableName>java.io.IOExceptionpublic SpaceQuotaSnapshot getCurrentState(TableName table)
QuotaSnapshotStoreQuotaSnapshotStore.ViolationState for the given subject.getCurrentState in interface QuotaSnapshotStore<TableName>public SpaceQuotaSnapshot getTargetState(TableName table, QuotaProtos.SpaceQuota spaceQuota)
QuotaSnapshotStoreQuotaSnapshotStore.ViolationState for the given subject.getTargetState in interface QuotaSnapshotStore<TableName>public java.lang.Iterable<java.util.Map.Entry<HRegionInfo,java.lang.Long>> filterBySubject(TableName table)
QuotaSnapshotStoreregions, returning those which match the given
subject.filterBySubject in interface QuotaSnapshotStore<TableName>table - The filter criteria.public void setCurrentState(TableName table, SpaceQuotaSnapshot snapshot)
QuotaSnapshotStoreQuotaSnapshotStore.ViolationState for the subject.setCurrentState in interface QuotaSnapshotStore<TableName>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<TableName>regionUsage - A map of HRegionInfo objects to their filesystem usage in bytes