@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
.Modifier and Type | Field and Description |
---|---|
private AtomicReference<Map<TableName,SpaceQuotaSnapshot>> |
currentQuotaSnapshots |
private ConcurrentHashMap<TableName,SpaceViolationPolicyEnforcement> |
enforcedPolicies |
private SpaceViolationPolicyEnforcementFactory |
factory |
private static org.slf4j.Logger |
LOG |
private RegionServerServices |
rsServices |
private SpaceQuotaRefresherChore |
spaceQuotaRefresher |
private boolean |
started |
Constructor and Description |
---|
RegionServerSpaceQuotaManager(RegionServerServices rsServices) |
RegionServerSpaceQuotaManager(RegionServerServices rsServices,
SpaceViolationPolicyEnforcementFactory factory) |
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. |
(package private) Map<TableName,SpaceViolationPolicyEnforcement> |
copyActiveEnforcements()
Returns the collection of tables which have quota violation policies enforced on
this RegionServer.
|
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. |
(package private) Connection |
getConnection() |
(package private) SpaceViolationPolicyEnforcementFactory |
getFactory() |
(package private) RegionServerServices |
getRegionServerServices() |
boolean |
isStarted() |
void |
start() |
void |
stop() |
void |
updateQuotaSnapshot(Map<TableName,SpaceQuotaSnapshot> newSnapshots)
Updates the current
SpaceQuotaSnapshot s for the RegionServer. |
private static final org.slf4j.Logger LOG
private final RegionServerServices rsServices
private SpaceQuotaRefresherChore spaceQuotaRefresher
private AtomicReference<Map<TableName,SpaceQuotaSnapshot>> currentQuotaSnapshots
private boolean started
private final ConcurrentHashMap<TableName,SpaceViolationPolicyEnforcement> enforcedPolicies
private SpaceViolationPolicyEnforcementFactory factory
public RegionServerSpaceQuotaManager(RegionServerServices rsServices)
RegionServerSpaceQuotaManager(RegionServerServices rsServices, SpaceViolationPolicyEnforcementFactory factory)
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 checkMap<TableName,SpaceViolationPolicyEnforcement> copyActiveEnforcements()
RegionServerServices getRegionServerServices()
Connection getConnection()
SpaceViolationPolicyEnforcementFactory getFactory()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.