T - the class that the ServerCallable handles@InterfaceAudience.Private public abstract class RegionServerCallable<T> extends Object implements RetryingCallable<T>
RetryingCallable.call(int).
Passed to a RpcRetryingCaller so we retry on fail.
TODO: this class is actually tied to one region, because most of the paths make use of
the regioninfo part of location when building requests. The only reason it works for
multi-region requests (e.g. batch) is that they happen to not use the region parts.
This could be done cleaner (e.g. having a generic parameter and 2 derived classes,
RegionCallable and actual RegionServerCallable with ServerName.| Modifier and Type | Field and Description |
|---|---|
protected Connection |
connection |
protected HRegionLocation |
location |
private static org.apache.commons.logging.Log |
LOG |
protected byte[] |
row |
private org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface |
stub |
protected TableName |
tableName |
| Constructor and Description |
|---|
RegionServerCallable(Connection connection,
TableName tableName,
byte[] row) |
| Modifier and Type | Method and Description |
|---|---|
(package private) HConnection |
getConnection() |
String |
getExceptionMessageAdditionalDetail() |
HRegionInfo |
getHRegionInfo() |
protected HRegionLocation |
getLocation() |
byte[] |
getRow() |
protected org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface |
getStub() |
TableName |
getTableName() |
void |
prepare(boolean reload)
Prepare for connection to the server hosting region with row from tablename.
|
protected void |
setLocation(HRegionLocation location) |
(package private) void |
setStub(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface stub) |
long |
sleep(long pause,
int tries) |
void |
throwable(Throwable t,
boolean retrying)
Called when
RetryingCallable.call(int) throws an exception and we are going to retry; take action to
make it so we succeed on next call (clear caches, do relookup of locations, etc.). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcallprivate static final org.apache.commons.logging.Log LOG
protected final Connection connection
protected final TableName tableName
protected final byte[] row
protected HRegionLocation location
private org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface stub
public RegionServerCallable(Connection connection, TableName tableName, byte[] row)
connection - Connection to use.tableName - Table name to which row belongs.row - The row we want in tableName.public void prepare(boolean reload)
throws IOException
prepare in interface RetryingCallable<T>reload - Set this to true if connection should re-find the regionIOException - eHConnection getConnection()
HConnection instance used by this Callable.protected org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface getStub()
void setStub(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface stub)
protected HRegionLocation getLocation()
protected void setLocation(HRegionLocation location)
public TableName getTableName()
public byte[] getRow()
public void throwable(Throwable t, boolean retrying)
RetryingCallableRetryingCallable.call(int) throws an exception and we are going to retry; take action to
make it so we succeed on next call (clear caches, do relookup of locations, etc.).throwable in interface RetryingCallable<T>retrying - True if we are in retrying mode (we are not in retrying mode when max
retries == 1; we ARE in retrying mode if retries > 1 even when we are the last attempt)public String getExceptionMessageAdditionalDetail()
getExceptionMessageAdditionalDetail in interface RetryingCallable<T>public long sleep(long pause,
int tries)
sleep in interface RetryingCallable<T>public HRegionInfo getHRegionInfo()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.