|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HConnection
Cluster connection.
HConnectionManager manages instances of this class.
| Method Summary | ||
|---|---|---|
void |
clearRegionCache()
Allows flushing the region cache. |
|
HRegionInterface |
getHRegionConnection(HServerAddress regionServer)
Establishes a connection to the region server at the specified address. |
|
HRegionInterface |
getHRegionConnection(HServerAddress regionServer,
boolean getMaster)
Establishes a connection to the region server at the specified address. |
|
HTableDescriptor |
getHTableDescriptor(byte[] tableName)
|
|
HMasterInterface |
getMaster()
|
|
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)
Pass in a ServerCallable with your particular bit of logic defined and this method will pass it to the defined region server. |
|
|
getRegionServerWithRetries(ServerCallable<T> callable)
Pass in a ServerCallable with your particular bit of logic defined and this method will manage the process of doing retries with timed waits and refinds of missing regions. |
|
ZooKeeperWrapper |
getZooKeeperWrapper()
Retrieve ZooKeeperWrapper used by the connection. |
|
boolean |
isMasterRunning()
|
|
boolean |
isTableAvailable(byte[] tableName)
|
|
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[] tableName,
byte[] row)
Find the location of the region of tableName that row lives in. |
|
void |
prewarmRegionCache(byte[] tableName,
Map<HRegionInfo,HServerAddress> regions)
Load the region map and warm up the global region cache for the table. |
|
int |
processBatchOfDeletes(List<Delete> list,
byte[] tableName)
Process a batch of Deletes. |
|
void |
processBatchOfPuts(List<Put> list,
byte[] tableName,
ExecutorService pool)
|
|
int |
processBatchOfRows(ArrayList<Put> list,
byte[] tableName)
Process a batch of Puts. |
|
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. |
|
boolean |
tableExists(byte[] tableName)
Checks if tableName exists. |
|
| Method Detail |
|---|
ZooKeeperWrapper getZooKeeperWrapper()
throws IOException
IOException - if a remote or network exception occurs
HMasterInterface getMaster()
throws MasterNotRunningException
MasterNotRunningException - if the master is not runningboolean isMasterRunning()
boolean tableExists(byte[] tableName)
throws MasterNotRunningException
tableName exists.
tableName - Table to check.
MasterNotRunningException - if the master is not running
boolean isTableEnabled(byte[] tableName)
throws IOException
tableName - table name
IOException - if a remote or network exception occurs
boolean isTableDisabled(byte[] tableName)
throws IOException
tableName - table name
IOException - if a remote or network exception occurs
boolean isTableAvailable(byte[] tableName)
throws IOException
tableName - table name
IOException - if a remote or network exception occurs
HTableDescriptor[] listTables()
throws IOException
IOException - if a remote or network exception occurs
HTableDescriptor getHTableDescriptor(byte[] tableName)
throws IOException
tableName - table name
IOException - if a remote or network exception occurs
HRegionLocation 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()
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 occurs
HRegionInterface getHRegionConnection(HServerAddress regionServer)
throws IOException
regionServer - - the server to connect to
IOException - if a remote or network exception occurs
HRegionInterface getHRegionConnection(HServerAddress regionServer,
boolean getMaster)
throws IOException
regionServer - - the server to connect togetMaster - - do we check if master is alive
IOException - if a remote or network exception occurs
HRegionLocation 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
<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
<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
int processBatchOfRows(ArrayList<Put> list,
byte[] tableName)
throws IOException
list - A batch of Puts to process.tableName - The name of the table
IOException - if a remote or network exception occurs
int processBatchOfDeletes(List<Delete> list,
byte[] tableName)
throws IOException
list - A batch of Deletes to process.tableName - The name of the table
IOException - if a remote or network exception occurs
void processBatchOfPuts(List<Put> list,
byte[] tableName,
ExecutorService pool)
throws IOException
IOException
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
void prewarmRegionCache(byte[] tableName,
Map<HRegionInfo,HServerAddress> regions)
tableName - name of the table to perform region cache prewarm.regions - a region map.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||