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
Modifier and TypeFieldDescriptionprivate final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest
-
Constructor Summary
ConstructorDescriptionSpaceLimitSettings
(String namespace) Constructs aSpaceLimitSettings
to remove a space quota on the givennamespace
.SpaceLimitSettings
(String namespace, long sizeLimit, SpaceViolationPolicy violationPolicy) SpaceLimitSettings
(TableName tableName) Constructs aSpaceLimitSettings
to 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.SpaceLimitRequest
buildProtoAddQuota
(long sizeLimit, SpaceViolationPolicy violationPolicy) Builds aQuotaProtos.SpaceQuota
protobuf object given the arguments.private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest
buildProtoFromQuota
(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota protoQuota) Build aQuotaProtos.SpaceLimitRequest
protobuf object from the givenQuotaProtos.SpaceQuota
.private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest
Builds aQuotaProtos.SpaceQuota
protobuf object to remove a quota.boolean
(package private) static SpaceLimitSettings
fromSpaceQuota
(String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota proto) Constructs aSpaceLimitSettings
from the provided protobuf message and namespace.(package private) static SpaceLimitSettings
fromSpaceQuota
(TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota proto) Constructs aSpaceLimitSettings
from the provided protobuf message and tablename.(package private) org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceLimitRequest
getProto()
Returns a copy of the internal state ofthis
int
hashCode()
protected QuotaSettings
merge
(QuotaSettings newSettings) Merges the provided settings withthis
and returns a new settings object to the caller if the merged settings differ from the original.protected void
setupSetQuotaRequest
(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 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
.private void
validateSizeLimit
(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 aSpaceLimitSettings
to remove a space quota on the giventableName
. -
SpaceLimitSettings
SpaceLimitSettings(String namespace, long sizeLimit, SpaceViolationPolicy violationPolicy) -
SpaceLimitSettings
SpaceLimitSettings(String namespace) Constructs aSpaceLimitSettings
to 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.SpaceLimitRequest
protobuf 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.SpaceQuota
protobuf 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.SpaceQuota
protobuf 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:
getQuotaType
in classQuotaSettings
-
setupSetQuotaRequest
protected void setupSetQuotaRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest.Builder builder) Description copied from class:QuotaSettings
Called by toSetQuotaRequestProto() the subclass should implement this method to set the specific SetQuotaRequest properties.- Specified by:
setupSetQuotaRequest
in classQuotaSettings
-
fromSpaceQuota
static SpaceLimitSettings fromSpaceQuota(TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota proto) Constructs aSpaceLimitSettings
from 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 aSpaceLimitSettings
from 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:QuotaSettings
Merges the provided settings withthis
and returns a new settings object to the caller if the merged settings differ from the original.- Specified by:
merge
in classQuotaSettings
- Parameters:
newSettings
- The new settings to merge in.- Returns:
- The merged
QuotaSettings
object or null if the quota should be deleted.
-
validateSizeLimit
-