Created 11-30-2016 10:19 AM
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 ?
Created 11-30-2016 07:38 PM
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.
Created 11-30-2016 10:28 AM
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.
Created 11-30-2016 10:58 AM
Where is that table directory? Is it also in Zookeeper?
Created 11-30-2016 11:05 AM
it is in hdfs and if you are using HDP then it may be under /apps/hbase/data/data/<namespace>/<tableName>/.tabledesc/
Created 11-30-2016 07:38 PM
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.
Created 12-01-2016 08:18 AM
Thanks I think that solves my problem, I used to use the Zookeeper watcher but it can only get the hbase table modification.