Package org.apache.hadoop.hbase.quotas
Class ActivePolicyEnforcement
java.lang.Object
org.apache.hadoop.hbase.quotas.ActivePolicyEnforcement
A class to ease dealing with tables that have and do not have violation policies being enforced.
This class is immutable, expect for
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).-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map<TableName,
SpaceViolationPolicyEnforcement> private final SpaceViolationPolicyEnforcementFactory
private final Map<TableName,
SpaceViolationPolicyEnforcement> private final RegionServerServices
private final Map<TableName,
SpaceQuotaSnapshot> -
Constructor Summary
ConstructorDescriptionActivePolicyEnforcement
(Map<TableName, SpaceViolationPolicyEnforcement> activePolicies, Map<TableName, SpaceQuotaSnapshot> snapshots, RegionServerServices rss) ActivePolicyEnforcement
(Map<TableName, SpaceViolationPolicyEnforcement> activePolicies, Map<TableName, SpaceQuotaSnapshot> snapshots, RegionServerServices rss, SpaceViolationPolicyEnforcementFactory factory) -
Method Summary
Modifier and TypeMethodDescription(package private) Map<TableName,
SpaceViolationPolicyEnforcement> Returns an unmodifiable version of the policy enforcements that were cached because they are not in violation of their quota.Returns an unmodifiable version of the activeSpaceViolationPolicyEnforcement
s.Returns the properSpaceViolationPolicyEnforcement
implementation for the given table.getPolicyEnforcement
(TableName tableName) Returns the properSpaceViolationPolicyEnforcement
implementation for the given table.toString()
-
Field Details
-
activePolicies
-
snapshots
-
rss
-
factory
-
locallyCachedPolicies
-
-
Constructor Details
-
ActivePolicyEnforcement
public ActivePolicyEnforcement(Map<TableName, SpaceViolationPolicyEnforcement> activePolicies, Map<TableName, SpaceQuotaSnapshot> snapshots, RegionServerServices rss) -
ActivePolicyEnforcement
public ActivePolicyEnforcement(Map<TableName, SpaceViolationPolicyEnforcement> activePolicies, Map<TableName, SpaceQuotaSnapshot> snapshots, RegionServerServices rss, SpaceViolationPolicyEnforcementFactory factory)
-
-
Method Details
-
getPolicyEnforcement
Returns the properSpaceViolationPolicyEnforcement
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.- See Also:
-
getPolicyEnforcement
Returns the properSpaceViolationPolicyEnforcement
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.- Parameters:
tableName
- The table to fetch the policy for.- Returns:
- A non-null
SpaceViolationPolicyEnforcement
instance.
-
getPolicies
Returns an unmodifiable version of the activeSpaceViolationPolicyEnforcement
s. -
getLocallyCachedPolicies
Returns an unmodifiable version of the policy enforcements that were cached because they are not in violation of their quota. -
toString
-