gpt4 book ai didi

rest - 如果行键是反向 url,如何查找 HBase REST API (Stargate)

转载 作者:可可西里 更新时间:2023-11-01 14:49:55 26 4
gpt4 key购买 nike

我正在使用 nutch2.2.1 + hbase0.90.4,并希望通过 HBase REST API Stargate 访问数据.如果我用 url(例如 www.usatoday.com)播种 nutch,则反向 url 将成为指定表(“网页”)中的 HBase 行键。我可以通过 hbase shell 查找数据,如下所示:

hbase(main):001:0> get 'webpage', 'com.usatoday.www:http/'
COLUMN CELL
f:fi timestamp=1404762373394,value=\x00'\x8D\x00
f:ts timestamp=1404762373394, value=\x00\x00\x01G\x12\\xB5\xB3
mk:_injmrk_ timestamp=1404762373394, value=y
mk:dist timestamp=1404762373394, value=0
mtdt:_csh_ timestamp=1404762373394, value=?\x80\x00\x00
s:s timestamp=1404762373394, value=?\x80\x00\x00

但是,我在使用 REST API 时遇到问题。大概我需要做一些非常简单的 URL 编码来抑制 'http' 之前的冒号,这给我带来了麻烦?

例如,我在尝试时收到 HTTP 404

curl http://localhost:8900/webpage/com.usatoday.www:http/

当我尝试时也是如此

curl http://localhost:8900/webpage/com.usatoday.www%3Ahttp/

我知道 REST API 工作正常,因为我可以在名为“test”和查找的表中创建名为“row3”的行

curl http://localhost:8900/test/row3  

看到下面的预期结果:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="cm93Mw=="><Cell timestamp="1404761922130" column="Y2Y6Yw==">dGhpcyBpcyBzb3J0YSB3b3JraW5nIG5vdw==</Cell></Row></CellSet>

感谢您的帮助!

最佳答案

还需要对正斜杠进行 URL 编码。以下作品。

curl http://localhost:8900/webpage/com.usatoday.www%3Ahttp%2F

关于rest - 如果行键是反向 url,如何查找 HBase REST API (Stargate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24734045/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com