-- rest api -- http://wiki.apache.org/hadoop/Hbase/Stargate curl -H "Accept: text/xml" http://itr-hbasetest01:20550/version -v curl -H "Accept: text/xml" http://itr-hbasetest01:20550/version/cluster -v curl -H "Accept: application/json" http://itr-hbasetest01:20550/status/cluster | python -mjson.tool curl -X PUT -H "Content-Type: application/json" http://itr-hbasetest01:20550/tbl_rest/schema -d '{"ColumnSchema":[{"name":"cf"}]}' -v curl -H "Accept: application/json" http://itr-hbasetest01:20550/tbl_rest/regions | python -mjson.tool ./hbase_put_rest_json.sh tbl_rest cf test sku_1 123 ./hbase_put_rest_xml.sh tbl_rest cf test1 sku_2 789 curl -H "Accept: application/json" http://itr-hbasetest01:20550/tbl_rest/sku_2 | python -mjson.tool echo -n "c2t1XzI=" | base64 -d echo -n "Nzg5" | base64 -d curl -H "Accept: application/octet-stream" http://itr-hbasetest01:20550/tbl_rest/sku2/cf:test1 curl -X DELETE -H "Accept: application/json" http://itr-hbasetest01:20550/tbl_rest/schema -v -- JRuby script -- alter 'test1', NAME => 'cf', METHOD => 'delete' alter 'test1', 'delete' => 'cf' alter 'test1', NAME => 'cf' put 'test1', 'user1', 'cf:1399999999', "\x00\x00\x00\x09" put 'test1', 'user1', 'cf:1400000000', "\x00\x00\x00\x08" put 'test1', 'user1', 'cf:1400000001', "\x00\x00\x00\x07" put 'test1', 'user1', 'cf:1400000002', "\x00\x00\x20\xFB" put 'test1', 'user2', 'cf:1500000000', "\x00\x00\x00\x11" put 'test1', 'user2', 'cf:1500000001', "\x00\x00\x20\xFC" require '/home/hduser/hbase/scan_binary_values' scan_binary_values 'test1', 'cf' scan_binary_values 'test1', 'lf'
創(chuàng)新互聯(lián)公司-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比寧安網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式寧安網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋寧安地區(qū)。費(fèi)用合理售后完善,十余年實(shí)體公司更值得信賴。
shell腳本
hbase_put_rest_json.sh
table=$1 cf=$2 column=$3 key=$4 value=$5 cq_enc=`echo -ne $cf:$column | base64` key_enc=`echo -ne $key | base64` value_enc=`echo -ne $value | base64` data='{ "Row": [ { "key": "'$key_enc'", "Cell": [ { "column": "'$cq_enc'", "$": "'$value_enc'" } ] } ] }' echo $data curl -H "Content-Type: application/json" --data "$data" http://itr-hbasetest01.zalando:20550/$table/$key -v
hbase_put_rest_xml.sh
table=$1 cf=$2 column=$3 key=$4 value=$5 cq_enc=`echo -ne $cf:$column | base64` key_enc=`echo -ne $key | base64` value_enc=`echo -ne $value | base64` xml='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="'$key_enc'"><Cell column="'$cq_enc'">'$value_enc'</Cell></Row></CellSet>' echo $xml curl -H "Content-Type: text/xml" --data "$xml" http://itr-hbasetest01.zalando:20550/$table/$key -v
分享題目:hbaseRESTAPI
URL地址:http://jinyejixie.com/article0/gdpcio.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、面包屑導(dǎo)航、定制網(wǎng)站、網(wǎng)站設(shè)計(jì)公司、企業(yè)建站、微信小程序
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)