Command to get states of regions of a table in hbase
Asked Answered
T

1

6

As I can see here, HBase maintains a state for each region and persists the state in hbase:meta.

I am not able to get what is the command to get state of a region of a table.

By running following:

scan 'hbase:meta',{FILTER=>"PrefixFilter('tableName')"}

I get following:

ROW                                                 COLUMN+CELL
 table-name,,1505804790891.ce656052407eb6 column=info:regioninfo, timestamp=1505804792579, value={ENCODED => ce656052407eb640b337d29d20e04e4c, NAME => 'table-name,,1505804790891.ce656
 40b337d29d20e04e4c.                                052407eb640b337d29d20e04e4c.', STARTKEY => '', ENDKEY => '03fffec'}
 table-name,,1505804790891.ce656052407eb6 column=info:seqnumDuringOpen, timestamp=1505804792797, value=\x00\x00\x00\x00\x00\x10\xF6W
 40b337d29d20e04e4c.
 table-name,,1505804790891.ce656052407eb6 column=info:server, timestamp=1505804792797, value=myHost:16020
 40b337d29d20e04e4c.
 table-name,,1505804790891.ce656052407eb6 column=info:serverstartcode, timestamp=1505804792797, value=1499875095772
 40b337d29d20e04e4c.

I am not able to get state of this region, what is the way to get the state of this region.

hbase(main):067:0> version
1.1.2.2.3.2.0-2950, Wed Sep 30 18:24:54 UTC 2015
Tuscany answered 4/2, 2018 at 11:29 Comment(0)
B
0

This could be a bug, or someone accidentally erased the column from your table. Because for me, this worked:

scan 'hbase:meta', {COLUMNS => 'info:state'}

Output:

ROW                                                                     COLUMN+CELL                                                                                                                                                                                                       
 tableNameRedacted,,1633616308132.cea1cc91189b9198a5fc841486025d8a.             column=info:state, timestamp=1633616308890, value=OPEN                                                                                                                                                            
 tableNameRedacted,,1633616309801.0340de57710c11149eab3ab8392dbac2.           column=info:state, timestamp=1633616310253, value=OPEN                                                                                                                                                            
 hbase:namespace,,1628881267753.e0ca4f737711274dc2b32bb83601d2b9.       column=info:state, timestamp=1631105441692, value=OPEN                                                                                                                                                            
 tableNameRedacted,,1633616310960.70a9011ed510bf22aceeaec10dc26225.                column=info:state, timestamp=1633616311447, value=OPEN                                                                                                                                                            
 tableNameRedacted,,1633616312068.9a5f2c6d40eda2889d9eaf98bd0128b9.               column=info:state, timestamp=1633616312411, value=OPEN                                                                                                                                                            
 test,,1633463395130.f8301e5918aec6faa7da1a68c2968609.                  column=info:state, timestamp=1633463395490, value=OPEN                                                                                                                                                            
 tableNameRedacted,,1633616313200.a7920985638d99a72601a97e023d9f81.       column=info:state, timestamp=1633616313647, value=OPEN                                                                                                                                                            
 tableNameRedacted,,1633616314368.66ee6ba1028e16e428775efbf94dfd70.          column=info:state, timestamp=1633616314784, value=OPEN                                                                                                                                                            
 tableNameRedacted,,1633616315475.d6c760a0d384ab61b1b4c9394b3c1af6.                   column=info:state, timestamp=1633616315822, value=OPEN                                                                                                                                                            
 tableNameRedacted,,1633616316611.b74cf55f47d76733664b0833bd767694.                 column=info:state, timestamp=1633616317757, value=OPEN                                                                                                                                                            
10 row(s)
Took 0.3171 seconds           

Apparently the information you seek is under the column info:state.

Blues answered 7/10, 2021 at 21:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.