Class QuotaSettingsFactory

java.lang.Object
org.apache.hadoop.hbase.quotas.QuotaSettingsFactory

@Public public class QuotaSettingsFactory extends Object
  • Constructor Details

  • 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 throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - 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 throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - the limit time unit
      scope - 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 throttle
      tableName - the table to throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - 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 throttle
      tableName - the table to throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - the limit time unit
      scope - 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 throttle
      namespace - the namespace to throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - 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 throttle
      namespace - the namespace to throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - the limit time unit
      scope - the scope of throttling
      Returns:
      the quota settings
    • unthrottleUser

      public static QuotaSettings unthrottleUser(String userName)
      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 user
      type - the type of throttling
      Returns:
      the quota settings
    • unthrottleUser

      public static QuotaSettings unthrottleUser(String userName, TableName tableName)
      Remove the throttling for the specified user on the specified table.
      Parameters:
      userName - the user
      tableName - 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 user
      tableName - the table
      type - the type of throttling
      Returns:
      the quota settings
    • unthrottleUser

      public static QuotaSettings unthrottleUser(String userName, String namespace)
      Remove the throttling for the specified user on the specified namespace.
      Parameters:
      userName - the user
      namespace - 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 user
      namespace - the namespace
      type - 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 throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - 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 throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - the limit time unit
      scope - the scope of throttling
      Returns:
      the quota settings
    • unthrottleTable

      public static QuotaSettings unthrottleTable(TableName tableName)
      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 table
      type - 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 throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - 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 throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - the limit time unit
      scope - the scope of throttling
      Returns:
      the quota settings
    • unthrottleNamespace

      public static QuotaSettings unthrottleNamespace(String namespace)
      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 namespace
      type - 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 throttle
      type - the type of throttling
      limit - the allowed number of request/data per timeUnit
      timeUnit - the limit time unit
      Returns:
      the quota settings
    • unthrottleRegionServer

      public static QuotaSettings unthrottleRegionServer(String regionServer)
      Remove the throttling for the specified region server.
      Parameters:
      regionServer - the region Server
      Returns:
      the quota settings
    • unthrottleRegionServerByThrottleType

      Remove the throttling for the specified region server by throttle type.
      Parameters:
      regionServer - the region Server
      type - 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

      public static QuotaSettings bypassGlobals(String userName, boolean bypassGlobals)
      Set the "bypass global settings" for the specified user
      Parameters:
      userName - the user to throttle
      bypassGlobals - true if the global settings should be bypassed
      Returns:
      the quota settings
    • limitTableSpace

      public static QuotaSettings limitTableSpace(TableName tableName, long sizeLimit, SpaceViolationPolicy violationPolicy)
      Creates a QuotaSettings 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 provided SpaceViolationPolicy 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

      public static QuotaSettings removeTableSpaceLimit(TableName tableName)
      Creates a QuotaSettings 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 a QuotaSettings 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 provided SpaceViolationPolicy 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

      public static QuotaSettings removeNamespaceSpaceLimit(String namespace)
      Creates a QuotaSettings object to remove the FileSystem space quota for the given namespace.
      Parameters:
      namespace - The namespace to remove the quota on.
      Returns:
      A QuotaSettings object.