Package org.apache.hadoop.hbase.quotas
Class TableQuotaSnapshotStore
java.lang.Object
org.apache.hadoop.hbase.quotas.TableQuotaSnapshotStore
- All Implemented Interfaces:
- QuotaSnapshotStore<TableName>
@Private
public class TableQuotaSnapshotStore
extends Object
implements QuotaSnapshotStore<TableName>
QuotaSnapshotStore for tables.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final QuotaObserverChoreprivate final Connectionprivate final ReentrantReadWriteLockprivate static final org.slf4j.Loggerprivate Map<RegionInfo,Long> private final ReentrantReadWriteLock.ReadLockprivate final ReentrantReadWriteLock.WriteLockFields inherited from interface org.apache.hadoop.hbase.quotas.QuotaSnapshotStoreNO_QUOTA
- 
Constructor SummaryConstructorsConstructorDescriptionTableQuotaSnapshotStore(Connection conn, QuotaObserverChore chore, Map<RegionInfo, Long> regionUsage) 
- 
Method SummaryModifier and TypeMethodDescriptionfilterBySubject(TableName table) Filters the providedregions, returning those which match the givensubject.getCurrentState(TableName table) Returns the currentSpaceQuotaSnapshotfor the givensubject.(package private) org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.QuotasgetQuotaForTable(TableName table) Fetches the table quota.(package private) longFetches any serialized snapshot sizes from the quota table for thetnprovided.org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotagetSpaceQuota(TableName subject) Fetch the Quota for the givensubject.getTargetState(TableName table, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota spaceQuota) voidsetCurrentState(TableName table, SpaceQuotaSnapshot snapshot) Persists the currentSpaceQuotaSnapshotfor thesubject.voidsetRegionUsage(Map<RegionInfo, Long> regionUsage) Updatesthiswith the latest snapshot of filesystem use by region.
- 
Field Details- 
LOG
- 
lock
- 
rlock
- 
wlock
- 
conn
- 
chore
- 
regionUsage
 
- 
- 
Constructor Details- 
TableQuotaSnapshotStorepublic TableQuotaSnapshotStore(Connection conn, QuotaObserverChore chore, Map<RegionInfo, Long> regionUsage) 
 
- 
- 
Method Details- 
getSpaceQuotapublic org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota getSpaceQuota(TableName subject) throws IOException Description copied from interface:QuotaSnapshotStoreFetch the Quota for the givensubject. May be null.- Specified by:
- getSpaceQuotain interface- QuotaSnapshotStore<TableName>
- Parameters:
- subject- The object for which the quota should be fetched
- Throws:
- IOException
 
- 
getQuotaForTableorg.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas getQuotaForTable(TableName table) throws IOException Fetches the table quota. Visible for mocking/testing.- Throws:
- IOException
 
- 
getCurrentStateDescription copied from interface:QuotaSnapshotStoreReturns the currentSpaceQuotaSnapshotfor the givensubject.- Specified by:
- getCurrentStatein interface- QuotaSnapshotStore<TableName>
- Parameters:
- table- The object which the quota snapshot should be fetched
 
- 
getTargetStatepublic SpaceQuotaSnapshot getTargetState(TableName table, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota spaceQuota) throws IOException Description copied from interface:QuotaSnapshotStore- Specified by:
- getTargetStatein interface- QuotaSnapshotStore<TableName>
- Parameters:
- table- The object which to determine the target SpaceQuotaSnapshot of
- spaceQuota- The quota "definition" for the- subject
- Throws:
- IOException
 
- 
getSnapshotSizesForTableFetches any serialized snapshot sizes from the quota table for thetnprovided. Any malformed records are skipped with a warning printed out.- Throws:
- IOException
 
- 
filterBySubjectDescription copied from interface:QuotaSnapshotStoreFilters the providedregions, returning those which match the givensubject.- Specified by:
- filterBySubjectin interface- QuotaSnapshotStore<TableName>
- Parameters:
- table- The filter criteria. Only regions belonging to this parameter will be returned
 
- 
setCurrentStateDescription copied from interface:QuotaSnapshotStorePersists the currentSpaceQuotaSnapshotfor thesubject.- Specified by:
- setCurrentStatein interface- QuotaSnapshotStore<TableName>
- Parameters:
- table- The object which the- SpaceQuotaSnapshotis being persisted for
- snapshot- The current state of the- subject
 
- 
setRegionUsageDescription copied from interface:QuotaSnapshotStoreUpdatesthiswith the latest snapshot of filesystem use by region.- Specified by:
- setRegionUsagein interface- QuotaSnapshotStore<TableName>
- Parameters:
- regionUsage- A map of- RegionInfoobjects to their filesystem usage in bytes
 
 
-