2011-07-15 33 views
0

我已经使用HBase来存储文件位置。Hbase API,Java查询,需要帮助

例如: 我有8行,以下是HBase中的键。每个文件夹位置都是一个键。

/usr/ 
/usr/folder1/ 
/usr/folder1/folder1_1/ 
/usr2/ 
/usr2/folder2/ 
/usr2/folder2/folder2_1/ 
/usr3/ 
/usr3/folder3/ 

如何使用HBase获取特定深度的行? (如子文件夹的级别)

So for depth 1: we would get rows with keys: /usr/, /usr2/, /usr3/ 
depth 1 for /usr/: we would get /usr/folder1/ 
depth 2 for /usr/: we could get /usr/folder1/folder1_1/ 

有人可以给我看一些演示代码吗?如使用扫描仪或过滤器?

非常感谢!

回答

0

我还没有亲自在HBase上工作太多,但基本上需要用REGEX filter进行扫描。不知道你是否可以通过HBase shell来完成,但是你可以使用API​​来完成。