@InterfaceAudience.Private public class SharedConnection extends Object implements Connection
| Modifier and Type | Field and Description |
|---|---|
private Connection |
conn |
| Constructor and Description |
|---|
SharedConnection(Connection conn) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(String why,
Throwable e)
Abort the server or client.
|
void |
clearRegionLocationCache()
Clear all the entries in the region location cache, for all the tables.
|
void |
close() |
Admin |
getAdmin()
Retrieve an Admin implementation to administer an HBase cluster.
|
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. |
org.apache.hadoop.conf.Configuration |
getConfiguration() |
Hbck |
getHbck()
Retrieve an Hbck implementation to fix an HBase cluster.
|
Hbck |
getHbck(ServerName masterServer)
Retrieve an Hbck implementation to fix an HBase cluster.
|
RegionLocator |
getRegionLocator(TableName tableName)
Retrieve a RegionLocator implementation to inspect region information on a table.
|
TableBuilder |
getTableBuilder(TableName tableName,
ExecutorService pool)
Returns an
TableBuilder for creating Table. |
boolean |
isAborted()
Check if the server or client was aborted.
|
boolean |
isClosed()
Returns whether the connection is closed or not.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTable, getTableprivate final Connection conn
public SharedConnection(Connection conn)
public void close() throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ConnectionIOExceptionpublic boolean isClosed()
ConnectionisClosed in interface Connectionpublic void abort(String why, Throwable e)
Abortablepublic boolean isAborted()
Abortablepublic org.apache.hadoop.conf.Configuration getConfiguration()
getConfiguration in interface Connectionpublic BufferedMutator getBufferedMutator(TableName tableName) throws IOException
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 ConnectiontableName - the name of the tableBufferedMutator for the supplied tableName.IOExceptionpublic BufferedMutator getBufferedMutator(BufferedMutatorParams params) throws IOException
ConnectionBufferedMutator 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 Connectionparams - details on how to instantiate the BufferedMutator.BufferedMutator for the supplied tableName.IOExceptionpublic RegionLocator getRegionLocator(TableName tableName) throws IOException
ConnectionCloseable.close() on the returned
RegionLocator instance.
RegionLocator needs to be unmanagedgetRegionLocator in interface ConnectiontableName - Name of the table who's region is to be examinedIOExceptionpublic Admin getAdmin() throws IOException
ConnectionAdmin.close() on the returned
Admin instance.getAdmin in interface ConnectionIOExceptionpublic TableBuilder getTableBuilder(TableName tableName, ExecutorService pool)
ConnectionTableBuilder for creating Table.getTableBuilder in interface ConnectiontableName - the name of the tablepool - the thread pool to use for requests like batch and scanpublic void clearRegionLocationCache()
ConnectionRegionLocator.clearRegionLocationCache().
This may cause performance issue so use it with caution.clearRegionLocationCache in interface Connectionpublic Hbck getHbck() throws IOException
ConnectionCloseable.close() on the returned Hbck instance.
getHbck in interface ConnectionIOExceptionpublic Hbck getHbck(ServerName masterServer) throws IOException
ConnectionCloseable.close() on the returned Hbck instance.
getHbck in interface ConnectionmasterServer - explicit ServerName for master serverIOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.