Package org.apache.hadoop.hbase.quotas
Class QuotaSettingsFactory
java.lang.Object
org.apache.hadoop.hbase.quotas.QuotaSettingsFactory
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic QuotaSettings
bypassGlobals
(String userName, boolean bypassGlobals) Set the "bypass global settings" for the specified user(package private) static List<QuotaSettings>
fromNamespaceQuotas
(String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) private static List<QuotaSettings>
fromQuotas
(String userName, TableName tableName, String namespace, String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) (package private) static List<QuotaSettings>
fromRegionServerQuotas
(String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) (package private) static QuotaSettings
fromSpace
(TableName table, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota protoQuota) (package private) static List<QuotaSettings>
fromTableQuotas
(TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) static List<ThrottleSettings>
fromTableThrottles
(TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle throttle) protected static List<ThrottleSettings>
fromThrottle
(String userName, TableName tableName, String namespace, String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle throttle) (package private) static List<QuotaSettings>
fromUserQuotas
(String userName, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) (package private) static List<QuotaSettings>
fromUserQuotas
(String userName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) (package private) static List<QuotaSettings>
fromUserQuotas
(String userName, TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) static QuotaSettings
limitNamespaceSpace
(String namespace, long sizeLimit, SpaceViolationPolicy violationPolicy) Creates aQuotaSettings
object to limit the FileSystem space usage for the given namespace to the given size in bytes.static QuotaSettings
limitTableSpace
(TableName tableName, long sizeLimit, SpaceViolationPolicy violationPolicy) Creates aQuotaSettings
object to limit the FileSystem space usage for the given table to the given size in bytes.static QuotaSettings
removeNamespaceSpaceLimit
(String namespace) Creates aQuotaSettings
object to remove the FileSystem space quota for the given namespace.static QuotaSettings
removeTableSpaceLimit
(TableName tableName) Creates aQuotaSettings
object to remove the FileSystem space quota for the given table.private static QuotaSettings
throttle
(String userName, TableName tableName, String namespace, String regionServer, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) static QuotaSettings
throttleNamespace
(String namespace, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified namespace.static QuotaSettings
throttleNamespace
(String namespace, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified namespace.static QuotaSettings
throttleRegionServer
(String regionServer, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified region server.static QuotaSettings
throttleTable
(TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified table.static QuotaSettings
throttleTable
(TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified table.static QuotaSettings
throttleUser
(String userName, String namespace, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified user on the specified namespace.static QuotaSettings
throttleUser
(String userName, String namespace, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified user on the specified namespace.static QuotaSettings
throttleUser
(String userName, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified user.static QuotaSettings
throttleUser
(String userName, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified user.static QuotaSettings
throttleUser
(String userName, TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified user on the specified table.static QuotaSettings
throttleUser
(String userName, TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified user on the specified table.static QuotaSettings
unthrottleNamespace
(String namespace) Remove the throttling for the specified namespace.static QuotaSettings
unthrottleNamespaceByThrottleType
(String namespace, ThrottleType type) Remove the throttling for the specified namespace by throttle type.static QuotaSettings
unthrottleRegionServer
(String regionServer) Remove the throttling for the specified region server.static QuotaSettings
unthrottleRegionServerByThrottleType
(String regionServer, ThrottleType type) Remove the throttling for the specified region server by throttle type.static QuotaSettings
unthrottleTable
(TableName tableName) Remove the throttling for the specified table.static QuotaSettings
unthrottleTableByThrottleType
(TableName tableName, ThrottleType type) Remove the throttling for the specified table.static QuotaSettings
unthrottleUser
(String userName) Remove the throttling for the specified user.static QuotaSettings
unthrottleUser
(String userName, String namespace) Remove the throttling for the specified user on the specified namespace.static QuotaSettings
unthrottleUser
(String userName, TableName tableName) Remove the throttling for the specified user on the specified table.static QuotaSettings
unthrottleUserByThrottleType
(String userName, String namespace, ThrottleType type) Remove the throttling for the specified user on the specified namespace.static QuotaSettings
unthrottleUserByThrottleType
(String userName, ThrottleType type) Remove the throttling for the specified user.static QuotaSettings
unthrottleUserByThrottleType
(String userName, TableName tableName, ThrottleType type) Remove the throttling for the specified user on the specified table.
-
Constructor Details
-
QuotaSettingsFactory
public QuotaSettingsFactory()
-
-
Method Details
-
fromUserQuotas
static List<QuotaSettings> fromUserQuotas(String userName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) -
fromUserQuotas
static List<QuotaSettings> fromUserQuotas(String userName, TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) -
fromUserQuotas
static List<QuotaSettings> fromUserQuotas(String userName, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) -
fromTableQuotas
static List<QuotaSettings> fromTableQuotas(TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) -
fromNamespaceQuotas
static List<QuotaSettings> fromNamespaceQuotas(String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) -
fromRegionServerQuotas
static List<QuotaSettings> fromRegionServerQuotas(String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) -
fromQuotas
private static List<QuotaSettings> fromQuotas(String userName, TableName tableName, String namespace, String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas quotas) -
fromTableThrottles
public static List<ThrottleSettings> fromTableThrottles(TableName tableName, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle throttle) -
fromThrottle
protected static List<ThrottleSettings> fromThrottle(String userName, TableName tableName, String namespace, String regionServer, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Throttle throttle) -
fromSpace
static QuotaSettings fromSpace(TableName table, String namespace, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota protoQuota) -
throttleUser
public static QuotaSettings throttleUser(String userName, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified user.- Parameters:
userName
- the user to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unit- Returns:
- the quota settings
-
throttleUser
public static QuotaSettings throttleUser(String userName, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified user.- Parameters:
userName
- the user to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unitscope
- the scope of throttling- Returns:
- the quota settings
-
throttleUser
public static QuotaSettings throttleUser(String userName, TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified user on the specified table.- Parameters:
userName
- the user to throttletableName
- the table to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unit- Returns:
- the quota settings
-
throttleUser
public static QuotaSettings throttleUser(String userName, TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified user on the specified table.- Parameters:
userName
- the user to throttletableName
- the table to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unitscope
- the scope of throttling- Returns:
- the quota settings
-
throttleUser
public static QuotaSettings throttleUser(String userName, String namespace, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified user on the specified namespace.- Parameters:
userName
- the user to throttlenamespace
- the namespace to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unit- Returns:
- the quota settings
-
throttleUser
public static QuotaSettings throttleUser(String userName, String namespace, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified user on the specified namespace.- Parameters:
userName
- the user to throttlenamespace
- the namespace to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unitscope
- the scope of throttling- Returns:
- the quota settings
-
unthrottleUser
Remove the throttling for the specified user.- Parameters:
userName
- the user- Returns:
- the quota settings
-
unthrottleUserByThrottleType
Remove the throttling for the specified user.- Parameters:
userName
- the usertype
- the type of throttling- Returns:
- the quota settings
-
unthrottleUser
Remove the throttling for the specified user on the specified table.- Parameters:
userName
- the usertableName
- the table- Returns:
- the quota settings
-
unthrottleUserByThrottleType
public static QuotaSettings unthrottleUserByThrottleType(String userName, TableName tableName, ThrottleType type) Remove the throttling for the specified user on the specified table.- Parameters:
userName
- the usertableName
- the tabletype
- the type of throttling- Returns:
- the quota settings
-
unthrottleUser
Remove the throttling for the specified user on the specified namespace.- Parameters:
userName
- the usernamespace
- the namespace- Returns:
- the quota settings
-
unthrottleUserByThrottleType
public static QuotaSettings unthrottleUserByThrottleType(String userName, String namespace, ThrottleType type) Remove the throttling for the specified user on the specified namespace.- Parameters:
userName
- the usernamespace
- the namespacetype
- the type of throttling- Returns:
- the quota settings
-
throttleTable
public static QuotaSettings throttleTable(TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified table.- Parameters:
tableName
- the table to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unit- Returns:
- the quota settings
-
throttleTable
public static QuotaSettings throttleTable(TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified table.- Parameters:
tableName
- the table to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unitscope
- the scope of throttling- Returns:
- the quota settings
-
unthrottleTable
Remove the throttling for the specified table.- Parameters:
tableName
- the table- Returns:
- the quota settings
-
unthrottleTableByThrottleType
Remove the throttling for the specified table.- Parameters:
tableName
- the tabletype
- the type of throttling- Returns:
- the quota settings
-
throttleNamespace
public static QuotaSettings throttleNamespace(String namespace, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified namespace.- Parameters:
namespace
- the namespace to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unit- Returns:
- the quota settings
-
throttleNamespace
public static QuotaSettings throttleNamespace(String namespace, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified namespace.- Parameters:
namespace
- the namespace to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unitscope
- the scope of throttling- Returns:
- the quota settings
-
unthrottleNamespace
Remove the throttling for the specified namespace.- Parameters:
namespace
- the namespace- Returns:
- the quota settings
-
unthrottleNamespaceByThrottleType
Remove the throttling for the specified namespace by throttle type.- Parameters:
namespace
- the namespacetype
- the type of throttling- Returns:
- the quota settings
-
throttleRegionServer
public static QuotaSettings throttleRegionServer(String regionServer, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified region server.- Parameters:
regionServer
- the region server to throttletype
- the type of throttlinglimit
- the allowed number of request/data per timeUnittimeUnit
- the limit time unit- Returns:
- the quota settings
-
unthrottleRegionServer
Remove the throttling for the specified region server.- Parameters:
regionServer
- the region Server- Returns:
- the quota settings
-
unthrottleRegionServerByThrottleType
public static QuotaSettings unthrottleRegionServerByThrottleType(String regionServer, ThrottleType type) Remove the throttling for the specified region server by throttle type.- Parameters:
regionServer
- the region Servertype
- the type of throttling- Returns:
- the quota settings
-
throttle
private static QuotaSettings throttle(String userName, TableName tableName, String namespace, String regionServer, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) -
bypassGlobals
Set the "bypass global settings" for the specified user- Parameters:
userName
- the user to throttlebypassGlobals
- true if the global settings should be bypassed- Returns:
- the quota settings
-
limitTableSpace
public static QuotaSettings limitTableSpace(TableName tableName, long sizeLimit, SpaceViolationPolicy violationPolicy) Creates aQuotaSettings
object to limit the FileSystem space usage for the given table to the given size in bytes. When the space usage is exceeded by the table, the providedSpaceViolationPolicy
is enacted on the table.- Parameters:
tableName
- The name of the table on which the quota should be applied.sizeLimit
- The limit of a table's size in bytes.violationPolicy
- The action to take when the quota is exceeded.- Returns:
- An
QuotaSettings
object.
-
removeTableSpaceLimit
Creates aQuotaSettings
object to remove the FileSystem space quota for the given table.- Parameters:
tableName
- The name of the table to remove the quota for.- Returns:
- A
QuotaSettings
object.
-
limitNamespaceSpace
public static QuotaSettings limitNamespaceSpace(String namespace, long sizeLimit, SpaceViolationPolicy violationPolicy) Creates aQuotaSettings
object to limit the FileSystem space usage for the given namespace to the given size in bytes. When the space usage is exceeded by all tables in the namespace, the providedSpaceViolationPolicy
is enacted on all tables in the namespace.- Parameters:
namespace
- The namespace on which the quota should be applied.sizeLimit
- The limit of the namespace's size in bytes.violationPolicy
- The action to take when the the quota is exceeded.- Returns:
- An
QuotaSettings
object.
-
removeNamespaceSpaceLimit
Creates aQuotaSettings
object to remove the FileSystem space quota for the given namespace.- Parameters:
namespace
- The namespace to remove the quota on.- Returns:
- A
QuotaSettings
object.
-