Package org.apache.hadoop.hbase.quotas
Class GlobalQuotaSettingsImpl
java.lang.Object
org.apache.hadoop.hbase.quotas.QuotaSettings
org.apache.hadoop.hbase.quotas.GlobalQuotaSettings
org.apache.hadoop.hbase.quotas.GlobalQuotaSettingsImpl
Implementation of
GlobalQuotaSettings
to hide the Protobuf messages we use internally.-
Field Summary
Modifier and TypeFieldDescriptionprivate final Boolean
private final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota
private final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle
-
Constructor Summary
ModifierConstructorDescriptionprotected
GlobalQuotaSettingsImpl
(String username, TableName tableName, String namespace, String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) protected
GlobalQuotaSettingsImpl
(String userName, TableName tableName, String namespace, String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle throttleProto, Boolean bypassGlobals, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota spaceProto) -
Method Summary
Modifier and TypeMethodDescriptionprivate Map<ThrottleType,
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.TimedQuota> buildThrottleQuotas
(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle proto) protected Boolean
Computes a list of QuotaSettings that present the complete quota state of the combination of this user, table, and/or namespace.protected org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota
protected org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle
private boolean
hasThrottle
(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleType quotaType, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle.Builder throttleBuilder) protected GlobalQuotaSettingsImpl
merge
(QuotaSettings other) Merges the provided settings withthis
and returns a new settings object to the caller if the merged settings differ from the original.protected org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas
toQuotas()
Constructs a newQuotaProtos.Quotas
message fromthis
.toString()
private void
validateTimedQuota
(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.TimedQuota timedQuota) Methods inherited from class org.apache.hadoop.hbase.quotas.GlobalQuotaSettings
getQuotaType, setupSetQuotaRequest
Methods inherited from class org.apache.hadoop.hbase.quotas.QuotaSettings
buildFromProto, buildSetQuotaRequestProto, getNamespace, getRegionServer, getTableName, getUserName, ownerToString, sizeToString, timeToString, validateQuotaTarget
-
Field Details
-
throttleProto
-
bypassGlobals
-
spaceProto
-
-
Constructor Details
-
GlobalQuotaSettingsImpl
protected GlobalQuotaSettingsImpl(String username, TableName tableName, String namespace, String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) -
GlobalQuotaSettingsImpl
protected GlobalQuotaSettingsImpl(String userName, TableName tableName, String namespace, String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle throttleProto, Boolean bypassGlobals, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota spaceProto)
-
-
Method Details
-
getQuotaSettings
Description copied from class:GlobalQuotaSettings
Computes a list of QuotaSettings that present the complete quota state of the combination of this user, table, and/or namespace. Beware in calling this method repeatedly as the implementation of it may be costly.- Specified by:
getQuotaSettings
in classGlobalQuotaSettings
-
getThrottleProto
-
getBypassGlobals
-
getSpaceProto
-
toQuotas
Constructs a newQuotaProtos.Quotas
message fromthis
. -
hasThrottle
private boolean hasThrottle(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleType quotaType, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle.Builder throttleBuilder) -
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:
other
- The new settings to merge in.- Returns:
- The merged
QuotaSettings
object or null if the quota should be deleted. - Throws:
IOException
-
validateTimedQuota
private void validateTimedQuota(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.TimedQuota timedQuota) throws IOException - Throws:
IOException
-
toString
-
buildThrottleQuotas
private Map<ThrottleType,org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.TimedQuota> buildThrottleQuotas(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle proto)
-