@InterfaceAudience.Private public class RegionServerSpaceQuotaManager extends Object
SpaceQuotaSnapshot
and a SpaceViolationPolicyEnforcement
(which may be null when a quota is not
being violated). Both of these are sensitive on when they were last updated. The
{link SpaceQutoaViolationPolicyRefresherChore} periodically runs and updates
the state on this
.Constructor and Description |
---|
RegionServerSpaceQuotaManager(RegionServerServices rsServices) |
Modifier and Type | Method and Description |
---|---|
boolean |
areCompactionsDisabled(TableName tableName)
Returns whether or not compactions should be disabled for the given
tableName per
a space quota violation policy. |
Map<TableName,SpaceQuotaSnapshot> |
copyQuotaSnapshots()
Copies the last
SpaceQuotaSnapshot s that were recorded. |
void |
disableViolationPolicyEnforcement(TableName tableName)
Disables enforcement on any violation policy on the given
tableName . |
void |
enforceViolationPolicy(TableName tableName,
SpaceQuotaSnapshot snapshot)
Enforces the given violationPolicy on the given table in this RegionServer.
|
ActivePolicyEnforcement |
getActiveEnforcements()
Creates an object well-suited for the RegionServer to use in verifying active policies.
|
Map<TableName,SpaceQuotaSnapshot> |
getActivePoliciesAsMap()
Converts a map of table to
SpaceViolationPolicyEnforcement s into
SpaceViolationPolicy s. |
boolean |
isStarted() |
void |
start() |
void |
stop() |
void |
updateQuotaSnapshot(Map<TableName,SpaceQuotaSnapshot> newSnapshots)
Updates the current
SpaceQuotaSnapshot s for the RegionServer. |
public RegionServerSpaceQuotaManager(RegionServerServices rsServices)
public void start() throws IOException
IOException
public void stop()
public boolean isStarted()
Chore
has been started.public Map<TableName,SpaceQuotaSnapshot> copyQuotaSnapshots()
SpaceQuotaSnapshot
s that were recorded. The current view
of what the RegionServer thinks the table's utilization is.public void updateQuotaSnapshot(Map<TableName,SpaceQuotaSnapshot> newSnapshots)
SpaceQuotaSnapshot
s for the RegionServer.newSnapshots
- The space quota snapshots.public ActivePolicyEnforcement getActiveEnforcements()
public Map<TableName,SpaceQuotaSnapshot> getActivePoliciesAsMap()
SpaceViolationPolicyEnforcement
s into
SpaceViolationPolicy
s.public void enforceViolationPolicy(TableName tableName, SpaceQuotaSnapshot snapshot)
public void disableViolationPolicyEnforcement(TableName tableName)
tableName
.public boolean areCompactionsDisabled(TableName tableName)
tableName
per
a space quota violation policy. A convenience method.tableName
- The table to checkCopyright © 2007–2019 Cloudera. All rights reserved.