Package org.apache.hadoop.hbase.quotas
Class SpaceLimitSettings
java.lang.Object
org.apache.hadoop.hbase.quotas.QuotaSettings
org.apache.hadoop.hbase.quotas.SpaceLimitSettings
A
QuotaSettings implementation for configuring filesystem-use quotas.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest -
Constructor Summary
ConstructorsConstructorDescriptionSpaceLimitSettings(String namespace) Constructs aSpaceLimitSettingsto remove a space quota on the givennamespace.SpaceLimitSettings(String namespace, long sizeLimit, SpaceViolationPolicy violationPolicy) SpaceLimitSettings(TableName tableName) Constructs aSpaceLimitSettingsto remove a space quota on the giventableName.SpaceLimitSettings(TableName tableName, long sizeLimit, SpaceViolationPolicy violationPolicy) SpaceLimitSettings(TableName tableName, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest req) -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequestbuildProtoAddQuota(long sizeLimit, SpaceViolationPolicy violationPolicy) Builds aQuotaProtos.SpaceQuotaprotobuf object given the arguments.private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequestbuildProtoFromQuota(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota protoQuota) Build aQuotaProtos.SpaceLimitRequestprotobuf object from the givenQuotaProtos.SpaceQuota.private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequestBuilds aQuotaProtos.SpaceQuotaprotobuf object to remove a quota.boolean(package private) static SpaceLimitSettingsfromSpaceQuota(String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota proto) Constructs aSpaceLimitSettingsfrom the provided protobuf message and namespace.(package private) static SpaceLimitSettingsfromSpaceQuota(TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota proto) Constructs aSpaceLimitSettingsfrom the provided protobuf message and tablename.(package private) org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequestgetProto()Returns a copy of the internal state ofthisinthashCode()protected QuotaSettingsmerge(QuotaSettings newSettings) Merges the provided settings withthisand returns a new settings object to the caller if the merged settings differ from the original.protected voidsetupSetQuotaRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest.Builder builder) Called by toSetQuotaRequestProto() the subclass should implement this method to set the specific SetQuotaRequest properties.toString()(package private) static voidvalidateProtoArguments(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota proto) Validates that the provided protobuf SpaceQuota has the necessary information to construct aSpaceLimitSettings.private voidvalidateSizeLimit(long sizeLimit) Methods inherited from class org.apache.hadoop.hbase.quotas.QuotaSettings
buildFromProto, buildSetQuotaRequestProto, getNamespace, getRegionServer, getTableName, getUserName, ownerToString, sizeToString, timeToString, validateQuotaTarget
-
Field Details
-
proto
-
-
Constructor Details
-
SpaceLimitSettings
SpaceLimitSettings(TableName tableName, long sizeLimit, SpaceViolationPolicy violationPolicy) -
SpaceLimitSettings
SpaceLimitSettings(TableName tableName) Constructs aSpaceLimitSettingsto remove a space quota on the giventableName. -
SpaceLimitSettings
SpaceLimitSettings(String namespace, long sizeLimit, SpaceViolationPolicy violationPolicy) -
SpaceLimitSettings
SpaceLimitSettings(String namespace) Constructs aSpaceLimitSettingsto remove a space quota on the givennamespace. -
SpaceLimitSettings
SpaceLimitSettings(TableName tableName, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest req)
-
-
Method Details
-
buildProtoFromQuota
private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest buildProtoFromQuota(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota protoQuota) Build aQuotaProtos.SpaceLimitRequestprotobuf object from the givenQuotaProtos.SpaceQuota.- Parameters:
protoQuota- The preconstructed SpaceQuota protobuf- Returns:
- A protobuf request to change a space limit quota
-
buildProtoAddQuota
private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest buildProtoAddQuota(long sizeLimit, SpaceViolationPolicy violationPolicy) Builds aQuotaProtos.SpaceQuotaprotobuf object given the arguments.- Parameters:
sizeLimit- The size limit of the quota.violationPolicy- The action to take when the quota is exceeded.- Returns:
- The protobuf SpaceQuota representation.
-
buildProtoRemoveQuota
private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest buildProtoRemoveQuota()Builds aQuotaProtos.SpaceQuotaprotobuf object to remove a quota.- Returns:
- The protobuf SpaceQuota representation.
-
getProto
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest getProto()Returns a copy of the internal state ofthis -
getQuotaType
- Specified by:
getQuotaTypein classQuotaSettings
-
setupSetQuotaRequest
protected void setupSetQuotaRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest.Builder builder) Description copied from class:QuotaSettingsCalled by toSetQuotaRequestProto() the subclass should implement this method to set the specific SetQuotaRequest properties.- Specified by:
setupSetQuotaRequestin classQuotaSettings
-
fromSpaceQuota
static SpaceLimitSettings fromSpaceQuota(TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota proto) Constructs aSpaceLimitSettingsfrom the provided protobuf message and tablename.- Parameters:
tableName- The target tablename for the limit.proto- The protobuf representation.- Returns:
- A QuotaSettings.
-
fromSpaceQuota
static SpaceLimitSettings fromSpaceQuota(String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota proto) Constructs aSpaceLimitSettingsfrom the provided protobuf message and namespace.- Parameters:
namespace- The target namespace for the limit.proto- The protobuf representation.- Returns:
- A QuotaSettings.
-
validateProtoArguments
static void validateProtoArguments(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota proto) Validates that the provided protobuf SpaceQuota has the necessary information to construct aSpaceLimitSettings.- Parameters:
proto- The protobuf message to validate.
-
hashCode
-
equals
-
toString
-
merge
Description copied from class:QuotaSettingsMerges the provided settings withthisand returns a new settings object to the caller if the merged settings differ from the original.- Specified by:
mergein classQuotaSettings- Parameters:
newSettings- The new settings to merge in.- Returns:
- The merged
QuotaSettingsobject or null if the quota should be deleted.
-
validateSizeLimit
-