Package org.apache.hadoop.hbase.quotas
Interface SpaceViolationPolicyEnforcement
- All Known Implementing Classes:
AbstractViolationPolicyEnforcement
,DefaultViolationPolicyEnforcement
,DisableTableViolationPolicyEnforcement
,MissingSnapshotViolationPolicyEnforcement
,NoInsertsViolationPolicyEnforcement
,NoWritesCompactionsViolationPolicyEnforcement
,NoWritesViolationPolicyEnforcement
RegionServer implementation of
SpaceViolationPolicy
. Implementations must have a public,
no-args constructor.-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether or not compactions on this table should be disabled for this policy.void
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.Returns theSpaceQuotaSnapshot
this
was initialized with.void
initialize
(RegionServerServices rss, TableName tableName, SpaceQuotaSnapshot snapshot) Initializes this policy instance.boolean
Returns whether thet caller should verify any bulk loads againstthis
.
-
Method Details
-
initialize
Initializes this policy instance. -
enable
Enables this policy. Not all policies have enable actions.- Throws:
IOException
-
disable
Disables this policy. Not all policies have disable actions.- Throws:
IOException
-
check
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
Returns a logical name for theSpaceViolationPolicy
that this enforcement is for. -
areCompactionsDisabled
boolean areCompactionsDisabled()Returns whether or not compactions on this table should be disabled for this policy. -
getQuotaSnapshot
Returns theSpaceQuotaSnapshot
this
was initialized with. -
shouldCheckBulkLoads
boolean shouldCheckBulkLoads()Returns whether thet caller should verify any bulk loads againstthis
. -
computeBulkLoadSize
long computeBulkLoadSize(org.apache.hadoop.fs.FileSystem fs, List<String> paths) throws SpaceLimitingException 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.- Parameters:
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
-