|
||||||||||
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 handles@InterfaceAudience.Public @InterfaceStability.Stable public 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 long |
globalStartTime
|
protected HRegionLocation |
location
|
protected static int |
MIN_RPC_TIMEOUT
|
protected static int |
MIN_WAIT_DEAD_SERVER
|
protected byte[] |
row
|
protected ClientProtocol |
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. |
protected static Throwable |
translateException(Throwable t)
Get the good or the remote exception if any, throws the DoNotRetryIOException. |
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 ClientProtocol server
protected int callTimeout
protected long globalStartTime
protected long startTime
protected long endTime
protected static final int MIN_RPC_TIMEOUT
protected static final int MIN_WAIT_DEAD_SERVER
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 T withRetries() throws IOException, RuntimeException
IOException
- if a remote or network exception occurs
RuntimeException
- other unspecified errorpublic T withoutRetries() throws IOException, RuntimeException
IOException
- if a remote or network exception occurs
RuntimeException
- other unspecified errorprotected static Throwable translateException(Throwable t) throws DoNotRetryIOException
t
- the throwable to analyze
DoNotRetryIOException
- - if we find it, we throw it instead of translating.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |