@InterfaceAudience.Private public class TableQuotaSnapshotStore extends Object implements QuotaSnapshotStore<TableName>
QuotaSnapshotStore
for tables.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 given
subject . |
SpaceQuotaSnapshot |
getCurrentState(TableName table)
Returns the current
SpaceQuotaSnapshot for the given subject . |
QuotaProtos.SpaceQuota |
getSpaceQuota(TableName subject)
Fetch the Quota for the given
subject . |
SpaceQuotaSnapshot |
getTargetState(TableName table,
QuotaProtos.SpaceQuota spaceQuota)
|
void |
setCurrentState(TableName table,
SpaceQuotaSnapshot snapshot)
Persists the current
SpaceQuotaSnapshot for the subject . |
void |
setRegionUsage(Map<RegionInfo,Long> regionUsage)
Updates
this with the latest snapshot of filesystem use by region. |
public TableQuotaSnapshotStore(Connection conn, QuotaObserverChore chore, Map<RegionInfo,Long> regionUsage)
public QuotaProtos.SpaceQuota getSpaceQuota(TableName subject) throws IOException
QuotaSnapshotStore
subject
. May be null.getSpaceQuota
in interface QuotaSnapshotStore<TableName>
subject
- The object for which the quota should be fetchedIOException
public SpaceQuotaSnapshot getCurrentState(TableName table)
QuotaSnapshotStore
SpaceQuotaSnapshot
for the given subject
.getCurrentState
in interface QuotaSnapshotStore<TableName>
table
- The object which the quota snapshot should be fetchedpublic SpaceQuotaSnapshot getTargetState(TableName table, QuotaProtos.SpaceQuota spaceQuota) throws IOException
QuotaSnapshotStore
getTargetState
in interface QuotaSnapshotStore<TableName>
table
- The object which to determine the target SpaceQuotaSnapshot ofspaceQuota
- The quota "definition" for the subject
IOException
public Iterable<Map.Entry<RegionInfo,Long>> filterBySubject(TableName table)
QuotaSnapshotStore
regions
, 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)
QuotaSnapshotStore
SpaceQuotaSnapshot
for the subject
.setCurrentState
in interface QuotaSnapshotStore<TableName>
table
- The object which the SpaceQuotaSnapshot
is being persisted forsnapshot
- The current state of the subject
public void setRegionUsage(Map<RegionInfo,Long> regionUsage)
QuotaSnapshotStore
this
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–2019 Cloudera. All rights reserved.