Class MissingSnapshotViolationPolicyEnforcement
java.lang.Object
org.apache.hadoop.hbase.quotas.policies.AbstractViolationPolicyEnforcement
org.apache.hadoop.hbase.quotas.policies.MissingSnapshotViolationPolicyEnforcement
- All Implemented Interfaces:
SpaceViolationPolicyEnforcement
@Private
public final class MissingSnapshotViolationPolicyEnforcement
extends AbstractViolationPolicyEnforcement
A
SpaceViolationPolicyEnforcement
which can be treated as a singleton. When a quota is
not defined on a table or we lack quota information, we want to avoid creating a policy, keeping
this path fast.-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.quotas.policies.AbstractViolationPolicyEnforcement
quotaSnapshot, rss, tableName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks the givenMutation
againstthis
policy.long
computeBulkLoadSize
(org.apache.hadoop.fs.FileSystem fs, List<String> paths) Computes the size of the file(s) at the given path againstthis
policy and the currentSpaceQuotaSnapshot
.void
disable()
Disables this policy.void
enable()
Enables this policy.Returns a logical name for theSpaceViolationPolicy
that this enforcement is for.boolean
Returns whether thet caller should verify any bulk loads againstthis
.Methods inherited from class org.apache.hadoop.hbase.quotas.policies.AbstractViolationPolicyEnforcement
areCompactionsDisabled, getFileSize, getQuotaSnapshot, getRegionServerServices, getTableName, initialize, setQuotaSnapshot, setRegionServerServices, setTableName
-
Field Details
-
SINGLETON
-
-
Constructor Details
-
MissingSnapshotViolationPolicyEnforcement
-
-
Method Details
-
getInstance
-
shouldCheckBulkLoads
Description copied from interface:SpaceViolationPolicyEnforcement
Returns whether thet caller should verify any bulk loads againstthis
. -
computeBulkLoadSize
public long computeBulkLoadSize(org.apache.hadoop.fs.FileSystem fs, List<String> paths) throws SpaceLimitingException Description copied from interface:SpaceViolationPolicyEnforcement
Computes the size of the file(s) at the given path againstthis
policy and the currentSpaceQuotaSnapshot
. If the file would violate the policy, aSpaceLimitingException
will be thrown.paths
- The paths in HDFS to files to be bulk loaded.- Returns:
- The size, in bytes, of the files that would be loaded.
- Throws:
SpaceLimitingException
-
enable
Description copied from interface:SpaceViolationPolicyEnforcement
Enables this policy. Not all policies have enable actions.- Throws:
IOException
-
disable
Description copied from interface:SpaceViolationPolicyEnforcement
Disables this policy. Not all policies have disable actions.- Throws:
IOException
-
check
Description copied from interface:SpaceViolationPolicyEnforcement
Checks the givenMutation
againstthis
policy. If theMutation
violates the policy, this policy should throw aSpaceLimitingException
.- Throws:
SpaceLimitingException
- When the given mutation violates this policy.
-
getPolicyName
Description copied from interface:SpaceViolationPolicyEnforcement
Returns a logical name for theSpaceViolationPolicy
that this enforcement is for.
-