- 论坛徽章:
- 0
|
https://github.com/zhang-xzhi/simplehbaseviewer
https://github.com/zhang-xzhi/simplehbaseviewer/wiki/_pages
##v0.7功能变更
新增viewer的样例page中,可以一键跑所有的样例hql功能,避免代码失配,导致样例hql不能执行。
适配SimpleHbaseCellResult的改动。
调整配置文件中bean的名字。
调整包结构。
新增DisplayOnlyStringRowKey。
##simplehbaseviewer简介
simplehbaseviewer是基于simplehbase的web操作界面.
目前提供以下功能:
htable插入数据,指定时间戳。
htable查询数据,SQL-Like,可以指定maxversion,时间戳范围,limit分页查询。
htable删除数据。
自定义rowkey生成函数,方便查询。 例子: 有一个rowkey的设计如下: 月账单rowkey设计如下: md5(userId)前4位userId反转账单周期反转 自定义一个rowkey生成函数billCategoryRowKey,配置在simplehbaseviewer中,可以使用如下方式查询。
select * from billCategory rowkey is billCategoryRowKey ("2088123456781234_20140401")
query console:
可以对htable进行数据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使用说明
### 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本地验证
代码下载后,mvn eclipse:eclipse后导入eclipse。
运行simplehbase的test。(Junit)
目前simplehbase默认的测试环境为
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 若无法连接,修改test/zk_conf文件(集成测试使用,修改sample/zk_conf文件(样例程序使用)。
* 2 建测试表。运行CreateTestTable, 新建MyRecordV05表。
* 3 建表成功后,重新运行test,后续运行,不需要重新建立测试表。
* 4 新增htable的配置,请参考既有表的配置。
### Simplehbaseviewer本地验证
安装simplehbase到本地仓库。
在simplehbase项目中,mvn install。
simplehbaseviewer代码下载后,mvn eclipse:eclipse后导入eclipse。
运行Main。
访问http://localhost:4040/hbaseviewer/
看simplehbaseview是否启动正常。
目前simplehbaseviewer默认的测试环境为
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 若无法连接,修改config/zk_conf文件。
* 2 建测试表。运行CreateTestTable, 新建MyRecordV05表。
* 3 建表成功后,重新运行Main。
### Simplehbase jar包依赖
pom依赖,请参考simplehbase的pom文件。
其中,hadoop和hbase可以修改为目前集团hbase使用的版本。
Simplehbase开发测试过程中使用的hbase版本为0.94.0。
理论上,hbase0.92也可以使用,但是未经测试,可以跑test进行测试。
### 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 |
|