public class HbaseSharedConnPool extends Object implements ConnectionPool<org.apache.hadoop.hbase.client.Connection>
Title: HbaseSharedConnPool
Description: Hbase共享连接池(单例)
ConnectionPool
,
序列化表格限定符和类型 | 字段和说明 |
---|---|
private org.apache.hadoop.hbase.client.Connection |
connection |
private static AtomicReference<HbaseSharedConnPool> |
pool |
限定符 | 构造器和说明 |
---|---|
private |
HbaseSharedConnPool(org.apache.hadoop.conf.Configuration configuration) |
限定符和类型 | 方法和说明 |
---|---|
void |
close()
Close.
|
org.apache.hadoop.hbase.client.Connection |
getConnection()
Title: getConnection
Description: 获取连接
|
static HbaseSharedConnPool |
getInstance(org.apache.hadoop.conf.Configuration configuration)
Gets instance.
|
static HbaseSharedConnPool |
getInstance(Properties properties)
Gets instance.
|
static HbaseSharedConnPool |
getInstance(String host,
String port,
String master,
String rootdir)
Gets instance.
|
void |
invalidateConnection(org.apache.hadoop.hbase.client.Connection conn)
Title: invalidateConnection
Description: 废弃连接
|
void |
returnConnection(org.apache.hadoop.hbase.client.Connection conn)
Title: returnConnection
Description: 返回连接
|
private static final AtomicReference<HbaseSharedConnPool> pool
private final org.apache.hadoop.hbase.client.Connection connection
private HbaseSharedConnPool(org.apache.hadoop.conf.Configuration configuration) throws IOException
IOException
public static HbaseSharedConnPool getInstance(String host, String port, String master, String rootdir)
host
- the hostport
- the portmaster
- the masterrootdir
- the rootdirpublic static HbaseSharedConnPool getInstance(Properties properties)
properties
- the propertiespublic static HbaseSharedConnPool getInstance(org.apache.hadoop.conf.Configuration configuration)
configuration
- the configurationpublic org.apache.hadoop.hbase.client.Connection getConnection()
ConnectionPool
Title: getConnection
Description: 获取连接
getConnection
在接口中 ConnectionPool<org.apache.hadoop.hbase.client.Connection>
public void returnConnection(org.apache.hadoop.hbase.client.Connection conn)
ConnectionPool
Title: returnConnection
Description: 返回连接
returnConnection
在接口中 ConnectionPool<org.apache.hadoop.hbase.client.Connection>
conn
- 连接public void invalidateConnection(org.apache.hadoop.hbase.client.Connection conn)
ConnectionPool
Title: invalidateConnection
Description: 废弃连接
invalidateConnection
在接口中 ConnectionPool<org.apache.hadoop.hbase.client.Connection>
conn
- 连接public void close()
Copyright © 2015-2018 Dark Phoenixs. All Rights Reserved.