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
限定符和类型 | 字段和说明 |
---|---|
static String |
HBASE_CLIENT_CONNECTION_IMPL
已过时。
Key for configuration in Configuration whose value is the class we implement making a
new HConnection instance.
|
限定符和类型 | 方法和说明 |
---|---|
void |
clearCaches(ServerName sn)
已过时。
internal method, do not use thru HConnection
|
void |
clearRegionCache()
已过时。
internal method, do not use thru HConnection
|
void |
clearRegionCache(byte[] tableName)
已过时。
|
void |
clearRegionCache(TableName tableName)
已过时。
internal method, do not use thru HConnection
|
void |
deleteCachedRegionLocation(HRegionLocation location)
已过时。
internal method, do not use thru HConnection
|
Admin |
getAdmin()
已过时。
Retrieve an Admin implementation to administer an HBase cluster.
|
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface |
getAdmin(ServerName serverName)
已过时。
internal method, do not use thru HConnection
|
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface |
getAdmin(ServerName serverName,
boolean getMaster)
已过时。
You can pass master flag but nothing special is done.
|
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface |
getClient(ServerName serverName)
已过时。
internal method, do not use thru HConnection
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
已过时。
|
int |
getCurrentNrHRS()
已过时。
This method will be changed from public to package protected.
|
HTableDescriptor |
getHTableDescriptor(byte[] tableName)
已过时。
|
HTableDescriptor |
getHTableDescriptor(TableName tableName)
已过时。
|
HTableDescriptor[] |
getHTableDescriptors(List<String> tableNames)
已过时。
|
HTableDescriptor[] |
getHTableDescriptorsByTableName(List<TableName> tableNames)
已过时。
Use
Admin.getTableDescriptor(TableName) instead. |
org.apache.hadoop.hbase.client.MasterKeepAliveConnection |
getKeepAliveMasterService()
已过时。
Since 0.96.0
|
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.MasterService.BlockingInterface |
getMaster()
已过时。
internal method, do not use thru HConnection
|
NonceGenerator |
getNonceGenerator()
已过时。
internal method, do not use thru HConnection
|
boolean |
getRegionCachePrefetch(byte[] tableName)
已过时。
always return false since 0.99
|
boolean |
getRegionCachePrefetch(TableName tableName)
已过时。
always return false since 0.99
|
HRegionLocation |
getRegionLocation(byte[] tableName,
byte[] row,
boolean reload)
已过时。
|
HRegionLocation |
getRegionLocation(TableName tableName,
byte[] row,
boolean reload)
已过时。
internal method, do not use thru HConnection
|
RegionLocator |
getRegionLocator(TableName tableName)
已过时。
Retrieve a RegionLocator implementation to inspect region information on a table.
|
HTableInterface |
getTable(byte[] tableName)
已过时。
Retrieve an HTableInterface implementation for access to a table.
|
HTableInterface |
getTable(byte[] tableName,
ExecutorService pool)
已过时。
Retrieve an HTableInterface implementation for access to a table.
|
HTableInterface |
getTable(String tableName)
已过时。
Retrieve an HTableInterface implementation for access to a table.
|
HTableInterface |
getTable(String tableName,
ExecutorService pool)
已过时。
Retrieve an HTableInterface implementation for access to a table.
|
HTableInterface |
getTable(TableName tableName)
已过时。
Retrieve an HTableInterface implementation for access to a table.
|
HTableInterface |
getTable(TableName tableName,
ExecutorService pool)
已过时。
Retrieve an HTableInterface implementation for access to a table.
|
String[] |
getTableNames()
已过时。
Use
Admin.listTableNames() instead. |
boolean |
isClosed()
已过时。
Returns whether the connection is closed or not.
|
boolean |
isDeadServer(ServerName serverName)
已过时。
internal method, do not use thru HConnection
|
boolean |
isMasterRunning()
已过时。
internal method, do not use thru HConnection
|
boolean |
isTableAvailable(byte[] tableName)
已过时。
|
boolean |
isTableAvailable(byte[] tableName,
byte[][] splitKeys)
已过时。
|
boolean |
isTableAvailable(TableName tableName)
已过时。
|
boolean |
isTableAvailable(TableName tableName,
byte[][] splitKeys)
已过时。
internal method, do not use thru HConnection
|
boolean |
isTableDisabled(byte[] tableName)
已过时。
|
boolean |
isTableDisabled(TableName tableName)
已过时。
|
boolean |
isTableEnabled(byte[] tableName)
已过时。
|
boolean |
isTableEnabled(TableName tableName)
已过时。
A table that isTableEnabled == false and isTableDisabled == false
is possible.
|
TableName[] |
listTableNames()
已过时。
Use
Admin.listTables() instead. |
HTableDescriptor[] |
listTables()
已过时。
Use
Admin.listTables() instead. |
HRegionLocation |
locateRegion(byte[] regionName)
已过时。
internal method, do not use thru HConnection
|
HRegionLocation |
locateRegion(byte[] tableName,
byte[] row)
已过时。
|
HRegionLocation |
locateRegion(TableName tableName,
byte[] row)
已过时。
internal method, do not use thru HConnection
|
List<HRegionLocation> |
locateRegions(byte[] tableName)
已过时。
|
List<HRegionLocation> |
locateRegions(byte[] tableName,
boolean useCache,
boolean offlined)
已过时。
|
List<HRegionLocation> |
locateRegions(TableName tableName)
已过时。
internal method, do not use thru HConnection
|
List<HRegionLocation> |
locateRegions(TableName tableName,
boolean useCache,
boolean offlined)
已过时。
internal method, do not use thru HConnection
|
void |
processBatch(List<? extends Row> actions,
byte[] tableName,
ExecutorService pool,
Object[] results)
已过时。
|
void |
processBatch(List<? extends Row> actions,
TableName tableName,
ExecutorService pool,
Object[] results)
已过时。
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,
Batch.Callback<R> callback)
已过时。
|
<R> void |
processBatchCallback(List<? extends Row> list,
TableName tableName,
ExecutorService pool,
Object[] results,
Batch.Callback<R> callback)
|
HRegionLocation |
relocateRegion(byte[] tableName,
byte[] row)
已过时。
|
HRegionLocation |
relocateRegion(TableName tableName,
byte[] row)
已过时。
internal method, do not use thru HConnection
|
void |
setRegionCachePrefetch(byte[] tableName,
boolean enable)
已过时。
does nothing since 0.99
|
void |
setRegionCachePrefetch(TableName tableName,
boolean enable)
已过时。
does nothing since since 0.99
|
void |
updateCachedLocations(byte[] tableName,
byte[] rowkey,
Object exception,
HRegionLocation source)
已过时。
|
void |
updateCachedLocations(TableName tableName,
byte[] regionName,
byte[] rowkey,
Object exception,
ServerName source)
已过时。
internal method, do not use thru HConnection
|
void |
updateCachedLocations(TableName tableName,
byte[] rowkey,
Object exception,
HRegionLocation source)
已过时。
|
close, getBufferedMutator, getBufferedMutator, getClusterId
org.apache.hadoop.conf.Configuration getConfiguration()
getConfiguration
在接口中 Connection
HTableInterface getTable(String tableName) throws IOException
HConnectionManager.createConnection(Configuration)
).tableName
- IOException
HTableInterface getTable(byte[] tableName) throws IOException
HConnectionManager.createConnection(Configuration)
).tableName
- IOException
HTableInterface getTable(TableName tableName) throws IOException
HConnectionManager.createConnection(Configuration)
).getTable
在接口中 Connection
tableName
- IOException
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
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
HTableInterface getTable(TableName tableName, ExecutorService pool) throws IOException
HConnectionManager.createConnection(Configuration)
).getTable
在接口中 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
在接口中 Connection
tableName
- Name of the table who's region is to be examinedIOException
Admin getAdmin() throws IOException
getAdmin
在接口中 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
@Deprecated <R> void processBatchCallback(List<? extends Row> list, TableName tableName, ExecutorService pool, Object[] results, 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.@Deprecated <R> void processBatchCallback(List<? extends Row> list, byte[] tableName, ExecutorService pool, Object[] results, Batch.Callback<R> callback) throws 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
在接口中 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 NonceGenerator getNonceGenerator()
Copyright © 2007–2022 The Apache Software Foundation. All rights reserved.