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
FieldsModifier and TypeFieldDescription(package private) SpaceQuotaSnapshot(package private) RegionServerServices(package private) TableName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether or not compactions on this table should be disabled for this policy.(package private) longgetFileSize(org.apache.hadoop.fs.FileSystem fs, String path) Computes the size of a single file on the filesystem.Returns theSpaceQuotaSnapshotthiswas initialized with.voidinitialize(RegionServerServices rss, TableName tableName, SpaceQuotaSnapshot snapshot) Initializes this policy instance.voidsetQuotaSnapshot(SpaceQuotaSnapshot snapshot) voidvoidsetTableName(TableName tableName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:SpaceViolationPolicyEnforcementReturns theSpaceQuotaSnapshotthiswas initialized with.- Specified by:
getQuotaSnapshotin interfaceSpaceViolationPolicyEnforcement
-
initialize
Description copied from interface:SpaceViolationPolicyEnforcementInitializes this policy instance.- Specified by:
initializein interfaceSpaceViolationPolicyEnforcement
-
areCompactionsDisabled
Description copied from interface:SpaceViolationPolicyEnforcementReturns whether or not compactions on this table should be disabled for this policy.- Specified by:
areCompactionsDisabledin interfaceSpaceViolationPolicyEnforcement
-
getFileSize
Computes the size of a single file on the filesystem. If the size cannot be computed for some reason, aSpaceLimitingExceptionis thrown, as the file may violate a quota. If the provided path does not reference a file, anIllegalArgumentExceptionis thrown.- Parameters:
fs- The FileSystem which the path refers to a file uponpath- The path on thefsto a file whose size is being checked- Returns:
- The size in bytes of the file
- Throws:
SpaceLimitingException
-