static class ConnectionManager.HConnectionImplementation extends Object implements ClusterConnection, Closeable
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ConnectionManager.HConnectionImplementation.MasterServiceState
State of the MasterService connection/setup.
|
(package private) class |
ConnectionManager.HConnectionImplementation.MasterServiceStubMaker
Class to make a MasterServiceStubMaker stub.
|
(package private) class |
ConnectionManager.HConnectionImplementation.StubMaker
Makes a client-side stub for master services.
|
HBASE_CLIENT_CONNECTION_IMPL
Modifier | Constructor and Description |
---|---|
protected |
ConnectionManager.HConnectionImplementation(org.apache.hadoop.conf.Configuration conf)
For tests.
|
(package private) |
ConnectionManager.HConnectionImplementation(org.apache.hadoop.conf.Configuration conf,
boolean managed) |
(package private) |
ConnectionManager.HConnectionImplementation(org.apache.hadoop.conf.Configuration conf,
boolean managed,
ExecutorService pool,
User user) |
(package private) |
ConnectionManager.HConnectionImplementation(org.apache.hadoop.conf.Configuration conf,
boolean managed,
ExecutorService pool,
User user,
String clusterId)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
abort(String msg,
Throwable t)
Abort the server or client.
|
void |
cacheLocation(TableName tableName,
RegionLocations location)
Put a newly discovered HRegionLocation into the cache.
|
private void |
cacheLocation(TableName tableName,
ServerName source,
HRegionLocation location)
Put a newly discovered HRegionLocation into the cache.
|
private void |
checkIfBaseNodeAvailable(ZooKeeperWatcher zkw) |
void |
clearCaches(ServerName serverName)
Clear any caches that pertain to server name
sn . |
void |
clearRegionCache()
Allows flushing the region cache.
|
void |
clearRegionCache(byte[] tableName) |
void |
clearRegionCache(TableName tableName)
Allows flushing the region cache of all locations that pertain to
tableName |
void |
clearRegionCache(TableName tableName,
byte[] row) |
void |
close() |
private void |
closeMaster()
Immediate close of the shared master.
|
private void |
closeMasterService(ConnectionManager.HConnectionImplementation.MasterServiceState mss) |
private void |
closeZooKeeperWatcher() |
protected AsyncProcess |
createAsyncProcess(org.apache.hadoop.conf.Configuration conf) |
(package private) void |
decCount()
Decrement this client's reference count.
|
void |
deleteCachedRegionLocation(HRegionLocation location)
Deletes cached locations for the specific region.
|
protected void |
finalize()
Close the connection for good, regardless of what the current value of
refCount is. |
Admin |
getAdmin()
Retrieve an Admin implementation to administer an HBase cluster.
|
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface |
getAdmin(ServerName serverName)
Establishes a connection to the region server at the specified address.
|
org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface |
getAdmin(ServerName serverName,
boolean master)
Establishes a connection to the region server at the specified address.
|
AsyncProcess |
getAsyncProcess() |
ClientBackoffPolicy |
getBackoffPolicy() |
private ExecutorService |
getBatchPool() |
BufferedMutator |
getBufferedMutator(BufferedMutatorParams params)
Retrieve a
BufferedMutator for performing client-side buffering of writes. |
BufferedMutator |
getBufferedMutator(TableName tableName)
Retrieve a
BufferedMutator for performing client-side buffering of writes. |
(package private) RegionLocations |
getCachedLocation(TableName tableName,
byte[] row)
Search the cache for a location that fits our table and row key.
|
org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface |
getClient(ServerName sn)
Establishes a connection to the region server at the specified address, and returns
a region client protocol.
|
org.apache.hadoop.conf.Configuration |
getConfiguration() |
ConnectionConfiguration |
getConnectionConfiguration() |
MetricsConnection |
getConnectionMetrics() |
protected ExecutorService |
getCurrentBatchPool() |
protected ExecutorService |
getCurrentMetaLookupPool() |
int |
getCurrentNrHRS() |
HTableDescriptor |
getHTableDescriptor(byte[] tableName)
Deprecated.
Use
Admin.getTableDescriptor(TableName) instead |
HTableDescriptor |
getHTableDescriptor(TableName tableName)
Deprecated.
Use
Admin.getTableDescriptor(TableName) instead |
HTableDescriptor[] |
getHTableDescriptors(List<String> names)
Deprecated.
Use
Admin.getTableDescriptorsByTableName(List) instead |
HTableDescriptor[] |
getHTableDescriptorsByTableName(List<TableName> tableNames)
Deprecated.
Use
Admin.getTableDescriptorsByTableName(List) instead |
MasterKeepAliveConnection |
getKeepAliveMasterService()
This function allows HBaseAdmin and potentially others to get a shared MasterService
connection.
|
(package private) ZooKeeperKeepAliveConnection |
getKeepAliveZooKeeperWatcher()
Retrieve a shared ZooKeeperWatcher.
|
org.apache.hadoop.hbase.protobuf.generated.MasterProtos.MasterService.BlockingInterface |
getMaster()
Returns a
MasterKeepAliveConnection to the active master |
private ExecutorService |
getMetaLookupPool() |
RpcRetryingCallerFactory |
getNewRpcRetryingCallerFactory(org.apache.hadoop.conf.Configuration conf)
Returns a new RpcRetryingCallerFactory from the given
Configuration . |
NonceGenerator |
getNonceGenerator() |
(package private) int |
getNumberOfCachedRegionLocations(TableName tableName) |
boolean |
getRegionCachePrefetch(byte[] tableName)
Deprecated.
|
boolean |
getRegionCachePrefetch(TableName tableName)
Deprecated.
|
HRegionLocation |
getRegionLocation(byte[] tableName,
byte[] row,
boolean reload) |
HRegionLocation |
getRegionLocation(TableName tableName,
byte[] row,
boolean reload)
Find region location hosting passed row
|
RegionLocator |
getRegionLocator(TableName tableName)
Retrieve a RegionLocator implementation to inspect region information on a table.
|
(package private) RpcClient |
getRpcClient()
For tests only.
|
RpcControllerFactory |
getRpcControllerFactory() |
RpcRetryingCallerFactory |
getRpcRetryingCallerFactory() |
ServerStatisticTracker |
getStatisticsTracker() |
(package private) static String |
getStubKey(String serviceName,
String rsHostname,
int port,
boolean resolveHostnames) |
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()
Deprecated.
Use
Admin.listTableNames() instead |
private ExecutorService |
getThreadPool(int maxThreads,
int coreThreads,
String nameHint,
BlockingQueue<Runnable> passedWorkQueue) |
boolean |
hasCellBlockSupport() |
(package private) void |
incCount()
Increment this client's reference count.
|
(package private) void |
internalClose() |
boolean |
isAborted()
Check if the server or client was aborted.
|
boolean |
isClosed()
Returns whether the connection is closed or not.
|
boolean |
isDeadServer(ServerName sn) |
private boolean |
isKeepAliveMasterConnectedAndRunning(ConnectionManager.HConnectionImplementation.MasterServiceState mss) |
boolean |
isManaged() |
boolean |
isMasterRunning()
Deprecated.
|
boolean |
isTableAvailable(byte[] tableName) |
boolean |
isTableAvailable(byte[] tableName,
byte[][] splitKeys) |
boolean |
isTableAvailable(TableName tableName) |
boolean |
isTableAvailable(TableName tableName,
byte[][] splitKeys)
Use this api to check if the table has been created with the specified number of
splitkeys which was used while creating the given table.
|
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.
|
(package private) boolean |
isZeroReference()
Return if this client has no reference
|
TableName[] |
listTableNames()
Deprecated.
Use
Admin.listTableNames() instead |
HTableDescriptor[] |
listTables()
Deprecated.
Use
Admin.listTables() instead |
private RegionLocations |
locateMeta(TableName tableName,
boolean useCache,
int replicaId) |
HRegionLocation |
locateRegion(byte[] regionName)
Gets the location of the region of regionName.
|
HRegionLocation |
locateRegion(byte[] tableName,
byte[] row) |
HRegionLocation |
locateRegion(TableName tableName,
byte[] row)
Find the location of the region of tableName that row
lives in.
|
RegionLocations |
locateRegion(TableName tableName,
byte[] row,
boolean useCache,
boolean retry) |
RegionLocations |
locateRegion(TableName tableName,
byte[] row,
boolean useCache,
boolean retry,
int replicaId) |
private RegionLocations |
locateRegionInMeta(TableName tableName,
byte[] row,
boolean useCache,
boolean retry,
int replicaId) |
List<HRegionLocation> |
locateRegions(byte[] tableName) |
List<HRegionLocation> |
locateRegions(byte[] tableName,
boolean useCache,
boolean offlined) |
List<HRegionLocation> |
locateRegions(TableName tableName)
Gets the locations of all regions in the specified table, tableName.
|
List<HRegionLocation> |
locateRegions(TableName tableName,
boolean useCache,
boolean offlined)
Gets the locations of all regions in the specified table, tableName.
|
void |
processBatch(List<? extends Row> list,
byte[] tableName,
ExecutorService pool,
Object[] results)
Deprecated.
|
void |
processBatch(List<? extends Row> list,
TableName tableName,
ExecutorService pool,
Object[] results)
Deprecated.
|
<R> void |
processBatchCallback(List<? extends Row> list,
byte[] tableName,
ExecutorService pool,
Object[] results,
Batch.Callback<R> callback)
Deprecated.
|
<R> void |
processBatchCallback(List<? extends Row> list,
TableName tableName,
ExecutorService pool,
Object[] results,
Batch.Callback<R> callback)
|
private static void |
release(ConnectionManager.HConnectionImplementation.MasterServiceState mss) |
(package private) void |
releaseMaster(ConnectionManager.HConnectionImplementation.MasterServiceState mss) |
(package private) void |
releaseZooKeeperWatcher(ZooKeeperWatcher zkw) |
HRegionLocation |
relocateRegion(byte[] tableName,
byte[] row) |
HRegionLocation |
relocateRegion(TableName tableName,
byte[] row)
Find the location of the region of tableName that row
lives in, ignoring any value that might be in the cache.
|
RegionLocations |
relocateRegion(TableName tableName,
byte[] row,
int replicaId)
Find the location of the region of tableName that row
lives in, ignoring any value that might be in the cache.
|
private void |
resetMasterServiceState(ConnectionManager.HConnectionImplementation.MasterServiceState mss) |
(package private) void |
retrieveClusterId() |
void |
setRegionCachePrefetch(byte[] tableName,
boolean enable)
Deprecated.
|
void |
setRegionCachePrefetch(TableName tableName,
boolean enable)
Deprecated.
|
private Registry |
setupRegistry() |
private void |
shutdownBatchPool(ExecutorService pool) |
private void |
shutdownPools() |
String |
toString()
An identifier that will remain the same for a given connection.
|
(package private) void |
updateCachedLocation(HRegionInfo hri,
ServerName source,
ServerName serverName,
long seqNum) |
void |
updateCachedLocations(byte[] tableName,
byte[] rowkey,
Object exception,
HRegionLocation source) |
void |
updateCachedLocations(TableName tableName,
byte[] regionName,
byte[] rowkey,
Object exception,
ServerName source)
Update the location with the new value (if the exception is a RegionMovedException)
or delete it from the cache.
|
void |
updateCachedLocations(TableName tableName,
byte[] rowkey,
Object exception,
HRegionLocation source) |
static final org.apache.commons.logging.Log LOG
private final boolean hostnamesCanChange
private final long pause
private final boolean useMetaReplicas
private final int numTries
final int rpcTimeout
private NonceGenerator nonceGenerator
private final AsyncProcess asyncProcess
private final ServerStatisticTracker stats
private volatile boolean closed
private volatile boolean aborted
ClusterStatusListener clusterStatusListener
private final Object metaRegionLock
private final Object masterAndZKLock
private long keepZooKeeperWatcherAliveUntil
private volatile ExecutorService batchPool
private volatile ExecutorService metaLookupPool
private volatile boolean cleanupPool
private final org.apache.hadoop.conf.Configuration conf
private final ConnectionConfiguration connectionConfig
private RpcClient rpcClient
private final MetaCache metaCache
private final MetricsConnection metrics
private int refCount
private boolean managed
protected User user
private RpcRetryingCallerFactory rpcCallerFactory
private RpcControllerFactory rpcControllerFactory
private final RetryingCallerInterceptor interceptor
Registry registry
private final ClientBackoffPolicy backoffPolicy
private final ReentrantLock userRegionLock
protected String clusterId
private final ConcurrentHashMap<String,Object> stubs
private final ConcurrentHashMap<String,String> connectionLock
private ZooKeeperKeepAliveConnection keepAliveZookeeper
private AtomicInteger keepAliveZookeeperUserCount
private boolean canCloseZKW
private static final long keepAlive
final ConnectionManager.HConnectionImplementation.MasterServiceState masterServiceState
ConnectionManager.HConnectionImplementation(org.apache.hadoop.conf.Configuration conf, boolean managed) throws IOException
IOException
ConnectionManager.HConnectionImplementation(org.apache.hadoop.conf.Configuration conf, boolean managed, ExecutorService pool, User user) throws IOException
IOException
ConnectionManager.HConnectionImplementation(org.apache.hadoop.conf.Configuration conf, boolean managed, ExecutorService pool, User user, String clusterId) throws IOException
conf
- Configuration objectmanaged
- If true, does not do full shutdown on close; i.e. cleanup of connection
to zk and shutdown of all services; we just close down the resources this connection was
responsible for and decrement usage counters. It is up to the caller to do the full
cleanup. It is set when we want have connection sharing going on -- reuse of zk connection,
and cached region locations, established regionserver connections, etc. When connections
are shared, we have reference counting going on and will only do full cleanup when no more
users of an HConnectionImplementation instance.IOException
protected ConnectionManager.HConnectionImplementation(org.apache.hadoop.conf.Configuration conf)
public HTableInterface getTable(String tableName) throws IOException
HConnection
HConnectionManager.createConnection(Configuration)
).getTable
in interface HConnection
IOException
public HTableInterface getTable(byte[] tableName) throws IOException
HConnection
HConnectionManager.createConnection(Configuration)
).getTable
in interface HConnection
IOException
public HTableInterface getTable(TableName tableName) throws IOException
HConnection
HConnectionManager.createConnection(Configuration)
).getTable
in interface Connection
getTable
in interface HConnection
tableName
- the name of the tableIOException
public HTableInterface getTable(String tableName, ExecutorService pool) throws IOException
HConnection
HConnectionManager.createConnection(Configuration)
).getTable
in interface HConnection
pool
- The thread pool to use for batch operations, null to use a default pool.IOException
public HTableInterface getTable(byte[] tableName, ExecutorService pool) throws IOException
HConnection
HConnectionManager.createConnection(Configuration)
).getTable
in interface HConnection
pool
- The thread pool to use for batch operations, null to use a default pool.IOException
public HTableInterface getTable(TableName tableName, ExecutorService pool) throws IOException
HConnection
HConnectionManager.createConnection(Configuration)
).getTable
in interface Connection
getTable
in interface HConnection
tableName
- the name of the tablepool
- The thread pool to use for batch operations, null to use a default pool.IOException
public BufferedMutator getBufferedMutator(BufferedMutatorParams params)
Connection
BufferedMutator
for performing client-side buffering of writes. The
BufferedMutator
returned by this method is thread-safe. This object can be used for
long lived table operations. The caller is responsible for calling
BufferedMutator.close()
on the returned BufferedMutator
instance.getBufferedMutator
in interface Connection
params
- details on how to instantiate the BufferedMutator
.BufferedMutator
for the supplied tableName.public BufferedMutator getBufferedMutator(TableName tableName)
Connection
Retrieve a BufferedMutator
for performing client-side buffering of writes. The
BufferedMutator
returned by this method is thread-safe. This BufferedMutator will
use the Connection's ExecutorService. This object can be used for long lived operations.
The caller is responsible for calling BufferedMutator.close()
on
the returned BufferedMutator
instance.
This accessor will use the connection's ExecutorService and will throw an exception in the main thread when an asynchronous exception occurs.
getBufferedMutator
in interface Connection
tableName
- the name of the tableBufferedMutator
for the supplied tableName.public RegionLocator getRegionLocator(TableName tableName) throws IOException
HConnection
HConnectionManager.createConnection(Configuration)
).getRegionLocator
in interface Connection
getRegionLocator
in interface HConnection
tableName
- Name of the table who's region is to be examinedIOException
public Admin getAdmin() throws IOException
HConnection
getAdmin
in interface Connection
getAdmin
in interface HConnection
IOException
public MetricsConnection getConnectionMetrics()
getConnectionMetrics
in interface ClusterConnection
private ExecutorService getBatchPool()
private ExecutorService getThreadPool(int maxThreads, int coreThreads, String nameHint, BlockingQueue<Runnable> passedWorkQueue)
private ExecutorService getMetaLookupPool()
protected ExecutorService getCurrentMetaLookupPool()
protected ExecutorService getCurrentBatchPool()
private void shutdownPools()
private void shutdownBatchPool(ExecutorService pool)
private Registry setupRegistry() throws IOException
IOException
RpcClient getRpcClient()
public String toString()
void retrieveClusterId()
public org.apache.hadoop.conf.Configuration getConfiguration()
getConfiguration
in interface Connection
getConfiguration
in interface HConnection
private void checkIfBaseNodeAvailable(ZooKeeperWatcher zkw) throws MasterNotRunningException
MasterNotRunningException
@Deprecated public boolean isMasterRunning() throws MasterNotRunningException, ZooKeeperConnectionException
isMasterRunning
in interface ClusterConnection
isMasterRunning
in interface HConnection
MasterNotRunningException
- - if the master is not runningZooKeeperConnectionException
public HRegionLocation getRegionLocation(TableName tableName, byte[] row, boolean reload) throws IOException
ClusterConnection
getRegionLocation
in interface ClusterConnection
getRegionLocation
in interface HConnection
tableName
- table namerow
- Row to find.reload
- If true do not use cache, otherwise bypass.IOException
- if a remote or network exception occurspublic HRegionLocation getRegionLocation(byte[] tableName, byte[] row, boolean reload) throws IOException
getRegionLocation
in interface HConnection
IOException
public boolean isTableEnabled(TableName tableName) throws IOException
HConnection
isTableEnabled
in interface HConnection
tableName
- table nameIOException
- if a remote or network exception occurspublic boolean isTableEnabled(byte[] tableName) throws IOException
isTableEnabled
in interface HConnection
IOException
public boolean isTableDisabled(TableName tableName) throws IOException
isTableDisabled
in interface HConnection
tableName
- table nameIOException
- if a remote or network exception occurspublic boolean isTableDisabled(byte[] tableName) throws IOException
isTableDisabled
in interface HConnection
IOException
public boolean isTableAvailable(TableName tableName) throws IOException
isTableAvailable
in interface HConnection
tableName
- table nameIOException
- if a remote or network exception occurspublic boolean isTableAvailable(byte[] tableName) throws IOException
isTableAvailable
in interface HConnection
IOException
public boolean isTableAvailable(TableName tableName, byte[][] splitKeys) throws IOException
ClusterConnection
isTableAvailable
in interface ClusterConnection
isTableAvailable
in interface HConnection
tableName
- tableNamesplitKeys
- splitKeys used while creating tableIOException
- if a remote or network exception occurspublic boolean isTableAvailable(byte[] tableName, byte[][] splitKeys) throws IOException
isTableAvailable
in interface HConnection
IOException
public HRegionLocation locateRegion(byte[] regionName) throws IOException
ClusterConnection
locateRegion
in interface ClusterConnection
locateRegion
in interface HConnection
regionName
- name of the region to locateIOException
- if a remote or network exception occurspublic boolean isDeadServer(ServerName sn)
isDeadServer
in interface ClusterConnection
isDeadServer
in interface HConnection
public List<HRegionLocation> locateRegions(TableName tableName) throws IOException
ClusterConnection
locateRegions
in interface ClusterConnection
locateRegions
in interface HConnection
tableName
- table to get regions ofIOException
public List<HRegionLocation> locateRegions(byte[] tableName) throws IOException
locateRegions
in interface HConnection
IOException
public List<HRegionLocation> locateRegions(TableName tableName, boolean useCache, boolean offlined) throws IOException
ClusterConnection
locateRegions
in interface ClusterConnection
locateRegions
in interface HConnection
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
public List<HRegionLocation> locateRegions(byte[] tableName, boolean useCache, boolean offlined) throws IOException
locateRegions
in interface HConnection
IOException
public HRegionLocation locateRegion(TableName tableName, byte[] row) throws IOException
ClusterConnection
locateRegion
in interface ClusterConnection
locateRegion
in interface HConnection
tableName
- name of the table row is inrow
- row key you're trying to find the region ofIOException
- if a remote or network exception occurspublic HRegionLocation locateRegion(byte[] tableName, byte[] row) throws IOException
locateRegion
in interface HConnection
IOException
public HRegionLocation relocateRegion(TableName tableName, byte[] row) throws IOException
ClusterConnection
relocateRegion
in interface ClusterConnection
relocateRegion
in interface HConnection
tableName
- name of the table row is inrow
- row key you're trying to find the region ofIOException
- if a remote or network exception occurspublic RegionLocations relocateRegion(TableName tableName, byte[] row, int replicaId) throws IOException
ClusterConnection
relocateRegion
in interface ClusterConnection
tableName
- name of the table row is inrow
- row key you're trying to find the region ofreplicaId
- the replicaId of the regionIOException
- if a remote or network exception occurspublic HRegionLocation relocateRegion(byte[] tableName, byte[] row) throws IOException
relocateRegion
in interface HConnection
IOException
public RegionLocations locateRegion(TableName tableName, byte[] row, boolean useCache, boolean retry) throws IOException
locateRegion
in interface ClusterConnection
tableName
- table to get regions ofrow
- the rowuseCache
- Should we use the cache to retrieve the region information.retry
- do we retryIOException
public RegionLocations locateRegion(TableName tableName, byte[] row, boolean useCache, boolean retry, int replicaId) throws IOException
locateRegion
in interface ClusterConnection
tableName
- table to get regions ofrow
- the rowuseCache
- Should we use the cache to retrieve the region information.retry
- do we retryreplicaId
- the replicaId for the regionIOException
private RegionLocations locateMeta(TableName tableName, boolean useCache, int replicaId) throws IOException
IOException
private RegionLocations locateRegionInMeta(TableName tableName, byte[] row, boolean useCache, boolean retry, int replicaId) throws IOException
IOException
public void cacheLocation(TableName tableName, RegionLocations location)
cacheLocation
in interface ClusterConnection
tableName
- The table name.location
- the new locationRegionLocations getCachedLocation(TableName tableName, byte[] row)
tableName
- row
- public void clearRegionCache(TableName tableName, byte[] row)
public void clearCaches(ServerName serverName)
ClusterConnection
sn
.clearCaches
in interface ClusterConnection
clearCaches
in interface HConnection
serverName
- A server namepublic void clearRegionCache()
ClusterConnection
clearRegionCache
in interface ClusterConnection
clearRegionCache
in interface HConnection
public void clearRegionCache(TableName tableName)
ClusterConnection
tableName
clearRegionCache
in interface ClusterConnection
clearRegionCache
in interface HConnection
tableName
- Name of the table whose regions we are to remove from
cache.public void clearRegionCache(byte[] tableName)
clearRegionCache
in interface HConnection
private void cacheLocation(TableName tableName, ServerName source, HRegionLocation location)
tableName
- The table name.source
- the source of the new location, if it's not coming from metalocation
- the new locationpublic org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface getAdmin(ServerName serverName) throws IOException
ClusterConnection
getAdmin
in interface ClusterConnection
getAdmin
in interface HConnection
IOException
- if a remote or network exception occurspublic org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface getAdmin(ServerName serverName, boolean master) throws IOException
HConnection
getAdmin
in interface HConnection
master
- do we check if master is aliveIOException
- if a remote or network exception occurspublic org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface getClient(ServerName sn) throws IOException
ClusterConnection
getClient
in interface ClusterConnection
getClient
in interface HConnection
IOException
- if a remote or network exception occursstatic String getStubKey(String serviceName, String rsHostname, int port, boolean resolveHostnames)
ZooKeeperKeepAliveConnection getKeepAliveZooKeeperWatcher() throws IOException
IOException
void releaseZooKeeperWatcher(ZooKeeperWatcher zkw)
private void closeZooKeeperWatcher()
public org.apache.hadoop.hbase.protobuf.generated.MasterProtos.MasterService.BlockingInterface getMaster() throws MasterNotRunningException
ClusterConnection
MasterKeepAliveConnection
to the active mastergetMaster
in interface ClusterConnection
getMaster
in interface HConnection
MasterNotRunningException
private void resetMasterServiceState(ConnectionManager.HConnectionImplementation.MasterServiceState mss)
public MasterKeepAliveConnection getKeepAliveMasterService() throws MasterNotRunningException
ClusterConnection
getKeepAliveMasterService
in interface ClusterConnection
getKeepAliveMasterService
in interface HConnection
MasterNotRunningException
private static void release(ConnectionManager.HConnectionImplementation.MasterServiceState mss)
private boolean isKeepAliveMasterConnectedAndRunning(ConnectionManager.HConnectionImplementation.MasterServiceState mss)
void releaseMaster(ConnectionManager.HConnectionImplementation.MasterServiceState mss)
private void closeMasterService(ConnectionManager.HConnectionImplementation.MasterServiceState mss)
private void closeMaster()
void updateCachedLocation(HRegionInfo hri, ServerName source, ServerName serverName, long seqNum)
public void deleteCachedRegionLocation(HRegionLocation location)
ClusterConnection
deleteCachedRegionLocation
in interface ClusterConnection
deleteCachedRegionLocation
in interface HConnection
location
- The location object for the region, to be purged from cache.public void updateCachedLocations(TableName tableName, byte[] rowkey, Object exception, HRegionLocation source)
updateCachedLocations
in interface HConnection
public void updateCachedLocations(TableName tableName, byte[] regionName, byte[] rowkey, Object exception, ServerName source)
updateCachedLocations
in interface ClusterConnection
updateCachedLocations
in interface HConnection
exception
- an object (to simplify user code) on which we will try to find a nested
or wrapped or both RegionMovedExceptionsource
- server that is the source of the location update.tableName
- the table nameregionName
- the region namerowkey
- the rowpublic void updateCachedLocations(byte[] tableName, byte[] rowkey, Object exception, HRegionLocation source)
updateCachedLocations
in interface HConnection
@Deprecated public void processBatch(List<? extends Row> list, TableName tableName, ExecutorService pool, Object[] results) throws IOException, InterruptedException
HConnection
processBatch
in interface HConnection
list
- 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 public void processBatch(List<? extends Row> list, byte[] tableName, ExecutorService pool, Object[] results) throws IOException, InterruptedException
processBatch
in interface HConnection
IOException
InterruptedException
@Deprecated public <R> void processBatchCallback(List<? extends Row> list, TableName tableName, ExecutorService pool, Object[] results, Batch.Callback<R> callback) throws IOException, InterruptedException
HTable.processBatchCallback(java.util.List<? extends org.apache.hadoop.hbase.client.Row>, java.lang.Object[], org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R>)
insteadprocessBatchCallback
in interface HConnection
IOException
InterruptedException
@Deprecated public <R> void processBatchCallback(List<? extends Row> list, byte[] tableName, ExecutorService pool, Object[] results, Batch.Callback<R> callback) throws IOException, InterruptedException
processBatchCallback
in interface HConnection
IOException
InterruptedException
protected AsyncProcess createAsyncProcess(org.apache.hadoop.conf.Configuration conf)
public AsyncProcess getAsyncProcess()
getAsyncProcess
in interface ClusterConnection
public ServerStatisticTracker getStatisticsTracker()
getStatisticsTracker
in interface ClusterConnection
public ClientBackoffPolicy getBackoffPolicy()
getBackoffPolicy
in interface ClusterConnection
int getNumberOfCachedRegionLocations(TableName tableName)
@Deprecated public void setRegionCachePrefetch(TableName tableName, boolean enable)
setRegionCachePrefetch
in interface HConnection
@Deprecated public void setRegionCachePrefetch(byte[] tableName, boolean enable)
setRegionCachePrefetch
in interface HConnection
@Deprecated public boolean getRegionCachePrefetch(TableName tableName)
getRegionCachePrefetch
in interface HConnection
@Deprecated public boolean getRegionCachePrefetch(byte[] tableName)
getRegionCachePrefetch
in interface HConnection
public void abort(String msg, Throwable t)
Abortable
public boolean isClosed()
Connection
isClosed
in interface Connection
isClosed
in interface HConnection
public boolean isAborted()
Abortable
public int getCurrentNrHRS() throws IOException
getCurrentNrHRS
in interface HConnection
IOException
- if a remote or network exception occursvoid incCount()
void decCount()
boolean isZeroReference()
void internalClose()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Connection
protected void finalize() throws Throwable
refCount
is. Ideally, refCount
should be zero at this
point, which would be the case if all of its consumers close the
connection. However, on the off chance that someone is unable to close
the connection, perhaps because it bailed out prematurely, the method
below will ensure that this HConnection
instance is cleaned up.
Caveat: The JVM may take an unknown amount of time to call finalize on an
unreachable object, so our hope is that every consumer cleans up after
itself, like any good citizen.@Deprecated public HTableDescriptor[] listTables() throws IOException
Admin.listTables()
insteadHConnection
listTables
in interface HConnection
IOException
- if a remote or network exception occurs@Deprecated public String[] getTableNames() throws IOException
Admin.listTableNames()
insteadgetTableNames
in interface HConnection
IOException
@Deprecated public TableName[] listTableNames() throws IOException
Admin.listTableNames()
insteadlistTableNames
in interface HConnection
IOException
@Deprecated public HTableDescriptor[] getHTableDescriptorsByTableName(List<TableName> tableNames) throws IOException
Admin.getTableDescriptorsByTableName(List)
insteadgetHTableDescriptorsByTableName
in interface HConnection
tableNames
- List of table namesIOException
- if a remote or network exception occurs@Deprecated public HTableDescriptor[] getHTableDescriptors(List<String> names) throws IOException
Admin.getTableDescriptorsByTableName(List)
insteadgetHTableDescriptors
in interface HConnection
IOException
public NonceGenerator getNonceGenerator()
getNonceGenerator
in interface ClusterConnection
getNonceGenerator
in interface HConnection
@Deprecated public HTableDescriptor getHTableDescriptor(TableName tableName) throws IOException
Admin.getTableDescriptor(TableName)
insteadgetHTableDescriptor
in interface HConnection
tableName
- table nameIOException
- if the connection to master fails or if the table
is not found.@Deprecated public HTableDescriptor getHTableDescriptor(byte[] tableName) throws IOException
Admin.getTableDescriptor(TableName)
insteadgetHTableDescriptor
in interface HConnection
IOException
public RpcRetryingCallerFactory getNewRpcRetryingCallerFactory(org.apache.hadoop.conf.Configuration conf)
ClusterConnection
Configuration
.
This RpcRetryingCallerFactory lets the users create RpcRetryingCaller
s which can be
intercepted with the configured RetryingCallerInterceptor
getNewRpcRetryingCallerFactory
in interface ClusterConnection
public boolean isManaged()
isManaged
in interface ClusterConnection
public boolean hasCellBlockSupport()
hasCellBlockSupport
in interface ClusterConnection
Codec
and so
supports cell blocks.public ConnectionConfiguration getConnectionConfiguration()
getConnectionConfiguration
in interface ClusterConnection
public RpcRetryingCallerFactory getRpcRetryingCallerFactory()
getRpcRetryingCallerFactory
in interface ClusterConnection
public RpcControllerFactory getRpcControllerFactory()
getRpcControllerFactory
in interface ClusterConnection
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.