|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.client.ServerCallable<T>
T
- the class that the ServerCallable handlespublic abstract class ServerCallable<T>
Abstract class that implements Callable
. Implementation stipulates
return type and method we actually invoke on remote Server. Usually
used inside a try/catch that fields usual connection failures all wrapped
up in a retry loop.
Call connect(boolean)
to connect to server hosting region
that contains the passed row in the passed table before invoking
Callable.call()
.
HConnection.getRegionServerWithoutRetries(ServerCallable)
Field Summary | |
---|---|
protected int |
callTimeout
|
protected HConnection |
connection
|
protected long |
endTime
|
protected HRegionLocation |
location
|
protected byte[] |
row
|
protected HRegionInterface |
server
|
protected long |
startTime
|
protected byte[] |
tableName
|
Constructor Summary | |
---|---|
ServerCallable(HConnection connection,
byte[] tableName,
byte[] row)
|
|
ServerCallable(HConnection connection,
byte[] tableName,
byte[] row,
int callTimeout)
|
Method Summary | |
---|---|
void |
afterCall()
|
void |
beforeCall()
|
void |
connect(boolean reload)
Connect to the server hosting region with row from tablename. |
byte[] |
getRegionName()
Deprecated. Just use Object.toString() instead. |
byte[] |
getRow()
Deprecated. Just use Object.toString() instead. |
String |
getServerName()
Deprecated. Just use Object.toString() instead. |
void |
shouldRetry(Throwable throwable)
|
T |
withoutRetries()
Run this instance against the server once. |
T |
withRetries()
Run this instance with retries, timed waits, and refinds of missing regions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.concurrent.Callable |
---|
call |
Field Detail |
---|
protected final HConnection connection
protected final byte[] tableName
protected final byte[] row
protected HRegionLocation location
protected HRegionInterface server
protected int callTimeout
protected long startTime
protected long endTime
Constructor Detail |
---|
public ServerCallable(HConnection connection, byte[] tableName, byte[] row)
connection
- Connection to use.tableName
- Table name to which row
belongs.row
- The row we want in tableName
.public ServerCallable(HConnection connection, byte[] tableName, byte[] row, int callTimeout)
Method Detail |
---|
public void connect(boolean reload) throws IOException
reload
- Set this to true if connection should re-find the region
IOException
- epublic String getServerName()
Object.toString()
instead.
public byte[] getRegionName()
Object.toString()
instead.
public byte[] getRow()
Object.toString()
instead.
public void beforeCall()
public void afterCall()
public void shouldRetry(Throwable throwable) throws IOException
IOException
public T withRetries() throws IOException, RuntimeException
T
- the type of the return value
IOException
- if a remote or network exception occurs
RuntimeException
- other unspecified errorpublic T withoutRetries() throws IOException, RuntimeException
T
- the type of the return value
IOException
- if a remote or network exception occurs
RuntimeException
- other unspecified error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |