gpt4 book ai didi

rest - MapR-Rest API列表命令未提供正确的输出

转载 作者:行者123 更新时间:2023-12-02 22:01:20 27 4
gpt4 key购买 nike

用于MapR DB的MapR REST API似乎无法正常工作。我只是尝试将列系列的列表命令用作过滤器,但它没有给我适当的输出,但它与maprcli选项完美配合。这是我所做的操作列表。

使用maprcli命令

maprcli表cf列表-path / user / hbase / testShashi

readperm附录perm内存版本perm cfname writeperm压缩perm内存perm压缩ttl maxversions minversions
u:mapr u:mapr否u:mapr f1 u:mapr u:mapr u:mapr off 2147483647 1 0
u:mapr u:mapr否u:mapr f2 u:mapr u:mapr u:mapr off 2147483647 1 0

maprcli表cf列表-path / user / hbase / testShashi -cfname f1

readperm附录perm内存版本perm cfname writeperm压缩perm内存perm压缩ttl maxversions minversions
u:mapr u:mapr否u:mapr f1 u:mapr u:mapr u:mapr off 2147483647 1 0

当我将cfname传递为f1时,使用maprcli选项,它仅给我单条记录,但使用REST API似乎没有发生

使用REST API
应用过滤器之前

curl -k -u mapr:mapr https://hostname:8443/rest/table/cf/list?path=/user/hbase/testShashi

cft名称为的

curl -k -u mapr:mapr https://hostname:8443/rest/table/cf/list?path=/user/hbase/testShashi&cfname=f1

让我知道我是否在这里犯任何错误。

最佳答案

沙市

我不知道您是否粘贴了确切的命令行,但是如果这样做了,则可能需要在URL周围添加引号,以使&不会被 shell 程序解释。

在MapR 4.1上,这对我有效:

[mapr@ip-172-16-2-19 ~]$ curl -k -u mapr:mapr 'https://ip-172-16-2-17:8443/rest/table/cf/list?path=/tmp/mytable&cfname=cf1' | jq .
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 345 100 345 0 0 1638 0 --:--:-- --:--:-- --:--:-- 1642
{
"timestamp": 1436384780597,
"timeofday": "2015-07-08 07:46:20.597 GMT+0000",
"status": "OK",
"total": 1,
"data": [
{
"cfname": "cf1",
"maxversions": 1,
"minversions": 0,
"ttl": 2147483647,
"inmemory": false,
"compression": "lz4",
"appendperm": "u:mapr",
"compressionperm": "u:mapr",
"memoryperm": "u:mapr",
"readperm": "u:mapr",
"versionperm": "u:mapr",
"writeperm": "u:mapr"
}
]
}

但是,如果我像您的示例中那样删除引号,请参阅cfname参数似乎是如何被忽略的-这是因为,当shell到达&时,它将命令置于后台,并且服务器永远不会考虑cfname参数。因为它没有到达那里;因此maprcli列出了所有cfs:
[mapr@ip-172-16-2-19 ~]$ curl -k -u mapr:mapr https://ip-172-16-2-17:8443/rest/table/cf/list?path=/tmp/mytable&cfname=cf1 | jq .
[1] 18868
[mapr@ip-172-16-2-19 ~]$ {"timestamp":1436384975909,"timeofday":"2015-07-08 07:49:35.909 GMT+0000","status":"OK","total":2,"data":[{"cfname":"cf1","maxversions":1,"minversions":0,"ttl":2147483647,"inmemory":false,"compression":"lz4","appendperm":"u:mapr","compressionperm":"u:mapr","memoryperm":"u:mapr","readperm":"u:mapr","versionperm":"u:mapr","writeperm":"u:mapr"},{"cfname":"cf2","maxversions":1,"minversions":0,"ttl":2147483647,"inmemory":false,"compression":"lz4","appendperm":"u:mapr","compressionperm":"u:mapr","memoryperm":"u:mapr","readperm":"u:mapr","versionperm":"u:mapr","writeperm":"u:mapr"}]}

关于rest - MapR-Rest API列表命令未提供正确的输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31209368/

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