我现在正在通过hbaseshell查看一个包含126个区域的表。但我无法发现在创建表的过程中有多少区域是手动定义的。有什么查询我可以执行并获得详细信息吗?
不确定我是否得到了您想要的,但您可能可以为此使用区域时间创建。在您的hdfs文件系统中,hbase数据以以下格式存储:
hbase
/<Table> (Tables in the cluster)
/<Region> (Regions for the table)
/<ColumnFamiy> (ColumnFamilies for the Region for the table)
/<StoreFile> (StoreFiles for the ColumnFamily for the Regions for the table)
因此,您可以使用hdfs-dfs-ls命令来获取表中所有区域的列表。您可以比较区域的创建日期,以了解历史记录,并可能了解创建表时设置的区域数量:
hdfs dfs -ls /hbase/database/tablename/
drwxr-xr-x - hbase hdfs 0 2016-07-27 12:36 /hbase/database/tablename/9d7c14813bfd871ccb10cf60d972787c
drwxr-xr-x - hbase hdfs 0 2016-07-29 11:47 /hbase/database/tablename/f1cf0c45568153f35a03a183b6a096fa
此外,你可以尝试通过shell访问hbase的元数据命名空间,以获取有关你的表的一些信息,但它会给你时间戳,对我个人来说,与纯日期相比,对你的情况来说,什么是更复杂的选择:
scan 'hbase:meta',{COLUMNS=> 'info:regioninfo', FILTER=>"PrefixFilter('yourtable')"}