@InterfaceAudience.Private @InterfaceStability.Evolving public class ActivePolicyEnforcement extends Object
locallyCachedPolicies
. The
locallyCachedPolicies
are mutable given the current activePolicies
and
snapshots
. It is expected that when a new instance of this class is instantiated, we also
want to invalidate those previously cached policies (as they may now be invalidate if we received
new quota usage information).Modifier and Type | Field and Description |
---|---|
private Map<TableName,SpaceViolationPolicyEnforcement> |
activePolicies |
private SpaceViolationPolicyEnforcementFactory |
factory |
private Map<TableName,SpaceViolationPolicyEnforcement> |
locallyCachedPolicies |
private RegionServerServices |
rss |
private Map<TableName,SpaceQuotaSnapshot> |
snapshots |
Constructor and Description |
---|
ActivePolicyEnforcement(Map<TableName,SpaceViolationPolicyEnforcement> activePolicies,
Map<TableName,SpaceQuotaSnapshot> snapshots,
RegionServerServices rss) |
ActivePolicyEnforcement(Map<TableName,SpaceViolationPolicyEnforcement> activePolicies,
Map<TableName,SpaceQuotaSnapshot> snapshots,
RegionServerServices rss,
SpaceViolationPolicyEnforcementFactory factory) |
Modifier and Type | Method and Description |
---|---|
(package private) Map<TableName,SpaceViolationPolicyEnforcement> |
getLocallyCachedPolicies()
Returns an unmodifiable version of the policy enforcements that were cached because they are
not in violation of their quota.
|
Map<TableName,SpaceViolationPolicyEnforcement> |
getPolicies()
Returns an unmodifiable version of the active
SpaceViolationPolicyEnforcement s. |
SpaceViolationPolicyEnforcement |
getPolicyEnforcement(Region r)
Returns the proper
SpaceViolationPolicyEnforcement implementation for the given table. |
SpaceViolationPolicyEnforcement |
getPolicyEnforcement(TableName tableName)
Returns the proper
SpaceViolationPolicyEnforcement implementation for the given table. |
String |
toString() |
private final Map<TableName,SpaceViolationPolicyEnforcement> activePolicies
private final Map<TableName,SpaceQuotaSnapshot> snapshots
private final RegionServerServices rss
private final SpaceViolationPolicyEnforcementFactory factory
private final Map<TableName,SpaceViolationPolicyEnforcement> locallyCachedPolicies
public ActivePolicyEnforcement(Map<TableName,SpaceViolationPolicyEnforcement> activePolicies, Map<TableName,SpaceQuotaSnapshot> snapshots, RegionServerServices rss)
public ActivePolicyEnforcement(Map<TableName,SpaceViolationPolicyEnforcement> activePolicies, Map<TableName,SpaceQuotaSnapshot> snapshots, RegionServerServices rss, SpaceViolationPolicyEnforcementFactory factory)
public SpaceViolationPolicyEnforcement getPolicyEnforcement(Region r)
SpaceViolationPolicyEnforcement
implementation for the given table.
If the given table does not have a violation policy enforced, a "no-op" policy will be returned
which always allows an action.getPolicyEnforcement(TableName)
public SpaceViolationPolicyEnforcement getPolicyEnforcement(TableName tableName)
SpaceViolationPolicyEnforcement
implementation for the given table.
If the given table does not have a violation policy enforced, a "no-op" policy will be returned
which always allows an action.tableName
- The table to fetch the policy for.SpaceViolationPolicyEnforcement
instance.public Map<TableName,SpaceViolationPolicyEnforcement> getPolicies()
SpaceViolationPolicyEnforcement
s.Map<TableName,SpaceViolationPolicyEnforcement> getLocallyCachedPolicies()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.