2015-07-03 261 views
0

MapR MapR的REST API看起来不能正常工作。我简单地尝试列家族的列表命令作为过滤器,但它没有给我适当的输出,但它完全与maprcli选项一起工作。这里是我做的一个操作列表。MapR - Rest API列表命令没有给出正确的输出

随着maprcli命令

maprcli表CF列表-path /用户/ HBase的/ testShashi

readperm appendperm inmemory versionperm cfname writeperm compressionperm memoryperm压缩TTL maxversions minversions U:MAPR U:MAPR假U:MAPR F1 U:MAPR U:MAPR U:MAPR关闭2147483647 1 0 U:MAPR U:MAPR假U:MAPR F2 U:MAPR U:MAPR U:MAPR关闭2147483647 1 0

maprcli表CF列表-path /用户/ HBase的/ testShashi -cfname F1

readperm appendperm inmemory versionperm cfname writeperm compressionperm memoryperm压缩TTL maxversions minversions U:MAPR U: MAPR假U:MAPR F1 U:MAPR U:MAPR U:MAPR关2147483647 1 0

与maprcli选项,当我经过cfname为F1,它给我的只有单一的记录,但它似乎并不与REST发生API

随着REST API 之前应用过滤器

卷曲-k -u MAPR:MAPR https://hostname:8443/rest/table/cf/list?path=/user/hbase/testShashi

enter image description here

与cfname作为选项

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

enter image description here

让我知道如果我在这里犯了什么错误。

回答

0

沙市,

我不知道你是否粘贴您的确切命令行,但如果你没有,你可能需要使&不是由shell来解释给周围添加的网址报价。

在MAPR 4.1这个工作对我来说:

[[email protected] ~]$ 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:

[[email protected] ~]$ curl -k -u mapr:mapr https://ip-172-16-2-17:8443/rest/table/cf/list?path=/tmp/mytable&cfname=cf1 | jq . 
[1] 18868 
[[email protected] ~]$ {"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"}]} 
+0

Thanks Vig。 cfname参数在shell中被忽略。我加了引号,它完美的工作。 – Shashi