|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.client.HTablePool
HConnection.getTable(String)
.
@InterfaceAudience.Private @Deprecated public class HTablePool
A simple pool of HTable instances.
Each HTablePool acts as a pool for all tables. To use, instantiate an
HTablePool and use getTable(String)
to get an HTable from the pool.
This method is not needed anymore, clients should call
HTableInterface.close() rather than returning the tables to the pool
Once you are done with it, close your instance of HTableInterface
by calling HTableInterface.close()
rather than returning the tables
to the pool with (deprecated) putTable(HTableInterface)
.
A pool can be created with a maxSize which defines the most HTable
references that will ever be retained for each table. Otherwise the default
is Integer.MAX_VALUE
.
Pool will manage its own connections to the cluster. See
HConnectionManager
.
Constructor Summary | |
---|---|
HTablePool()
Deprecated. Default Constructor. |
|
HTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize)
Deprecated. Constructor to set maximum versions and use the specified configuration. |
|
HTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
HTableInterfaceFactory tableFactory)
Deprecated. Constructor to set maximum versions and use the specified configuration and table factory. |
|
HTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
HTableInterfaceFactory tableFactory,
PoolMap.PoolType poolType)
Deprecated. Constructor to set maximum versions and use the specified configuration, table factory and pool type. |
|
HTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
PoolMap.PoolType poolType)
Deprecated. Constructor to set maximum versions and use the specified configuration and pool type. |
Method Summary | |
---|---|
void |
close()
Deprecated. Closes all the HTable instances , belonging to all tables in the table pool. |
void |
closeTablePool(byte[] tableName)
Deprecated. See closeTablePool(String) . |
void |
closeTablePool(String tableName)
Deprecated. Closes all the HTable instances , belonging to the given table, in the table pool. |
protected HTableInterface |
createHTable(String tableName)
Deprecated. |
int |
getCurrentPoolSize(String tableName)
Deprecated. |
HTableInterface |
getTable(byte[] tableName)
Deprecated. Get a reference to the specified table from the pool. |
HTableInterface |
getTable(String tableName)
Deprecated. Get a reference to the specified table from the pool. |
void |
putTable(HTableInterface table)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HTablePool()
public HTablePool(org.apache.hadoop.conf.Configuration config, int maxSize)
config
- configurationmaxSize
- maximum number of references to keep for each tablepublic HTablePool(org.apache.hadoop.conf.Configuration config, int maxSize, HTableInterfaceFactory tableFactory)
config
- configurationmaxSize
- maximum number of references to keep for each tabletableFactory
- table factorypublic HTablePool(org.apache.hadoop.conf.Configuration config, int maxSize, PoolMap.PoolType poolType)
config
- configurationmaxSize
- maximum number of references to keep for each tablepoolType
- pool type which is one of PoolMap.PoolType.Reusable
or
PoolMap.PoolType.ThreadLocal
public HTablePool(org.apache.hadoop.conf.Configuration config, int maxSize, HTableInterfaceFactory tableFactory, PoolMap.PoolType poolType)
PoolMap.PoolType.Reusable
and PoolMap.PoolType.ThreadLocal
. If the pool
type is null or not one of those two values, then it will default to
PoolMap.PoolType.Reusable
.
config
- configurationmaxSize
- maximum number of references to keep for each tabletableFactory
- table factorypoolType
- pool type which is one of PoolMap.PoolType.Reusable
or
PoolMap.PoolType.ThreadLocal
Method Detail |
---|
public HTableInterface getTable(String tableName)
tableName
- table name
RuntimeException
- if there is a problem instantiating the HTablepublic HTableInterface getTable(byte[] tableName)
Create a new one if one is not available.
tableName
- table name
RuntimeException
- if there is a problem instantiating the HTablepublic void putTable(HTableInterface table) throws IOException
table
- the proxy table user got from pool
IOException
protected HTableInterface createHTable(String tableName)
public void closeTablePool(String tableName) throws IOException
Note: this is a 'shutdown' of the given table pool and different from
putTable(HTableInterface)
, that is used to return the table
instance to the pool for future re-use.
tableName
-
IOException
public void closeTablePool(byte[] tableName) throws IOException
closeTablePool(String)
.
tableName
-
IOException
public void close() throws IOException
Note: this is a 'shutdown' of all the table pools.
close
in interface Closeable
IOException
public int getCurrentPoolSize(String tableName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |