Package org.apache.hadoop.hbase.quotas
Class QuotaSettingsFactory
java.lang.Object
org.apache.hadoop.hbase.quotas.QuotaSettingsFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QuotaSettingsbypassGlobals(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 QuotaSettingsfromSpace(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 QuotaSettingslimitNamespaceSpace(String namespace, long sizeLimit, SpaceViolationPolicy violationPolicy) Creates aQuotaSettingsobject to limit the FileSystem space usage for the given namespace to the given size in bytes.static QuotaSettingslimitTableSpace(TableName tableName, long sizeLimit, SpaceViolationPolicy violationPolicy) Creates aQuotaSettingsobject to limit the FileSystem space usage for the given table to the given size in bytes.static QuotaSettingsremoveNamespaceSpaceLimit(String namespace) Creates aQuotaSettingsobject to remove the FileSystem space quota for the given namespace.static QuotaSettingsremoveTableSpaceLimit(TableName tableName) Creates aQuotaSettingsobject to remove the FileSystem space quota for the given table.private static QuotaSettingsthrottle(String userName, TableName tableName, String namespace, String regionServer, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) static QuotaSettingsthrottleNamespace(String namespace, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified namespace.static QuotaSettingsthrottleNamespace(String namespace, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified namespace.static QuotaSettingsthrottleRegionServer(String regionServer, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified region server.static QuotaSettingsthrottleTable(TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified table.static QuotaSettingsthrottleTable(TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified table.static QuotaSettingsthrottleUser(String userName, String namespace, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified user on the specified namespace.static QuotaSettingsthrottleUser(String userName, String namespace, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified user on the specified namespace.static QuotaSettingsthrottleUser(String userName, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified user.static QuotaSettingsthrottleUser(String userName, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified user.static QuotaSettingsthrottleUser(String userName, TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit) Throttle the specified user on the specified table.static QuotaSettingsthrottleUser(String userName, TableName tableName, ThrottleType type, long limit, TimeUnit timeUnit, QuotaScope scope) Throttle the specified user on the specified table.static QuotaSettingsunthrottleNamespace(String namespace) Remove the throttling for the specified namespace.static QuotaSettingsunthrottleNamespaceByThrottleType(String namespace, ThrottleType type) Remove the throttling for the specified namespace by throttle type.static QuotaSettingsunthrottleRegionServer(String regionServer) Remove the throttling for the specified region server.static QuotaSettingsunthrottleRegionServerByThrottleType(String regionServer, ThrottleType type) Remove the throttling for the specified region server by throttle type.static QuotaSettingsunthrottleTable(TableName tableName) Remove the throttling for the specified table.static QuotaSettingsunthrottleTableByThrottleType(TableName tableName, ThrottleType type) Remove the throttling for the specified table.static QuotaSettingsunthrottleUser(String userName) Remove the throttling for the specified user.static QuotaSettingsunthrottleUser(String userName, String namespace) Remove the throttling for the specified user on the specified namespace.static QuotaSettingsunthrottleUser(String userName, TableName tableName) Remove the throttling for the specified user on the specified table.static QuotaSettingsunthrottleUserByThrottleType(String userName, String namespace, ThrottleType type) Remove the throttling for the specified user on the specified namespace.static QuotaSettingsunthrottleUserByThrottleType(String userName, ThrottleType type) Remove the throttling for the specified user.static QuotaSettingsunthrottleUserByThrottleType(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 aQuotaSettingsobject 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 providedSpaceViolationPolicyis 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
QuotaSettingsobject.
-
removeTableSpaceLimit
Creates aQuotaSettingsobject to remove the FileSystem space quota for the given table.- Parameters:
tableName- The name of the table to remove the quota for.- Returns:
- A
QuotaSettingsobject.
-
limitNamespaceSpace
public static QuotaSettings limitNamespaceSpace(String namespace, long sizeLimit, SpaceViolationPolicy violationPolicy) Creates aQuotaSettingsobject 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 providedSpaceViolationPolicyis 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
QuotaSettingsobject.
-
removeNamespaceSpaceLimit
Creates aQuotaSettingsobject to remove the FileSystem space quota for the given namespace.- Parameters:
namespace- The namespace to remove the quota on.- Returns:
- A
QuotaSettingsobject.
-