Support Questions
Find answers, ask questions, and share your expertise

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

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

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

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.

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

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

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.

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

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.