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.限定符和类型 | 字段和说明 |
---|---|
protected Connection |
connection |
protected HRegionLocation |
location |
protected int |
priority |
protected byte[] |
row |
protected TableName |
tableName |
构造器和说明 |
---|
RegionServerCallable(Connection connection,
TableName tableName,
byte[] row) |
RegionServerCallable(Connection connection,
TableName tableName,
byte[] row,
int priority) |
限定符和类型 | 方法和说明 |
---|---|
String |
getExceptionMessageAdditionalDetail() |
HRegionInfo |
getHRegionInfo() |
protected HRegionLocation |
getLocation() |
int |
getPriority() |
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) |
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, wait
call
protected final Connection connection
protected final TableName tableName
protected final byte[] row
protected HRegionLocation location
protected int priority
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 RegionServerCallable(Connection connection, TableName tableName, byte[] row, int priority)
public void prepare(boolean reload) throws IOException
prepare
在接口中 RetryingCallable<T>
reload
- Set to true to re-check the table stateIOException
- eprotected org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService.BlockingInterface getStub()
protected HRegionLocation getLocation()
protected void setLocation(HRegionLocation location)
public TableName getTableName()
public byte[] getRow()
public int getPriority()
public void throwable(Throwable t, boolean retrying)
RetryingCallable
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.).throwable
在接口中 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
在接口中 RetryingCallable<T>
public long sleep(long pause, int tries)
sleep
在接口中 RetryingCallable<T>
public HRegionInfo getHRegionInfo()
Copyright © 2007–2022 The Apache Software Foundation. All rights reserved.