项目作者: lovepoem

项目描述 :
Hbase client with a connection pool Hbase连接池
高级语言: Java
项目地址: git://github.com/lovepoem/hbase-client.git
创建时间: 2019-12-04T10:59:51Z
项目社区:https://github.com/lovepoem/hbase-client

开源协议:

下载


hbase 客户端

1 maven依赖

  1. <dependency>
  2. <groupId>io.wangxin</groupId>
  3. <artifactId>hbase-client</artifactId>
  4. <version>${hbase-client.version}</version>
  5. </dependency>

2 版本说明

V1.0.1-SNAPSHOT

版本号:

  1. 0.1.0-SNAPSHOT

功能:

  • 添加基本java调用方式

V1.0.0-SNAPSHOT

版本号:

  1. 0.1.0-SNAPSHOT

功能:

  • 2.1.1 使用连接池方式连接hbase

3 使用说明

3.1 标准java调用方式

https://github.com/lovepoem/hbase-client/blob/master/src/test/java/io/wangxin/hbase/client/HbaseClientStdTest.java

3.2 spring配置数据源调用方式

  • 3.2.1 spring配置
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
  5. <!-- hbase 数据源配置 -->
  6. <bean id="hbasePoolConfig" class="io.wangxin.hbase.client.pool.HbasePoolConfig">
  7. <property name="maxTotal" value="20"></property>
  8. <property name="maxIdle" value="5"></property>
  9. <property name="maxWaitMillis" value="1000"></property>
  10. <property name="testOnBorrow" value="true"></property>
  11. </bean>
  12. <!-- hbase 数据源连接池 -->
  13. <bean id="hbasePool" class="io.wangxin.hbase.client.HbasePool">
  14. <!--zkQuorum-->
  15. <constructor-arg index="0" type="java.lang.String" value="${hbase.zkQuorum}"></constructor-arg>
  16. <!--zkClientPort-->
  17. <constructor-arg index="1" type="java.lang.String" value="${hbase.zkClientPort}"></constructor-arg>
  18. <constructor-arg index="2" ref="hbasePoolConfig"></constructor-arg>
  19. </bean>
  20. </beans>