@InterfaceAudience.Private public class TableQuotaSnapshotStore extends Object implements QuotaSnapshotStore<TableName>
QuotaSnapshotStore for tables.| Modifier and Type | Field and Description | 
|---|---|
| private QuotaObserverChore | chore | 
| private Connection | conn | 
| private ReentrantReadWriteLock | lock | 
| private static org.slf4j.Logger | LOG | 
| private Map<RegionInfo,Long> | regionUsage | 
| private ReentrantReadWriteLock.ReadLock | rlock | 
| private ReentrantReadWriteLock.WriteLock | wlock | 
NO_QUOTA| Constructor and Description | 
|---|
| TableQuotaSnapshotStore(Connection conn,
                       QuotaObserverChore chore,
                       Map<RegionInfo,Long> regionUsage) | 
| Modifier and Type | Method and Description | 
|---|---|
| Iterable<Map.Entry<RegionInfo,Long>> | filterBySubject(TableName table)Filters the provided  regions, returning those which match the givensubject. | 
| SpaceQuotaSnapshot | getCurrentState(TableName table)Returns the current  SpaceQuotaSnapshotfor the givensubject. | 
| (package private) org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas | getQuotaForTable(TableName table)Fetches the table quota. | 
| (package private) long | getSnapshotSizesForTable(TableName tn)Fetches any serialized snapshot sizes from the quota table for the  tnprovided. | 
| org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota | getSpaceQuota(TableName subject)Fetch the Quota for the given  subject. | 
| SpaceQuotaSnapshot | getTargetState(TableName table,
              org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota spaceQuota) | 
| void | setCurrentState(TableName table,
               SpaceQuotaSnapshot snapshot)Persists the current  SpaceQuotaSnapshotfor thesubject. | 
| void | setRegionUsage(Map<RegionInfo,Long> regionUsage)Updates  thiswith the latest snapshot of filesystem use by region. | 
private static final org.slf4j.Logger LOG
private final ReentrantReadWriteLock lock
private final ReentrantReadWriteLock.ReadLock rlock
private final ReentrantReadWriteLock.WriteLock wlock
private final Connection conn
private final QuotaObserverChore chore
private Map<RegionInfo,Long> regionUsage
public TableQuotaSnapshotStore(Connection conn, QuotaObserverChore chore, Map<RegionInfo,Long> regionUsage)
public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota getSpaceQuota(TableName subject) throws IOException
QuotaSnapshotStoresubject. May be null.getSpaceQuota in interface QuotaSnapshotStore<TableName>subject - The object for which the quota should be fetchedIOExceptionorg.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas getQuotaForTable(TableName table) throws IOException
IOExceptionpublic SpaceQuotaSnapshot getCurrentState(TableName table)
QuotaSnapshotStoreSpaceQuotaSnapshot for the given subject.getCurrentState in interface QuotaSnapshotStore<TableName>table - The object which the quota snapshot should be fetchedpublic SpaceQuotaSnapshot getTargetState(TableName table, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota spaceQuota) throws IOException
QuotaSnapshotStoregetTargetState in interface QuotaSnapshotStore<TableName>table - The object which to determine the target SpaceQuotaSnapshot ofspaceQuota - The quota "definition" for the subjectIOExceptionlong getSnapshotSizesForTable(TableName tn) throws IOException
tn provided. Any
 malformed records are skipped with a warning printed out.IOExceptionpublic Iterable<Map.Entry<RegionInfo,Long>> filterBySubject(TableName table)
QuotaSnapshotStoreregions, returning those which match the given
 subject.filterBySubject in interface QuotaSnapshotStore<TableName>table - The filter criteria. Only regions belonging to this parameter will be returnedpublic void setCurrentState(TableName table, SpaceQuotaSnapshot snapshot)
QuotaSnapshotStoreSpaceQuotaSnapshot for the subject.setCurrentState in interface QuotaSnapshotStore<TableName>table - The object which the SpaceQuotaSnapshot is being persisted forsnapshot - The current state of the subjectpublic void setRegionUsage(Map<RegionInfo,Long> regionUsage)
QuotaSnapshotStorethis with the latest snapshot of filesystem use by region.setRegionUsage in interface QuotaSnapshotStore<TableName>regionUsage - A map of RegionInfo objects to their filesystem usage in bytesCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.