public class OHTablePool extends Object implements Closeable
| 限定符和类型 | 类和说明 |
|---|---|
class |
OHTablePool.PooledOHTable
A proxy class that implements HTableInterface.close method to return the
wrapped table back to the table pool
|
| 构造器和说明 |
|---|
OHTablePool()
Default Constructor.
|
OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize)
Constructor to set maximum versions and use the specified configuration.
|
OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
OHTableFactory tableFactory)
Constructor to set maximum versions and use the specified configuration and
table factory.
|
OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
OHTableFactory tableFactory,
ExecutorService createTableExecutor,
org.apache.hadoop.hbase.util.PoolMap.PoolType poolType) |
OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
OHTableFactory tableFactory,
org.apache.hadoop.hbase.util.PoolMap.PoolType poolType)
Constructor to set maximum versions and use the specified configuration,
table factory and pool type.
|
OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
org.apache.hadoop.hbase.util.PoolMap.PoolType poolType)
Constructor to set maximum versions and use the specified configuration and
pool type.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Closes all the HTable instances , belonging to all tables in the table
pool.
|
void |
closeTablePool(byte[] tableName)
|
void |
closeTablePool(String tableName)
Closes all the HTable instances , belonging to the given table, in the
table pool.
|
protected org.apache.hadoop.hbase.client.Table |
createHTable(String tableName) |
boolean |
getAutoFlush(String tableName)
Gets the autoFlush flag for the specified tables in this pool.
|
boolean |
getClearBufferOnFail(String tableName)
Gets the flag of ClearBufferOnFail for the specified tables in this pool.
|
String |
getDatabase(String tableName)
Gets the ODP database name for the specified tables in this pool.
|
String |
getFullUserName(String tableName)
Gets the username for the specified table in this pool.
|
String |
getOdpAddr(String tableName)
Gets the ODP address for the specified tables in this pool.
|
boolean |
getOdpMode(String tableName)
Gets the ODP mode for the specified tables in this pool.
|
int |
getOdpPort(String tableName)
Gets the ODP port for the specified tables in this pool.
|
int |
getOperationTimeout(String tableName)
Gets the operation timeout for the specified tables in this pool.
|
String |
getOriginTableName() |
String |
getParamUrl(String tableName)
Gets the param url for the specified table in this pool.
|
String |
getPassword(String tableName)
Gets the password for the specified table in this pool.
|
ExecutorService |
getRuntimeBatchExecutor(String tableName) |
String |
getSysPassword(String tableName)
Gets the sys user password for the specified table in this pool.
|
String |
getSysUserName(String tableName)
Gets the sys username for the specified table in this pool.
|
org.apache.hadoop.hbase.client.Table |
getTable(byte[] tableName)
Get a reference to the specified table from the pool.
|
org.apache.hadoop.hbase.client.Table |
getTable(String tableName)
Get a reference to the specified table from the pool.
|
byte[] |
getTableAttribute(String tableName,
String attributeName) |
Object |
getTableExtendAttribute(String tableName,
String attributeName) |
long |
getWriteBufferSize(String tableName)
Get the maximum size in bytes of the write buffer for the specified tables
in this pool.
|
void |
putTable(org.apache.hadoop.hbase.client.Table table)
已过时。
|
void |
refreshTableEntry(String tableName,
String family,
boolean hasTestLoad) |
void |
setAutoFlush(String tableName,
boolean autoFlush)
|
void |
setAutoFlush(String tableName,
boolean autoFlush,
boolean clearBufferOnFail)
Sets the autoFlush flag for the specified tables in this pool.
|
void |
setDatabase(String tableName,
String database)
Sets the ODP database name for the specified tables in this pool.
|
void |
setFullUserName(String tableName,
String fullUserName)
|
void |
setOdpAddr(String tableName,
String odpAddr)
Sets the ODP address for the specified tables in this pool.
|
void |
setOdpMode(String tableName,
boolean odpMode)
Sets the ODP mode for the specified tables in this pool.
|
void |
setOdpPort(String tableName,
int odpPort)
Sets the ODP port for the specified tables in this pool.
|
void |
setOperationTimeout(String tableName,
int operationTimeout)
Sets the operation timeout for the specified tables in this pool.
|
void |
setParamUrl(String tableName,
String paramUrl)
|
void |
setPassword(String tableName,
String password)
|
void |
setRuntimeBatchExecutor(String tableName,
ExecutorService runtimeBatchExecutor) |
void |
setSysPassword(String tableName,
String sysPassword)
|
void |
setSysUserName(String tableName,
String sysUserName)
|
void |
setWriteBufferSize(String tableName,
long writeBufferSize)
Sets the size of the buffer in bytes for the specified tables in this pool.
|
public OHTablePool()
public OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize)
config - configurationmaxSize - maximum number of references to keep for each tablepublic OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
OHTableFactory tableFactory)
config - configurationmaxSize - maximum number of references to keep for each tabletableFactory - table factorypublic OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
org.apache.hadoop.hbase.util.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#ThreadLocalpublic OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
OHTableFactory tableFactory,
org.apache.hadoop.hbase.util.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#ThreadLocalpublic OHTablePool(org.apache.hadoop.conf.Configuration config,
int maxSize,
OHTableFactory tableFactory,
ExecutorService createTableExecutor,
org.apache.hadoop.hbase.util.PoolMap.PoolType poolType)
public org.apache.hadoop.hbase.client.Table getTable(String tableName)
tableName - table nameRuntimeException - if there is a problem instantiating the HTablepublic org.apache.hadoop.hbase.client.Table getTable(byte[] tableName)
tableName - table nameRuntimeException - if there is a problem instantiating the HTablepublic void putTable(org.apache.hadoop.hbase.client.Table table)
throws IOException
table - the proxy table user got from poolIOException - if failedprotected org.apache.hadoop.hbase.client.Table createHTable(String tableName)
public void closeTablePool(String tableName) throws IOException
tableName - table nameIOException - if failedpublic void closeTablePool(byte[] tableName)
throws IOException
tableName - table nameIOException - if failedpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic void setParamUrl(String tableName, String paramUrl)
tableName - table nameparamUrl - the table root server http urlpublic String getParamUrl(String tableName)
tableName - table namepublic void setFullUserName(String tableName, String fullUserName)
tableName - table namefullUserName - the table login usernamepublic String getFullUserName(String tableName)
tableName - table namepublic void setPassword(String tableName, String password)
tableName - table namepassword - the table login passwordpublic String getPassword(String tableName)
tableName - table namepublic void setSysUserName(String tableName, String sysUserName)
tableName - table namesysUserName - the sys usernamepublic String getSysUserName(String tableName)
tableName - table namepublic void setSysPassword(String tableName, String sysPassword)
tableName - table namesysPassword - the sys user passwordpublic String getSysPassword(String tableName)
tableName - table namepublic void setAutoFlush(String tableName, boolean autoFlush)
tableName - table nameautoFlush - Whether or not to enable 'auto-flush'.public void setAutoFlush(String tableName, boolean autoFlush, boolean clearBufferOnFail)
tableName - table nameautoFlush - Whether or not to enable 'auto-flush'.clearBufferOnFail - Whether to keep Put failures in the writeBufferpublic boolean getAutoFlush(String tableName)
tableName - table namepublic boolean getClearBufferOnFail(String tableName)
tableName - table namepublic void setWriteBufferSize(String tableName, long writeBufferSize) throws IOException
tableName - table namewriteBufferSize - The new write buffer size, in bytes.IOException - if a remote or network exception occurs.public long getWriteBufferSize(String tableName)
tableName - table namepublic String getOriginTableName()
public void setOperationTimeout(String tableName, int operationTimeout)
tableName - table nameoperationTimeout - timeoutpublic void refreshTableEntry(String tableName, String family, boolean hasTestLoad) throws Exception
Exceptionpublic int getOperationTimeout(String tableName)
tableName - table namepublic void setOdpAddr(String tableName, String odpAddr)
tableName - table nameodpAddr - ODP addresspublic String getOdpAddr(String tableName)
tableName - table namepublic void setOdpPort(String tableName, int odpPort)
tableName - table nameodpPort - ODP portpublic int getOdpPort(String tableName)
tableName - table namepublic void setOdpMode(String tableName, boolean odpMode)
tableName - table nameodpMode - ODP modepublic boolean getOdpMode(String tableName)
tableName - table namepublic void setDatabase(String tableName, String database)
tableName - table namedatabase - ODP database namepublic String getDatabase(String tableName)
tableName - table namepublic Object getTableExtendAttribute(String tableName, String attributeName)
public void setRuntimeBatchExecutor(String tableName, ExecutorService runtimeBatchExecutor)
public ExecutorService getRuntimeBatchExecutor(String tableName)
Copyright © 2025. All rights reserved.