2015-07-03 90 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