Class DefaultViolationPolicyEnforcement
java.lang.Object
org.apache.hadoop.hbase.quotas.policies.AbstractViolationPolicyEnforcement
org.apache.hadoop.hbase.quotas.policies.DefaultViolationPolicyEnforcement
- All Implemented Interfaces:
SpaceViolationPolicyEnforcement
- Direct Known Subclasses:
DisableTableViolationPolicyEnforcement
,NoInsertsViolationPolicyEnforcement
,NoWritesViolationPolicyEnforcement
The default implementation for
SpaceViolationPolicyEnforcement
. This is done because all
tables, whether or not they're in violation now, should be checking bulk loads to proactively
catch a swell of files that would push the table into violation.-
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
-
Constructor Details
-
DefaultViolationPolicyEnforcement
public DefaultViolationPolicyEnforcement()
-
-
Method Details
-
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
-
getPolicyName
Description copied from interface:SpaceViolationPolicyEnforcement
Returns a logical name for theSpaceViolationPolicy
that this enforcement is for. -
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.
-
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
-