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
FieldsModifier and TypeFieldDescriptionprivate final Booleanprivate final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaprivate final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGlobalQuotaSettingsImpl(String username, TableName tableName, String namespace, String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) protectedGlobalQuotaSettingsImpl(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 BooleanComputes 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.SpaceQuotaprotected org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttleprivate booleanhasThrottle(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.ThrottleType quotaType, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle.Builder throttleBuilder) protected GlobalQuotaSettingsImplmerge(QuotaSettings other) Merges the provided settings withthisand 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.QuotastoQuotas()Constructs a newQuotaProtos.Quotasmessage fromthis.toString()private voidvalidateTimedQuota(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.TimedQuota timedQuota) Methods inherited from class org.apache.hadoop.hbase.quotas.GlobalQuotaSettings
getQuotaType, setupSetQuotaRequestMethods 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:GlobalQuotaSettingsComputes 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:
getQuotaSettingsin classGlobalQuotaSettings
-
getThrottleProto
-
getBypassGlobals
-
getSpaceProto
-
toQuotas
Constructs a newQuotaProtos.Quotasmessage 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: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:
other- The new settings to merge in.- Returns:
- The merged
QuotaSettingsobject 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)
-