mapr-restapi list命令没有给出正确的输出

3vpjnl9f  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(577)

mapr db的maprrestapi看起来工作不正常。我只是尝试了列族的list命令作为过滤器,但它没有给我正确的输出,但它与maprcli选项完美结合。
使用maprcli命令
maprcli table cf list-路径/user/hbase/testshashi
readperm appendperm inmemory versionperm cfname writeperm compressionperm memoryperm compression ttl maxversions minversions u:mapr u:mapr false u:mapr f1 u:mapr u:mapr u:mapr u:mapr off 2147483647 1 0 u:mapr u:mapr false u:mapr f2 u:mapr u:mapr u:mapr u:mapr off 2147483647 1 0
maprcli table cf list-path/user/hbase/testshashi-cfname f1
readperm appendperm inmemory versionperm cfname writeperm compressionperm memoryperm compression ttl maxversions minversions u:mapr u:mapr false u:mapr f1 u:mapr u:mapr u:mapr u:mapr off 2147483647 1 0
使用maprcli选项,当我将cfname作为f1传递时,它只给我一条记录,但restapi似乎不会这样
在应用过滤器之前使用restapi
curl -k-umapr:mapr https://hostname:8443/rest/table/cf/list?path=/user/hbase/testshashi

使用cfname作为选项
curl -k-umapr:mapr https://hostname:8443/rest/table/cf/list?path=/user/hbase/testshashi&cfname=f1

如果我在这里犯了什么错误,请告诉我。

cx6n0qe3

cx6n0qe31#

沙市,
我不知道是否粘贴了确切的命令行,但是如果粘贴了,可能需要在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"}]}

相关问题