- 論壇徽章:
- 0
|
https://github.com/zhang-xzhi/simplehbaseviewer
https://github.com/zhang-xzhi/simplehbaseviewer/wiki/_pages
##v0.7功能變更
新增viewer的樣例page中,可以一鍵跑所有的樣例hql功能,避免代碼失配,導(dǎo)致樣例hql不能執(zhí)行。
適配SimpleHbaseCellResult的改動(dòng)。
調(diào)整配置文件中bean的名字。
調(diào)整包結(jié)構(gòu)。
新增DisplayOnlyStringRowKey。
##simplehbaseviewer簡(jiǎn)介
simplehbaseviewer是基于simplehbase的web操作界面.
目前提供以下功能:
htable插入數(shù)據(jù),指定時(shí)間戳。
htable查詢數(shù)據(jù),SQL-Like,可以指定maxversion,時(shí)間戳范圍,limit分頁(yè)查詢。
htable刪除數(shù)據(jù)。
自定義rowkey生成函數(shù),方便查詢。 例子: 有一個(gè)rowkey的設(shè)計(jì)如下: 月賬單rowkey設(shè)計(jì)如下: md5(userId)前4位userId反轉(zhuǎn)賬單周期反轉(zhuǎn) 自定義一個(gè)rowkey生成函數(shù)billCategoryRowKey,配置在simplehbaseviewer中,可以使用如下方式查詢。
select * from billCategory rowkey is billCategoryRowKey ("2088123456781234_20140401")
query console:
可以對(duì)htable進(jìn)行數(shù)據(jù)put,scan, delete操作。
example:
比如
insert into billCategory ( userId ) values ( "2088123456781234" ) rowkey is billCategoryRowKey ("2088123456781234_20140401")
insert into MyRecordV05 ( name,age ) values ( "allen", "30" ) rowkey is intkey ("0")
insert into MyRecordV05 ( fatname,age ) values ( "allenfat", "30" ) rowkey is intkey ("0")
insert into MyRecordV05 ( name ) values ( null ) rowkey is intkey ("0")
select * from billCategory startkey is billCategoryRowKey ("2088123456781234_20140401")
select * from MyRecordV05 startkey is intkey ("0") , endkey is intkey ("100") maxversion 10 startTS is "2014-01-01" , endTS is "2100-01-01" limit 10 , 20
select * from MyRecordV05 startkey is intkey ("0") startTS is "2014-01-01" limit 10 , 20
select * from MyRecordV05 startkey is intkey ("0")
select * from MyRecordV05 rowkey is intkey ("0")
delete * from MyRecordV05 startkey is intkey ("0")

##simphbase simplehbaseviewer使用說(shuō)明
### simplehbase/simplehbaseviewer版本
0.5.1 / 0.6 / 0.7
### jdk
jdk/jre 1.6
### maven
maven2
### 代碼下載
最新simplehbase代碼下載。
https://github.com/zhang-xzhi/simplehbase
右下角的download zip。
帶版本的simplehbase版本下載。
https://github.com/zhang-xzhi/simplehbase/releases
最新simplehbaseviewer代碼下載。
https://github.com/zhang-xzhi/simplehbaseviewer
右下角的download zip。
帶版本的simplehbaseviewer版本下載。
https://github.com/zhang-xzhi/simplehbaseviewer/releases
### Simplehbase本地驗(yàn)證
代碼下載后,mvn eclipse:eclipse后導(dǎo)入eclipse。
運(yùn)行simplehbase的test。(Junit)
目前simplehbase默認(rèn)的測(cè)試環(huán)境為
hbase.zookeeper.quorum=hbdev-1.alipay.net,hbdev-2.alipay.net,hbdev-3.alipay.net,hbdev-4.alipay.net,hbdev-5.alipay.net
hbase.zookeeper.property.clientPort=2181
zookeeper.znode.parent=/hbase-94
* 1 若無(wú)法連接,修改test/zk_conf文件(集成測(cè)試使用,修改sample/zk_conf文件(樣例程序使用)。
* 2 建測(cè)試表。運(yùn)行CreateTestTable, 新建MyRecordV05表。
* 3 建表成功后,重新運(yùn)行test,后續(xù)運(yùn)行,不需要重新建立測(cè)試表。
* 4 新增htable的配置,請(qǐng)參考既有表的配置。
### Simplehbaseviewer本地驗(yàn)證
安裝simplehbase到本地倉(cāng)庫(kù)。
在simplehbase項(xiàng)目中,mvn install。
simplehbaseviewer代碼下載后,mvn eclipse:eclipse后導(dǎo)入eclipse。
運(yùn)行Main。
訪問(wèn)http://localhost:4040/hbaseviewer/
看simplehbaseview是否啟動(dòng)正常。
目前simplehbaseviewer默認(rèn)的測(cè)試環(huán)境為
hbase.zookeeper.quorum=hbdev-1.alipay.net,hbdev-2.alipay.net,hbdev-3.alipay.net,hbdev-4.alipay.net,hbdev-5.alipay.net
hbase.zookeeper.property.clientPort=2181
zookeeper.znode.parent=/hbase-94
* 1 若無(wú)法連接,修改config/zk_conf文件。
* 2 建測(cè)試表。運(yùn)行CreateTestTable, 新建MyRecordV05表。
* 3 建表成功后,重新運(yùn)行Main。
### Simplehbase jar包依賴
pom依賴,請(qǐng)參考simplehbase的pom文件。
其中,hadoop和hbase可以修改為目前集團(tuán)hbase使用的版本。
Simplehbase開(kāi)發(fā)測(cè)試過(guò)程中使用的hbase版本為0.94.0。
理論上,hbase0.92也可以使用,但是未經(jīng)測(cè)試,可以跑test進(jìn)行測(cè)試。
### Simplehbaseclient配置
SimpleHbaseClient為simplehbase的核心接口。
Java方式配置可以參考simplehbase的SampleMain。
Spring方式配置可以參考simplehbaseviewer的
\hbaseviewer\WEB-INF\spring\simplehbase.xml
如何配置可以參考或直接查看代碼:
https://github.com/zhang-xzhi/si ... -%E9%85%8D%E7%BD%AE
### doc
* https://github.com/zhang-xzhi/simplehbase/wiki
* https://github.com/zhang-xzhi/simplehbaseviewer/wiki
* simplehbase下載后simplehbase\doc |
|