public class MaprDBPooledConnectionFactory
extends org.apache.commons.pool2.BasePooledObjectFactory<org.cloudgraph.core.Connection>
The new HBase Client API changes removed the existing connection pool implementation and placed the responsibility of managing the lifecycle of connections on the caller. A pool is necessary as creating connections to the cluster via. zookeeper is fairly expensive.
| Constructor and Description |
|---|
MaprDBPooledConnectionFactory(org.apache.hadoop.conf.Configuration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
activateObject(org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> p) |
org.cloudgraph.core.Connection |
create() |
void |
destroyObject(org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> p) |
void |
passivateObject(org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> p) |
void |
setPool(org.apache.commons.pool2.ObjectPool<org.cloudgraph.core.Connection> pool) |
boolean |
validateObject(org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> p) |
org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> |
wrap(org.cloudgraph.core.Connection con) |
public MaprDBPooledConnectionFactory(org.apache.hadoop.conf.Configuration config)
public void setPool(org.apache.commons.pool2.ObjectPool<org.cloudgraph.core.Connection> pool)
public org.cloudgraph.core.Connection create()
throws Exception
create in class org.apache.commons.pool2.BasePooledObjectFactory<org.cloudgraph.core.Connection>Exceptionpublic org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> wrap(org.cloudgraph.core.Connection con)
wrap in class org.apache.commons.pool2.BasePooledObjectFactory<org.cloudgraph.core.Connection>public void destroyObject(org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> p)
throws Exception
destroyObject in interface org.apache.commons.pool2.PooledObjectFactory<org.cloudgraph.core.Connection>destroyObject in class org.apache.commons.pool2.BasePooledObjectFactory<org.cloudgraph.core.Connection>Exceptionpublic boolean validateObject(org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> p)
validateObject in interface org.apache.commons.pool2.PooledObjectFactory<org.cloudgraph.core.Connection>validateObject in class org.apache.commons.pool2.BasePooledObjectFactory<org.cloudgraph.core.Connection>public void activateObject(org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> p)
throws Exception
activateObject in interface org.apache.commons.pool2.PooledObjectFactory<org.cloudgraph.core.Connection>activateObject in class org.apache.commons.pool2.BasePooledObjectFactory<org.cloudgraph.core.Connection>Exceptionpublic void passivateObject(org.apache.commons.pool2.PooledObject<org.cloudgraph.core.Connection> p)
throws Exception
passivateObject in interface org.apache.commons.pool2.PooledObjectFactory<org.cloudgraph.core.Connection>passivateObject in class org.apache.commons.pool2.BasePooledObjectFactory<org.cloudgraph.core.Connection>ExceptionCopyright © 2023. All Rights Reserved.