list_regions

Definition

Displays all Regions for the specified table.

Usage

list_regions '[namespace_name:]<table_name>'[,
             {<attr_name> => '<attr_value>'[,...]}[,
             <output_fields[]>]]
Arguments
Parameter Description

namespace_name

A namespace name

table_name

A table name

attr_name

An optional parameter used for filtering results. Possible values: 'SERVER_NAME' (a Region Server name),'LOCALITY_THRESHOLD' (a Region locality)

attr_value

A desired value of the attr_name parameter

output_fields

An optional array containing one or several fields that should be displayed in the output information. Possible values: 'SERVER_NAME', 'REGION_NAME', 'START_KEY', 'END_KEY', 'SIZE', 'REQ', 'LOCALITY'. You can use one of them or several. Values are not case sensitive. By default, all the fields are displayed (see their description below)

Output parameters
Parameter Description

SERVER_NAME

A Region Server name

REGION_NAME

A full Region name

START_KEY

A start row key for the Region

END_KEY

An end row key for the Region

SIZE

A Region size in MB

REQ

A number of requests to the Region

LOCALITY

A Region locality (1 in the case of flushing information into HFiles)

Examples

Listing Regions without using filters

hbase(main):007:0> list_regions 't1'
                                        SERVER_NAME |                                         REGION_NAME |  START_KEY |    END_KEY |  SIZE |   REQ |   LOCALITY |
 -------------------------------------------------- | --------------------------------------------------- | ---------- | ---------- | ----- | ----- | ---------- |
 bds-adh-2.ru-central1.internal,16020,1637214343541 | t1,,1637234844003.562aabcac6ff0688b31260c44c9863c8. |            |            |     0 |     0 |        1.0 |
 1 rows
Took 0.5142 seconds

Listing Regions for the specified Region Server

hbase(main):010:0> list_regions 't1', {SERVER_NAME => 'bds-adh-2.ru-central1.internal,16020,1637214343541'}
                                        SERVER_NAME |                                         REGION_NAME |  START_KEY |    END_KEY |  SIZE |   REQ |   LOCALITY |
 -------------------------------------------------- | --------------------------------------------------- | ---------- | ---------- | ----- | ----- | ---------- |
 bds-adh-2.ru-central1.internal,16020,1637214343541 | t1,,1637234844003.562aabcac6ff0688b31260c44c9863c8. |            |            |     0 |     0 |        1.0 |
 1 rows
Took 0.0180 seconds

Restricting number of output fields

hbase(main):011:0> list_regions 't1', {}, ['SERVER_NAME','REGION_NAME']
                                        SERVER_NAME |                                         REGION_NAME |
 -------------------------------------------------- | --------------------------------------------------- |
 bds-adh-2.ru-central1.internal,16020,1637214343541 | t1,,1637234844003.562aabcac6ff0688b31260c44c9863c8. |
 1 rows
Took 0.0181 seconds
Found a mistake? Seleсt text and press Ctrl+Enter to report it