|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@InterfaceAudience.Public @InterfaceStability.Stable public interface HConnection
Cluster connection. Hosts a connection to the ZooKeeper ensemble and
thereafter into the HBase cluster. Knows how to locate regions out on the cluster,
keeps a cache of locations and then knows how to recalibrate after they move.
HConnectionManager
manages instances of this class.
HConnections are used by HTable
mostly but also by
HBaseAdmin
, CatalogTracker
,
and ZooKeeperWatcher
. 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. Sharing makes cleanup of
HConnections awkward. See HConnectionManager
for cleanup
discussion.
HConnectionManager
Method Summary | ||
---|---|---|
void |
clearCaches(ServerName sn)
Clear any caches that pertain to server name sn |
|
void |
clearRegionCache()
Allows flushing the region cache. |
|
void |
clearRegionCache(byte[] tableName)
Allows flushing the region cache of all locations that pertain to tableName |
|
AdminProtocol |
getAdmin(ServerName serverName)
Establishes a connection to the region server at the specified address. |
|
AdminProtocol |
getAdmin(ServerName serverName,
boolean getMaster)
Establishes a connection to the region server at the specified address. |
|
AdminProtocol |
getAdmin(String hostname,
int port)
Deprecated. - use @link {#getAdmin(final ServerName serverName)} which takes into account the startCode |
|
AdminProtocol |
getAdmin(String hostname,
int port,
boolean getMaster)
Deprecated. use @link {#getAdmin(final ServerName serverName, boolean getMaster)} which takes into account the startCode. |
|
ClientProtocol |
getClient(ServerName serverName)
Establishes a connection to the region server at the specified address, and return a region client protocol. |
|
ClientProtocol |
getClient(String hostname,
int port)
Deprecated. - use @link {#getClient(final ServerName serverName)} which takes into account the startCode |
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
|
|
int |
getCurrentNrHRS()
Deprecated. This method will be changed from public to package protected. |
|
HTableDescriptor |
getHTableDescriptor(byte[] tableName)
|
|
HTableDescriptor[] |
getHTableDescriptors(List<String> tableNames)
|
|
org.apache.hadoop.hbase.client.MasterAdminKeepAliveConnection |
getKeepAliveMasterAdmin()
This function allows HBaseAdmin and potentially others to get a shared MasterAdminProtocol connection. |
|
org.apache.hadoop.hbase.client.MasterMonitorKeepAliveConnection |
getKeepAliveMasterMonitor()
This function allows HBaseAdminProtocol and potentially others to get a shared MasterMonitor connection. |
|
MasterAdminProtocol |
getMasterAdmin()
Returns a MasterAdminProtocol to the active master |
|
MasterMonitorProtocol |
getMasterMonitor()
Returns an MasterMonitorProtocol to the active master |
|
boolean |
getRegionCachePrefetch(byte[] tableName)
Check whether region cache prefetch is enabled or not. |
|
HRegionLocation |
getRegionLocation(byte[] tableName,
byte[] row,
boolean reload)
Find region location hosting passed row |
|
|
getRegionServerWithoutRetries(ServerCallable<T> callable)
Deprecated. |
|
|
getRegionServerWithRetries(ServerCallable<T> callable)
Deprecated. |
|
ZooKeeperWatcher |
getZooKeeperWatcher()
Deprecated. Removed because it was a mistake exposing zookeeper in this interface (ZooKeeper is an implementation detail). Deprecated in HBase 0.94 |
|
boolean |
isClosed()
|
|
boolean |
isDeadServer(ServerName serverName)
|
|
boolean |
isMasterRunning()
|
|
boolean |
isTableAvailable(byte[] tableName)
|
|
boolean |
isTableAvailable(byte[] 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 |
isTableEnabled(byte[] tableName)
A table that isTableEnabled == false and isTableDisabled == false is possible. |
|
HTableDescriptor[] |
listTables()
List all the userspace tables. |
|
HRegionLocation |
locateRegion(byte[] regionName)
Gets the location of the region of regionName. |
|
HRegionLocation |
locateRegion(byte[] tableName,
byte[] row)
Find the location of the region of tableName that row lives in. |
|
List<HRegionLocation> |
locateRegions(byte[] tableName)
Gets the locations of all regions in the specified table, tableName. |
|
List<HRegionLocation> |
locateRegions(byte[] tableName,
boolean useCache,
boolean offlined)
Gets the locations of all regions in the specified table, tableName. |
|
void |
processBatch(List<? extends Row> actions,
byte[] tableName,
ExecutorService pool,
Object[] results)
Deprecated. since 0.96 - Use HTableInterface.batch(java.util.List extends org.apache.hadoop.hbase.client.Row>, java.lang.Object[]) instead |
|
|
processBatchCallback(List<? extends Row> list,
byte[] tableName,
ExecutorService pool,
Object[] results,
Batch.Callback<R> callback)
Deprecated. since 0.96 - Use HTableInterface.batchCallback(java.util.List extends org.apache.hadoop.hbase.client.Row>, java.lang.Object[], org.apache.hadoop.hbase.client.coprocessor.Batch.Callback instead |
|
HRegionLocation |
relocateRegion(byte[] tableName,
byte[] row)
Find the location of the region of tableName that row lives in, ignoring any value that might be in the cache. |
|
void |
setRegionCachePrefetch(byte[] tableName,
boolean enable)
Enable or disable region cache prefetch for the table. |
Methods inherited from interface org.apache.hadoop.hbase.Abortable |
---|
abort, isAborted |
Methods inherited from interface java.io.Closeable |
---|
close |
Method Detail |
---|
org.apache.hadoop.conf.Configuration getConfiguration()
@Deprecated ZooKeeperWatcher getZooKeeperWatcher() throws IOException
IOException
- if a remote or network exception occursboolean isMasterRunning() throws MasterNotRunningException, ZooKeeperConnectionException
MasterNotRunningException
ZooKeeperConnectionException
boolean isTableEnabled(byte[] tableName) throws IOException
tableName
- table name
IOException
- if a remote or network exception occursboolean isTableDisabled(byte[] tableName) throws IOException
tableName
- table name
IOException
- if a remote or network exception occursboolean isTableAvailable(byte[] tableName) throws IOException
tableName
- table name
IOException
- if a remote or network exception occursboolean isTableAvailable(byte[] tableName, byte[][] splitKeys) throws IOException
tableName
- tableNamesplitKeys
- splitKeys used while creating table
IOException
- if a remote or network exception occursHTableDescriptor[] listTables() throws IOException
IOException
- if a remote or network exception occursHTableDescriptor getHTableDescriptor(byte[] tableName) throws IOException
tableName
- table name
IOException
- if a remote or network exception occursHRegionLocation locateRegion(byte[] tableName, byte[] row) throws IOException
tableName
- name of the table row is inrow
- row key you're trying to find the region of
IOException
- if a remote or network exception occursvoid clearRegionCache()
void clearRegionCache(byte[] tableName)
tableName
tableName
- Name of the table whose regions we are to remove from
cache.HRegionLocation relocateRegion(byte[] tableName, byte[] row) throws IOException
tableName
- name of the table row is inrow
- row key you're trying to find the region of
IOException
- if a remote or network exception occursHRegionLocation locateRegion(byte[] regionName) throws IOException
regionName
- name of the region to locate
IOException
- if a remote or network exception occursList<HRegionLocation> locateRegions(byte[] tableName) throws IOException
tableName
- table to get regions of
IOException
List<HRegionLocation> locateRegions(byte[] 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
MasterAdminProtocol getMasterAdmin() throws IOException
MasterAdminProtocol
to the active master
IOException
MasterMonitorProtocol getMasterMonitor() throws IOException
MasterMonitorProtocol
to the active master
IOException
@Deprecated AdminProtocol getAdmin(String hostname, int port) throws IOException
hostname
- RegionServer hostnameport
- RegionServer port
IOException
- if a remote or network exception occursAdminProtocol getAdmin(ServerName serverName) throws IOException
serverName
-
IOException
- if a remote or network exception occurs@Deprecated ClientProtocol getClient(String hostname, int port) throws IOException
hostname
- RegionServer hostnameport
- RegionServer port
IOException
- if a remote or network exception occursClientProtocol getClient(ServerName serverName) throws IOException
serverName
-
IOException
- if a remote or network exception occurs@Deprecated AdminProtocol getAdmin(String hostname, int port, boolean getMaster) throws IOException
hostname
- RegionServer hostnameport
- RegionServer portgetMaster
- - do we check if master is alive
IOException
- if a remote or network exception occursAdminProtocol getAdmin(ServerName serverName, boolean getMaster) throws IOException
serverName
- getMaster
- - do we check if master is alive
IOException
- if a remote or network exception occursHRegionLocation getRegionLocation(byte[] 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 <T> T getRegionServerWithRetries(ServerCallable<T> callable) throws IOException, RuntimeException
T
- the type of the return valuecallable
- callable to run
IOException
- if a remote or network exception occurs
RuntimeException
- other unspecified error@Deprecated <T> T getRegionServerWithoutRetries(ServerCallable<T> callable) throws IOException, RuntimeException
T
- the type of the return valuecallable
- callable to run
IOException
- if a remote or network exception occurs
RuntimeException
- other unspecified error@Deprecated void processBatch(List<? extends Row> actions, byte[] tableName, ExecutorService pool, Object[] results) throws IOException, InterruptedException
HTableInterface.batch(java.util.List extends org.apache.hadoop.hbase.client.Row>, java.lang.Object[])
instead
actions
- 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 <R> void processBatchCallback(List<? extends Row> list, byte[] tableName, ExecutorService pool, Object[] results, Batch.Callback<R> callback) throws IOException, InterruptedException
HTableInterface.batchCallback(java.util.List extends org.apache.hadoop.hbase.client.Row>, java.lang.Object[], org.apache.hadoop.hbase.client.coprocessor.Batch.Callback)
instead
Row
implementations.
IOException
InterruptedException
void setRegionCachePrefetch(byte[] tableName, boolean enable)
tableName
- name of table to configure.enable
- Set to true to enable region cache prefetch.boolean getRegionCachePrefetch(byte[] tableName)
tableName
- name of table to check
@Deprecated int getCurrentNrHRS() throws IOException
IOException
- if a remote or network exception occursHTableDescriptor[] getHTableDescriptors(List<String> tableNames) throws IOException
tableNames
- List of table names
IOException
- if a remote or network exception occursboolean isClosed()
void clearCaches(ServerName sn)
sn
sn
- A server nameorg.apache.hadoop.hbase.client.MasterMonitorKeepAliveConnection getKeepAliveMasterMonitor() throws MasterNotRunningException
MasterNotRunningException
org.apache.hadoop.hbase.client.MasterAdminKeepAliveConnection getKeepAliveMasterAdmin() throws MasterNotRunningException
MasterNotRunningException
boolean isDeadServer(ServerName serverName)
serverName
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |