Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How do Zookeeper save HBase Column and Column Family metadata in Znode?

avatar
Contributor

I am trying to write a zookeeper watcher to monitor hbase column family and hbase column modification.

I know Hbase table is saved as a znode under the /table znode, but I did not get much info about how do zookeeper save the metadata of hbase column family and hbase column, so How can I get notified when there is any modification in hbase column family or hbase columns ?

1 ACCEPTED SOLUTION

avatar
Guru

The best way to observe and run custom logic when a table is modified would be to write a master coprocessor. Your MasterObserver will be called before and after any table is modified (see https://hbase.apache.org/book.html#cp).

However, unlike column families, columns in HBase are not predefined. So you cannot observe column changes since there is no fixed "schema". Please read up on the HBase data model.

View solution in original post

5 REPLIES 5

avatar

Table metadata is stored as table descriptor in the corresponding table directory and is read and altered there itself. I don't think that we have any znode where we keep the information of columnfamily during alter or create table.

avatar
Contributor

Where is that table directory? Is it also in Zookeeper?

avatar

it is in hdfs and if you are using HDP then it may be under /apps/hbase/data/data/<namespace>/<tableName>/.tabledesc/

avatar
Guru

The best way to observe and run custom logic when a table is modified would be to write a master coprocessor. Your MasterObserver will be called before and after any table is modified (see https://hbase.apache.org/book.html#cp).

However, unlike column families, columns in HBase are not predefined. So you cannot observe column changes since there is no fixed "schema". Please read up on the HBase data model.

avatar
Contributor

Thanks I think that solves my problem, I used to use the Zookeeper watcher but it can only get the hbase table modification.