use of org.apache.commons.pool.PoolableObjectFactory in project Solbase by Photobucket.
the class SolbaseHTablePool2 method getTable.
public HTableInterface getTable(String tableName) {
GenericObjectPool pool = this.tablePools.get(tableName);
if (pool == null) {
// lazy initialization of pool
PoolableObjectFactory factory = new SolbaseHTableInterfaceFactory(config, tableName);
pool = new GenericObjectPool(factory, this.maxActive);
}
try {
HTableInterface table = (HTableInterface) pool.borrowObject();
return table;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
Aggregations