@InterfaceAudience.Private public class ScannerCallable extends RegionServerCallable<Result[]>
ResultScanner
s made by HTable
. Passed to a retrying caller such as
RpcRetryingCaller
so fails are retried.Modifier and Type | Field and Description |
---|---|
private int |
caching |
protected ClusterConnection |
cConnection |
protected boolean |
closed |
protected PayloadCarryingRpcController |
controller |
protected RpcControllerFactory |
controllerFactory |
protected boolean |
heartbeatMessage
Saves whether or not the most recent response from the server was a heartbeat message.
|
protected int |
id |
protected boolean |
instantiated |
protected boolean |
isRegionServerRemote |
static org.apache.commons.logging.Log |
LOG |
static String |
LOG_SCANNER_ACTIVITY |
static String |
LOG_SCANNER_LATENCY_CUTOFF |
private int |
logCutOffLatency |
private boolean |
logScannerActivity |
private static String |
myAddress |
private long |
nextCallSeq |
protected boolean |
renew |
private Scan |
scan |
protected ScanMetrics |
scanMetrics |
protected long |
scannerId |
protected boolean |
serverHasMoreResults |
protected boolean |
serverHasMoreResultsContext |
connection, location, row, tableName
Constructor and Description |
---|
ScannerCallable(ClusterConnection connection,
TableName tableName,
Scan scan,
ScanMetrics scanMetrics,
RpcControllerFactory rpcControllerFactory) |
ScannerCallable(ClusterConnection connection,
TableName tableName,
Scan scan,
ScanMetrics scanMetrics,
RpcControllerFactory rpcControllerFactory,
int id) |
Modifier and Type | Method and Description |
---|---|
Result[] |
call(int callTimeout)
Computes a result, or throws an exception if unable to do so.
|
protected void |
checkIfRegionServerIsRemote()
compare the local machine hostname with region server's hostname
to decide if hbase client connects to a remote region server
|
private void |
close() |
int |
getCaching()
Get the number of rows that will be fetched on next
|
ClusterConnection |
getConnection() |
(package private) PayloadCarryingRpcController |
getController() |
HRegionInfo |
getHRegionInfo() |
protected Scan |
getScan() |
ScannerCallable |
getScannerCallableForReplica(int id) |
protected boolean |
getServerHasMoreResults()
Should the client attempt to fetch more results from this region
|
protected boolean |
hasMoreResultsContext()
Did the server respond with information about whether more results might exist.
|
private void |
incRPCcallsMetrics() |
protected boolean |
isHeartbeatMessage() |
protected long |
openScanner() |
void |
prepare(boolean reload)
Prepare for connection to the server hosting region with row from tablename.
|
void |
setCaching(int caching)
Set the number of rows that will be fetched on next
|
void |
setClose()
Call this when the next invocation of call should close the scanner
|
protected void |
setHasMoreResultsContext(boolean serverHasMoreResultsContext) |
protected void |
setHeartbeatMessage(boolean heartbeatMessage) |
void |
setRenew(boolean val)
Indicate whether we make a call only to renew the lease, but without affected the scanner in
any other way.
|
protected void |
setServerHasMoreResults(boolean serverHasMoreResults) |
protected void |
updateResultsMetrics(Result[] rrs) |
private void |
updateServerSideMetrics(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanResponse response)
Use the scan metrics returned by the server to add to the identically named counters in the
client side metrics.
|
getExceptionMessageAdditionalDetail, getLocation, getRow, getStub, getTableName, setLocation, setStub, sleep, throwable
public static final String LOG_SCANNER_LATENCY_CUTOFF
public static final String LOG_SCANNER_ACTIVITY
public static final org.apache.commons.logging.Log LOG
protected long scannerId
protected boolean instantiated
protected boolean closed
protected boolean renew
private Scan scan
private int caching
protected final ClusterConnection cConnection
protected ScanMetrics scanMetrics
private boolean logScannerActivity
private int logCutOffLatency
private static String myAddress
protected final int id
protected boolean serverHasMoreResultsContext
protected boolean serverHasMoreResults
protected boolean heartbeatMessage
ClientProtos.ScanResponse.getHeartbeatMessage()
protected boolean isRegionServerRemote
private long nextCallSeq
protected RpcControllerFactory controllerFactory
protected PayloadCarryingRpcController controller
public ScannerCallable(ClusterConnection connection, TableName tableName, Scan scan, ScanMetrics scanMetrics, RpcControllerFactory rpcControllerFactory)
connection
- which connectiontableName
- table callable is onscan
- the scan to executescanMetrics
- the ScanMetrics to used, if it is null,
ScannerCallable won't collect metricsrpcControllerFactory
- factory to use when creating
RpcController
public ScannerCallable(ClusterConnection connection, TableName tableName, Scan scan, ScanMetrics scanMetrics, RpcControllerFactory rpcControllerFactory, int id)
connection
- tableName
- scan
- scanMetrics
- id
- the replicaIdPayloadCarryingRpcController getController()
public void prepare(boolean reload) throws IOException
RegionServerCallable
prepare
in interface RetryingCallable<Result[]>
prepare
in class RegionServerCallable<Result[]>
reload
- force reload of server locationIOException
protected void checkIfRegionServerIsRemote()
public Result[] call(int callTimeout) throws IOException
RetryingCallable
callTimeout
- - the time available for this call. 0 for infinite.IOException
protected boolean isHeartbeatMessage()
protected void setHeartbeatMessage(boolean heartbeatMessage)
private void incRPCcallsMetrics()
protected void updateResultsMetrics(Result[] rrs)
private void updateServerSideMetrics(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanResponse response)
response
- private void close()
protected long openScanner() throws IOException
IOException
protected Scan getScan()
public void setClose()
public void setRenew(boolean val)
val
- true if only the lease should be renewedpublic HRegionInfo getHRegionInfo()
getHRegionInfo
in class RegionServerCallable<Result[]>
public int getCaching()
public ClusterConnection getConnection()
getConnection
in class RegionServerCallable<Result[]>
HConnection
instance used by this Callable.public void setCaching(int caching)
caching
- the number of rows for cachingpublic ScannerCallable getScannerCallableForReplica(int id)
protected boolean getServerHasMoreResults()
protected void setServerHasMoreResults(boolean serverHasMoreResults)
protected boolean hasMoreResultsContext()
protected void setHasMoreResultsContext(boolean serverHasMoreResultsContext)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.