Class AbstractViolationPolicyEnforcement
java.lang.Object
org.apache.hadoop.hbase.quotas.policies.AbstractViolationPolicyEnforcement
- All Implemented Interfaces:
SpaceViolationPolicyEnforcement
- Direct Known Subclasses:
DefaultViolationPolicyEnforcement
,MissingSnapshotViolationPolicyEnforcement
@Private
@Evolving
public abstract class AbstractViolationPolicyEnforcement
extends Object
implements SpaceViolationPolicyEnforcement
Abstract implementation for
SpaceViolationPolicyEnforcement
.-
Field Summary
Modifier and TypeFieldDescription(package private) SpaceQuotaSnapshot
(package private) RegionServerServices
(package private) TableName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether or not compactions on this table should be disabled for this policy.(package private) long
getFileSize
(org.apache.hadoop.fs.FileSystem fs, String path) Computes the size of a single file on the filesystem.Returns theSpaceQuotaSnapshot
this
was initialized with.void
initialize
(RegionServerServices rss, TableName tableName, SpaceQuotaSnapshot snapshot) Initializes this policy instance.void
setQuotaSnapshot
(SpaceQuotaSnapshot snapshot) void
void
setTableName
(TableName tableName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.quotas.SpaceViolationPolicyEnforcement
check, computeBulkLoadSize, disable, enable, getPolicyName, shouldCheckBulkLoads
-
Field Details
-
rss
-
tableName
-
quotaSnapshot
-
-
Constructor Details
-
AbstractViolationPolicyEnforcement
public AbstractViolationPolicyEnforcement()
-
-
Method Details
-
setRegionServerServices
-
setTableName
-
getRegionServerServices
-
getTableName
-
setQuotaSnapshot
-
getQuotaSnapshot
Description copied from interface:SpaceViolationPolicyEnforcement
Returns theSpaceQuotaSnapshot
this
was initialized with.- Specified by:
getQuotaSnapshot
in interfaceSpaceViolationPolicyEnforcement
-
initialize
Description copied from interface:SpaceViolationPolicyEnforcement
Initializes this policy instance.- Specified by:
initialize
in interfaceSpaceViolationPolicyEnforcement
-
areCompactionsDisabled
Description copied from interface:SpaceViolationPolicyEnforcement
Returns whether or not compactions on this table should be disabled for this policy.- Specified by:
areCompactionsDisabled
in interfaceSpaceViolationPolicyEnforcement
-
getFileSize
Computes the size of a single file on the filesystem. If the size cannot be computed for some reason, aSpaceLimitingException
is thrown, as the file may violate a quota. If the provided path does not reference a file, anIllegalArgumentException
is thrown.- Parameters:
fs
- The FileSystem which the path refers to a file uponpath
- The path on thefs
to a file whose size is being checked- Returns:
- The size in bytes of the file
- Throws:
SpaceLimitingException
-