setTableState (Hbck2)
Manually sets the state of an HBase table.
Command Syntax
hbase hbck -j <path-to-hbck2-jar> setTableState [<TABLENAME> <STATE> | -i <INPUT_FILE>...]
Options
, -i Specifies one or more files containing table names and table states, one pair per line.--inputFiles <file1> [<file2>...]
Possible Table States
ENABLED
DISABLED
DISABLING
ENABLING
Description
This command forcefully sets the state of a table in HBase. It is typically used when a table becomes stuck in an incorrect or inconsistent state.
You can check a table’s current state using the HBase shell:
hbase> get 'hbase:meta', '<TABLENAME>', 'table:state'
Common cell values include:
→ ENABLED\x08\x00→ DISABLED\x08\x01
You can also use:
hbase> describe "<TABLENAME>"
This provides a more readable view of the table schema and its current state.
Return Value
The command returns the previous state of the table before the update was applied.
Examples
- Enable the
table:users
hbase hbck -j <path-to-hbck2-jar> setTableState users ENABLED
- Set table states from a file (
):fileName1
Example contents:fileName1
mytable DISABLED
another_table ENABLED
Run the command:
hbase hbck -j <path-to-hbck2-jar> setTableState -i fileName1

Have a suggestion?