Connection
and ConnectionFactory
@InterfaceAudience.Public @InterfaceStability.Stable @Deprecated public interface HConnection extends Connection
HConnectionManager
manages instances of this
class. See it for how to get one of these.
This is NOT a connection to a particular server but to ALL servers in the cluster. Individual connections are managed at a lower level.
HConnections are used by HTable
mostly but also by
HBaseAdmin
, and MetaTableLocator
.
HConnection instances can be shared. Sharing
is usually what you want because rather than each HConnection instance
having to do its own discovery of regions out on the cluster, instead, all
clients get to share the one cache of locations. HConnectionManager
does the
sharing for you if you go by it getting connections. Sharing makes cleanup of
HConnections awkward. See HConnectionManager
for cleanup discussion.
HConnectionManager
Modifier and Type | Field and Description |
---|---|
static String |
HBASE_CLIENT_CONNECTION_IMPL
Deprecated.
Key for configuration in Configuration whose value is the class we implement making a
new HConnection instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCaches(ServerName sn)
Deprecated.
internal method, do not use thru HConnection
|
void |
clearRegionCache()
Deprecated.
internal method, do not use thru HConnection
|
void |
clearRegionCache(byte[] tableName)
Deprecated.
|
void |
clearRegionCache(TableName tableName)
Deprecated.
internal method, do not use thru HConnection
|
void |
deleteCachedRegionLocation(HRegionLocation location)
Deprecated.
internal method, do not use thru HConnection
|
Admin |
getAdmin()
Deprecated.
Retrieve an Admin implementation to administer an HBase cluster.
|
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface |
getAdmin(ServerName serverName)
Deprecated.
internal method, do not use thru HConnection
|
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface |
getAdmin(ServerName serverName,
boolean getMaster)
Deprecated.
You can pass master flag but nothing special is done.
|
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface |
getClient(ServerName serverName)
Deprecated.
internal method, do not use thru HConnection
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Deprecated.
|
int |
getCurrentNrHRS()
Deprecated.
This method will be changed from public to package protected.
|
HTableDescriptor |
getHTableDescriptor(byte[] tableName)
Deprecated.
|
HTableDescriptor |
getHTableDescriptor(TableName tableName)
Deprecated.
|
HTableDescriptor[] |
getHTableDescriptors(List<String> tableNames)
Deprecated.
|
HTableDescriptor[] |
getHTableDescriptorsByTableName(List<TableName> tableNames)
Deprecated.
Use
Admin.getTableDescriptor(TableName) instead. |
org.apache.hadoop.hbase.client.MasterKeepAliveConnection |
getKeepAliveMasterService()
Deprecated.
Since 0.96.0
|
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.MasterService.BlockingInterface |
getMaster()
Deprecated.
internal method, do not use thru HConnection
|
org.apache.hadoop.hbase.client.NonceGenerator |
getNonceGenerator()
Deprecated.
internal method, do not use thru HConnection
|
boolean |
getRegionCachePrefetch(byte[] tableName)
Deprecated.
always return false since 0.99
|
boolean |
getRegionCachePrefetch(TableName tableName)
Deprecated.
always return false since 0.99
|
HRegionLocation |
getRegionLocation(byte[] tableName,
byte[] row,
boolean reload)
Deprecated.
|
HRegionLocation |
getRegionLocation(TableName tableName,
byte[] row,
boolean reload)
Deprecated.
internal method, do not use thru HConnection
|
RegionLocator |
getRegionLocator(TableName tableName)
Deprecated.
Retrieve a RegionLocator implementation to inspect region information on a table.
|
org.apache.hadoop.hbase.client.HTableInterface |
getTable(byte[] tableName)
Deprecated.
Retrieve an HTableInterface implementation for access to a table.
|
org.apache.hadoop.hbase.client.HTableInterface |
getTable(byte[] tableName,
ExecutorService pool)
Deprecated.
Retrieve an HTableInterface implementation for access to a table.
|
org.apache.hadoop.hbase.client.HTableInterface |
getTable(String tableName)
Deprecated.
Retrieve an HTableInterface implementation for access to a table.
|
org.apache.hadoop.hbase.client.HTableInterface |
getTable(String tableName,
ExecutorService pool)
Deprecated.
Retrieve an HTableInterface implementation for access to a table.
|
org.apache.hadoop.hbase.client.HTableInterface |
getTable(TableName tableName)
Deprecated.
Retrieve an HTableInterface implementation for access to a table.
|
org.apache.hadoop.hbase.client.HTableInterface |
getTable(TableName tableName,
ExecutorService pool)
Deprecated.
Retrieve an HTableInterface implementation for access to a table.
|
String[] |
getTableNames()
Deprecated.
Use
Admin.listTableNames() instead. |
boolean |
isClosed()
Deprecated.
Returns whether the connection is closed or not.
|
boolean |
isDeadServer(ServerName serverName)
Deprecated.
internal method, do not use thru HConnection
|
boolean |
isMasterRunning()
Deprecated.
internal method, do not use thru HConnection
|
boolean |
isTableAvailable(byte[] tableName)
Deprecated.
|
boolean |
isTableAvailable(byte[] tableName,
byte[][] splitKeys)
Deprecated.
|
boolean |
isTableAvailable(TableName tableName)
Deprecated.
|
boolean |
isTableAvailable(TableName tableName,
byte[][] splitKeys)
Deprecated.
internal method, do not use thru HConnection
|
boolean |
isTableDisabled(byte[] tableName)
Deprecated.
|
boolean |
isTableDisabled(TableName tableName)
Deprecated.
|
boolean |
isTableEnabled(byte[] tableName)
Deprecated.
|
boolean |
isTableEnabled(TableName tableName)
Deprecated.
A table that isTableEnabled == false and isTableDisabled == false
is possible.
|
TableName[] |
listTableNames()
Deprecated.
Use
Admin.listTables() instead. |
HTableDescriptor[] |
listTables()
Deprecated.
Use
Admin.listTables() instead. |
HRegionLocation |
locateRegion(byte[] regionName)
Deprecated.
internal method, do not use thru HConnection
|
HRegionLocation |
locateRegion(byte[] tableName,
byte[] row)
Deprecated.
|
HRegionLocation |
locateRegion(TableName tableName,
byte[] row)
Deprecated.
internal method, do not use thru HConnection
|
List<HRegionLocation> |
locateRegions(byte[] tableName)
Deprecated.
|
List<HRegionLocation> |
locateRegions(byte[] tableName,
boolean useCache,
boolean offlined)
Deprecated.
|
List<HRegionLocation> |
locateRegions(TableName tableName)
Deprecated.
internal method, do not use thru HConnection
|
List<HRegionLocation> |
locateRegions(TableName tableName,
boolean useCache,
boolean offlined)
Deprecated.
internal method, do not use thru HConnection
|
void |
processBatch(List<? extends Row> actions,
byte[] tableName,
ExecutorService pool,
Object[] results)
Deprecated.
|
void |
processBatch(List<? extends Row> actions,
TableName tableName,
ExecutorService pool,
Object[] results)
Deprecated.
since 0.96 - Use
Table.batch(java.util.List<? extends org.apache.hadoop.hbase.client.Row>, java.lang.Object[]) instead |
<R> void |
processBatchCallback(List<? extends Row> list,
byte[] tableName,
ExecutorService pool,
Object[] results,
org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback)
Deprecated.
|
<R> void |
processBatchCallback(List<? extends Row> list,
TableName tableName,
ExecutorService pool,
Object[] results,
org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback)
|
HRegionLocation |
relocateRegion(byte[] tableName,
byte[] row)
Deprecated.
|
HRegionLocation |
relocateRegion(TableName tableName,
byte[] row)
Deprecated.
internal method, do not use thru HConnection
|
void |
setRegionCachePrefetch(byte[] tableName,
boolean enable)
Deprecated.
does nothing since 0.99
|
void |
setRegionCachePrefetch(TableName tableName,
boolean enable)
Deprecated.
does nothing since since 0.99
|
void |
updateCachedLocations(byte[] tableName,
byte[] rowkey,
Object exception,
HRegionLocation source)
Deprecated.
|
void |
updateCachedLocations(TableName tableName,
byte[] regionName,
byte[] rowkey,
Object exception,
ServerName source)
Deprecated.
internal method, do not use thru HConnection
|
void |
updateCachedLocations(TableName tableName,
byte[] rowkey,
Object exception,
HRegionLocation source)
Deprecated.
|
close, getBufferedMutator, getBufferedMutator
static final String HBASE_CLIENT_CONNECTION_IMPL
org.apache.hadoop.conf.Configuration getConfiguration()
getConfiguration
in interface Connection
org.apache.hadoop.hbase.client.HTableInterface getTable(String tableName) throws IOException
HConnectionManager.createConnection(Configuration)
).tableName
- IOException
org.apache.hadoop.hbase.client.HTableInterface getTable(byte[] tableName) throws IOException
HConnectionManager.createConnection(Configuration)
).tableName
- IOException
org.apache.hadoop.hbase.client.HTableInterface getTable(TableName tableName) throws IOException
HConnectionManager.createConnection(Configuration)
).getTable
in interface Connection
tableName
- IOException
org.apache.hadoop.hbase.client.HTableInterface getTable(String tableName, ExecutorService pool) throws IOException
HConnectionManager.createConnection(Configuration)
).tableName
- pool
- The thread pool to use for batch operations, null to use a default pool.IOException
org.apache.hadoop.hbase.client.HTableInterface getTable(byte[] tableName, ExecutorService pool) throws IOException
HConnectionManager.createConnection(Configuration)
).tableName
- pool
- The thread pool to use for batch operations, null to use a default pool.IOException
org.apache.hadoop.hbase.client.HTableInterface getTable(TableName tableName, ExecutorService pool) throws IOException
HConnectionManager.createConnection(Configuration)
).getTable
in interface Connection
tableName
- pool
- The thread pool to use for batch operations, null to use a default pool.IOException
RegionLocator getRegionLocator(TableName tableName) throws IOException
HConnectionManager.createConnection(Configuration)
).getRegionLocator
in interface Connection
tableName
- Name of the table who's region is to be examinedIOException
Admin getAdmin() throws IOException
getAdmin
in interface Connection
IOException
@Deprecated boolean isMasterRunning() throws MasterNotRunningException, ZooKeeperConnectionException
MasterNotRunningException
ZooKeeperConnectionException
boolean isTableEnabled(TableName tableName) throws IOException
tableName
- table nameIOException
- if a remote or network exception occurs@Deprecated boolean isTableEnabled(byte[] tableName) throws IOException
IOException
boolean isTableDisabled(TableName tableName) throws IOException
tableName
- table nameIOException
- if a remote or network exception occurs@Deprecated boolean isTableDisabled(byte[] tableName) throws IOException
IOException
boolean isTableAvailable(TableName tableName) throws IOException
tableName
- table nameIOException
- if a remote or network exception occurs@Deprecated boolean isTableAvailable(byte[] tableName) throws IOException
IOException
@Deprecated boolean isTableAvailable(TableName tableName, byte[][] splitKeys) throws IOException
tableName
- tableNamesplitKeys
- splitKeys used while creating tableIOException
- if a remote or network exception occurs@Deprecated boolean isTableAvailable(byte[] tableName, byte[][] splitKeys) throws IOException
IOException
@Deprecated HTableDescriptor[] listTables() throws IOException
Admin.listTables()
instead.IOException
- if a remote or network exception occurs@Deprecated String[] getTableNames() throws IOException
Admin.listTableNames()
instead.IOException
@Deprecated TableName[] listTableNames() throws IOException
Admin.listTables()
instead.IOException
@Deprecated HTableDescriptor getHTableDescriptor(TableName tableName) throws IOException
tableName
- table nameIOException
- if a remote or network exception occurs@Deprecated HTableDescriptor getHTableDescriptor(byte[] tableName) throws IOException
IOException
@Deprecated HRegionLocation locateRegion(TableName tableName, byte[] row) throws IOException
tableName
- name of the table row is inrow
- row key you're trying to find the region ofIOException
- if a remote or network exception occurs@Deprecated HRegionLocation locateRegion(byte[] tableName, byte[] row) throws IOException
IOException
@Deprecated void clearRegionCache()
@Deprecated void clearRegionCache(TableName tableName)
tableName
tableName
- Name of the table whose regions we are to remove from
cache.@Deprecated void clearRegionCache(byte[] tableName)
@Deprecated void deleteCachedRegionLocation(HRegionLocation location)
location
- The location object for the region, to be purged from cache.@Deprecated HRegionLocation relocateRegion(TableName tableName, byte[] row) throws IOException
tableName
- name of the table row is inrow
- row key you're trying to find the region ofIOException
- if a remote or network exception occurs@Deprecated HRegionLocation relocateRegion(byte[] tableName, byte[] row) throws IOException
IOException
@Deprecated void updateCachedLocations(TableName tableName, byte[] rowkey, Object exception, HRegionLocation source)
@Deprecated void updateCachedLocations(TableName tableName, byte[] regionName, byte[] rowkey, Object exception, ServerName source)
tableName
- the table nameregionName
- the regionNamerowkey
- the rowexception
- the exception if any. Can be null.source
- the previous location@Deprecated void updateCachedLocations(byte[] tableName, byte[] rowkey, Object exception, HRegionLocation source)
@Deprecated HRegionLocation locateRegion(byte[] regionName) throws IOException
regionName
- name of the region to locateIOException
- if a remote or network exception occurs@Deprecated List<HRegionLocation> locateRegions(TableName tableName) throws IOException
tableName
- table to get regions ofIOException
@Deprecated List<HRegionLocation> locateRegions(byte[] tableName) throws IOException
IOException
@Deprecated List<HRegionLocation> locateRegions(TableName tableName, boolean useCache, boolean offlined) throws IOException
tableName
- table to get regions ofuseCache
- Should we use the cache to retrieve the region information.offlined
- True if we are to include offlined regions, false and we'll leave out offlined
regions from returned list.IOException
@Deprecated List<HRegionLocation> locateRegions(byte[] tableName, boolean useCache, boolean offlined) throws IOException
IOException
@Deprecated org.apache.hadoop.hbase.protobuf.generated.MasterProtos.MasterService.BlockingInterface getMaster() throws IOException
MasterKeepAliveConnection
to the active masterIOException
@Deprecated org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface getAdmin(ServerName serverName) throws IOException
serverName
- IOException
- if a remote or network exception occurs@Deprecated org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface getClient(ServerName serverName) throws IOException
serverName
- IOException
- if a remote or network exception occurs@Deprecated org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface getAdmin(ServerName serverName, boolean getMaster) throws IOException
serverName
- getMaster
- do we check if master is aliveIOException
- if a remote or network exception occurs@Deprecated HRegionLocation getRegionLocation(TableName tableName, byte[] row, boolean reload) throws IOException
tableName
- table namerow
- Row to find.reload
- If true do not use cache, otherwise bypass.IOException
- if a remote or network exception occurs@Deprecated HRegionLocation getRegionLocation(byte[] tableName, byte[] row, boolean reload) throws IOException
IOException
@Deprecated void processBatch(List<? extends Row> actions, TableName tableName, ExecutorService pool, Object[] results) throws IOException, InterruptedException
Table.batch(java.util.List<? extends org.apache.hadoop.hbase.client.Row>, java.lang.Object[])
insteadactions
- The collection of actions.tableName
- Name of the hbase tablepool
- thread pool for parallel executionresults
- An empty array, same size as list. If an exception is thrown,
you can test here for partial results, and to determine which actions
processed successfully.IOException
- if there are problems talking to META. Per-item
exceptions are stored in the results array.InterruptedException
@Deprecated void processBatch(List<? extends Row> actions, byte[] tableName, ExecutorService pool, Object[] results) throws IOException, InterruptedException
IOException
InterruptedException
@Deprecated <R> void processBatchCallback(List<? extends Row> list, TableName tableName, ExecutorService pool, Object[] results, org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) throws IOException, InterruptedException
Table.batchCallback(java.util.List<? extends org.apache.hadoop.hbase.client.Row>, java.lang.Object[], org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R>)
insteadRow
implementations.IOException
InterruptedException
@Deprecated <R> void processBatchCallback(List<? extends Row> list, byte[] tableName, ExecutorService pool, Object[] results, org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) throws IOException, InterruptedException
IOException
InterruptedException
@Deprecated void setRegionCachePrefetch(TableName tableName, boolean enable)
@Deprecated void setRegionCachePrefetch(byte[] tableName, boolean enable)
@Deprecated boolean getRegionCachePrefetch(TableName tableName)
@Deprecated boolean getRegionCachePrefetch(byte[] tableName)
@Deprecated int getCurrentNrHRS() throws IOException
IOException
- if a remote or network exception occurs@Deprecated HTableDescriptor[] getHTableDescriptorsByTableName(List<TableName> tableNames) throws IOException
Admin.getTableDescriptor(TableName)
instead.tableNames
- List of table namesIOException
- if a remote or network exception occurs@Deprecated HTableDescriptor[] getHTableDescriptors(List<String> tableNames) throws IOException
IOException
boolean isClosed()
Connection
isClosed
in interface Connection
@Deprecated void clearCaches(ServerName sn)
sn
.sn
- A server name@Deprecated org.apache.hadoop.hbase.client.MasterKeepAliveConnection getKeepAliveMasterService() throws MasterNotRunningException
MasterNotRunningException
@Deprecated boolean isDeadServer(ServerName serverName)
serverName
- @Deprecated org.apache.hadoop.hbase.client.NonceGenerator getNonceGenerator()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.