Class QuotaSettings

java.lang.Object
org.apache.hadoop.hbase.quotas.QuotaSettings
Direct Known Subclasses:
GlobalQuotaSettings, QuotaSettingsFactory.QuotaGlobalsSettingsBypass, SpaceLimitSettings, ThrottleSettings

@Public public abstract class QuotaSettings extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getQuotaType

      public abstract QuotaType getQuotaType()
    • getUserName

      public String getUserName()
    • getTableName

    • getNamespace

      public String getNamespace()
    • getRegionServer

    • buildFromProto

      @Private public static QuotaSettings buildFromProto(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest request)
      Converts the protocol buffer request into a QuotaSetting POJO. Arbitrarily enforces that the request only contain one "limit", despite the message allowing multiple. The public API does not allow such use of the message.
      Parameters:
      request - The protocol buffer request.
      Returns:
      A QuotaSettings POJO.
    • buildSetQuotaRequestProto

      @Private public static org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest buildSetQuotaRequestProto(QuotaSettings settings)
      Convert a QuotaSettings to a protocol buffer SetQuotaRequest. This is used internally by the Admin client to serialize the quota settings and send them to the master.
    • setupSetQuotaRequest

      @Private protected abstract void setupSetQuotaRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest.Builder builder)
      Called by toSetQuotaRequestProto() the subclass should implement this method to set the specific SetQuotaRequest properties.
    • ownerToString

      protected String ownerToString()
    • sizeToString

      protected static String sizeToString(long size)
    • timeToString

      protected static String timeToString(TimeUnit timeUnit)
    • merge

      abstract QuotaSettings merge(QuotaSettings newSettings) throws IOException
      Merges the provided settings with this and returns a new settings object to the caller if the merged settings differ from the original.
      Parameters:
      newSettings - The new settings to merge in.
      Returns:
      The merged QuotaSettings object or null if the quota should be deleted.
      Throws:
      IOException
    • validateQuotaTarget

      Validates that settings being merged into this is targeting the same "subject", e.g. user, table, namespace.
      Parameters:
      mergee - The quota settings to be merged into this.
      Throws:
      IllegalArgumentException - if the subjects are not equal.