compact

Definition

Runs compaction for the defined table/Region/column family. See also major_compact.

Usage

compact '[<namespace_name>:]<table_name>' | '<region_name>' | '<encoded_region_name>'[,
        '<column_family>' | nil[,
        '<compact_type>']]
Arguments
Parameter Description

namespace_name

A namespace name

table_name

A table name

region_name

A Region name without its encoded part. For example, if the full Region name is wordcount2,m,1637833871529.2ff3683a90c4106432c540ddd0f57cba., then the region_name is wordcount2,m,1637833871529. You can get the full Region name and exclude its encoded part via the list_regions command output (the REGION_NAME field)

encoded_region_name

An encoded part of the Region name. For example, if the full Region name is wordcount2,m,1637833871529.2ff3683a90c4106432c540ddd0f57cba., then the encoded part is 2ff3683a90c4106432c540ddd0f57cba. You can get the full Region name and obtain its encoded part via the list_regions command output (the REGION_NAME field)

column_family

A column family name

compact_type

Possible values:

  • NORMAL — normal compaction;

  • MOB — MOB (medium-sized objects) compaction.

The default value is NORMAL. See more details in the HBase documentation

Examples

Table

hbase(main):023:0> compact 'ns1:temp2'
Took 0.0483 seconds

Column family (within a table)

hbase(main):026:0> compact 'ns1:temp2', 'cf1'
Took 0.0252 seconds

Region

hbase(main):027:0> compact 'wordcount2,m,1637833871529'
Took 0.2334 seconds
hbase(main):028:0> compact '2ff3683a90c4106432c540ddd0f57cba'
Took 0.0151 seconds

Column family (within a Region)

hbase(main):030:0> compact '2ff3683a90c4106432c540ddd0f57cba', 'f'
Took 0.0121 seconds
Found a mistake? Seleсt text and press Ctrl+Enter to report it