@InterfaceAudience.Private @InterfaceStability.Evolving 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
SpaceQuotaSnapshots 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
SpaceViolationPolicyEnforcements into
SpaceViolationPolicys. |
void |
start() |
void |
stop() |
void |
updateQuotaSnapshot(Map<TableName,SpaceQuotaSnapshot> newSnapshots)
Updates the current
SpaceQuotaSnapshots for the RegionServer. |
public RegionServerSpaceQuotaManager(RegionServerServices rsServices)
public void start()
throws IOException
IOExceptionpublic void stop()
public Map<TableName,SpaceQuotaSnapshot> copyQuotaSnapshots()
SpaceQuotaSnapshots that were recorded. The current view
of what the RegionServer thinks the table's utilization is.public void updateQuotaSnapshot(Map<TableName,SpaceQuotaSnapshot> newSnapshots)
SpaceQuotaSnapshots for the RegionServer.newSnapshots - The space quota snapshots.public ActivePolicyEnforcement getActiveEnforcements()
public Map<TableName,SpaceQuotaSnapshot> getActivePoliciesAsMap()
SpaceViolationPolicyEnforcements into
SpaceViolationPolicys.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 check