setTableState (Hbck2)

Manually sets the state of an HBase table.

Command Syntax

Bash
Copy

Options

-i, --inputFiles <file1> [<file2>...] Specifies one or more files containing table names and table states, one pair per line.

Possible Table States

Bash
Copy

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:

Bash
Copy

Common cell values include:

  • \x08\x00 → ENABLED
  • \x08\x01 → DISABLED

You can also use:

Bash
Copy

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

  1. Enable the users table:
Bash
Copy
  1. Set table states from a file (fileName1):

Example fileName1 contents:

Bash
Copy

Run the command:

Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated