我在名为 test
的 HBase 表中有以下行
ROW COLUMN+CELL row1 column=cf:a, timestamp=1429204170712, value=value1
row2 column=cf:b, timestamp=1429204196225, value=value2
row3 column=cf:c, timestamp=1429204213427, value=value3
我正在尝试使用 Suffix Globbing 检索行键匹配前缀 row
的所有行,如前所述 here
但为什么当我尝试 http://localhost:8080/test/row*
where localhost:8080
时,我得到了 Bad request
是 HBase REST 服务器 Stargate 正在监听的位置,test
是表,row
是部分行键。我在浏览器和 REST 客户端 Poster(Firefox 插件)中执行了它。执行 URL http://localhost:8080/test/row*/cf
给出响应 value1
但我想检索所有行中的值与 rowkey 匹配前缀行
。
我正在运行 HBase 0.94.26、Stargate(与 HBase 捆绑在一起)、Hadoop 1.2.1、Ubuntu 12.04 虚拟机。
是否可以至少以编程方式检索所有行?
最佳答案
根据文档,REST 可以很好地检索所有行。但是,您只需要相应地修改 URL。 根据我的意见,尝试对它们进行以下组合应该会起作用,请注意,我还没有测试过。
http://localhost:8080/test/row*
http://localhost:8080/test/row
Suffix Globbing
Multiple value queries of a row can optionally append a suffix glob on the row key. This is a restricted form of scanner which will return all values in all rows that have keys which contain the supplied key on their left hand side, for example:
org.someorg.* -> org.someorg.blog -> org.someorg.home -> org.someorg.www
关于rest - 如何从 REST 客户端使用后缀 glob 从 HBase 检索多行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29697952/