set_quota

Definition

Sets a new quota for the defined user, table, or namespace. Provides two forms of quotas:

  • SPACE — can be applied either to tables or to namespaces. Each quota limits the target’s size in the file system and defines the actions that should be performed when the target exceeds that limit. Different quotas can be applied to one table at the table and namespace levels. Table level quotas take priority over namespace level ones.

  • THROTTLE — can be applied to users, tables, or namespaces. Each quota limits the number of requests or the amount of data that can be read, written, or both read and written per the defined time range.

Usage

  • Setting a SPACE quota:

    set_quota TYPE => SPACE[,
              TABLE => '[<namespace_name>:]<table_name>'] | [, NAMESPACE => '<namespace_name>'],
              LIMIT => '<space_limit_value>',
              POLICY => <space_policy_value>
  • Removing a SPACE quota:

    set_quota TYPE => SPACE[,
              TABLE => '[<namespace_name>:]<table_name>'] | [, NAMESPACE => '<namespace_name>'],
              LIMIT => NONE
  • Setting a THROTTLE quota:

    set_quota TYPE => THROTTLE[,
              THROTTLE_TYPE => READ | WRITE][,
              USER => '<user_name>'][,
              TABLE => '[<namespace_name>:]<table_name>'] | [, NAMESPACE => '<namespace_name>'],
              LIMIT => '<throttle_limit_value>'
  • Removing a THROTTLE quota:

    set_quota TYPE => THROTTLE[,
              THROTTLE_TYPE => READ | WRITE][,
              USER => '<user_name>'][,
              TABLE => '[<namespace_name>:]<table_name>'] | [, NAMESPACE => '<namespace_name>'],
              LIMIT => NONE
CAUTION
SPACE quotas require a table name or a namespace name, not both of them. THROTTLE quotas require a user name, or a table name, or a namespace name, or a combination user/namespace, or a combination user/table. Other variants are disallowed.
Arguments
Parameter Description

namespace_name

A namespace name

table_name

A table name

space_limit_value

A space limit defined for the table or the namespace. Can use standard metric suffixes: B, K, M, G, T, P. The default metric — bytes (without any shortcuts). Examples: 1G, 2T

space_policy_value

A policy that should be taken when the space quota violation is fixed. Possible values:

  • NO_INSERTS — disallows data ingesting (e.g. put, incr, append);

  • NO_WRITES — works in the same way as NO_INSERTS, but also disallows delete operations;

  • NO_WRITES_COMPACTIONS — works in the same way as NO_WRITES, but also disallows compactions;

  • DISABLE — disables the table.

user_name

A user name

throttle_limit_value

A limit that restricts the number of requests or data amount for read/write operations. Provides two forms of syntax:

  • <requests_number>req/sec|min|hour|day — the number of requests per the defined time range. Examples: 100req/min, 10req/sec;

  • <data_amount>B|K|M|G|T|P/sec|min|hour|day — the data amount per the defined time range, where B, K, M, G, T, P — standard metric suffixes. Examples: 10M/sec, 5K/min.

Examples

Applying the SPACE quota to the table

hbase(main):002:0> set_quota TYPE => SPACE, TABLE => 'temp1', LIMIT => '1G', POLICY => NO_INSERTS
Took 0.4164 seconds

Applying the THROTTLE quota to the namespace

hbase(main):003:0> set_quota TYPE => THROTTLE, NAMESPACE => 'ns1', LIMIT => '10req/sec'
Took 0.0240 seconds

Removing the defined THROTTLE quota

hbase(main):004:0> set_quota TYPE => THROTTLE, NAMESPACE => 'ns1', LIMIT => NONE
Took 0.0129 seconds
Found a mistake? Seleсt text and press Ctrl+Enter to report it