@InterfaceAudience.Private public class ScannerCallable extends ClientServiceCallable<Result[]>
ResultScanner
s made by Table
. Passed to a retrying caller such as
RpcRetryingCaller
so fails are retried.Modifier and Type | Class and Description |
---|---|
(package private) static class |
ScannerCallable.MoreResults |
Modifier and Type | Field and Description |
---|---|
private int |
caching |
protected boolean |
closed |
protected Cursor |
cursor |
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.slf4j.Logger |
LOG |
static String |
LOG_SCANNER_ACTIVITY |
static String |
LOG_SCANNER_LATENCY_CUTOFF |
private int |
logCutOffLatency |
private boolean |
logScannerActivity |
private ScannerCallable.MoreResults |
moreResultsForScan |
private ScannerCallable.MoreResults |
moreResultsInRegion |
private long |
nextCallSeq |
protected boolean |
renew |
protected RpcControllerFactory |
rpcControllerFactory |
protected Scan |
scan |
protected ScanMetrics |
scanMetrics |
protected long |
scannerId |
location, rpcController, stub
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 |
---|---|
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
|
Cursor |
getCursor() |
HRegionInfo |
getHRegionInfo() |
protected Scan |
getScan() |
ScannerCallable |
getScannerCallableForReplica(int id) |
(package private) boolean |
isHeartbeatMessage() |
(package private) ScannerCallable.MoreResults |
moreResultsForScan()
Should the client attempt to fetch more results for the whole scan.
|
(package private) ScannerCallable.MoreResults |
moreResultsInRegion()
Should the client attempt to fetch more results from this region
|
private org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse |
next() |
private org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse |
openScanner() |
void |
prepare(boolean reload)
Prepare by setting up any connections to servers, etc., ahead of call invocation.
|
protected Result[] |
rpcCall()
Run the RPC call.
|
private void |
setAlreadyClosed() |
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
|
private void |
setHeartbeatMessage(boolean heartbeatMessage) |
(package private) void |
setMoreResultsForScan(ScannerCallable.MoreResults moreResults) |
(package private) void |
setMoreResultsInRegion(ScannerCallable.MoreResults moreResults) |
void |
setRenew(boolean val)
Indicate whether we make a call only to renew the lease, but without affected the scanner in
any other way.
|
doGet, doMutate, setStubByServiceName
call, getConnection, getExceptionMessageAdditionalDetail, getLocation, getPriority, getRow, getRpcController, getRpcControllerCellScanner, getStub, getTableName, setLocation, setRpcControllerCellScanner, setStub, sleep, throwable
public static final String LOG_SCANNER_LATENCY_CUTOFF
public static final String LOG_SCANNER_ACTIVITY
public static final org.slf4j.Logger LOG
protected long scannerId
protected boolean instantiated
protected boolean closed
protected boolean renew
private int caching
protected ScanMetrics scanMetrics
private boolean logScannerActivity
private int logCutOffLatency
protected final int id
private ScannerCallable.MoreResults moreResultsInRegion
private ScannerCallable.MoreResults moreResultsForScan
protected boolean heartbeatMessage
ClientProtos.ScanResponse.getHeartbeatMessage()
protected boolean isRegionServerRemote
private long nextCallSeq
protected final RpcControllerFactory rpcControllerFactory
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 replicaIdpublic void prepare(boolean reload) throws IOException
RetryingCallable
prepare
in interface RetryingCallable<Result[]>
prepare
in class RegionServerCallable<Result[],org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface>
reload
- force reload of server locationIOException
protected void checkIfRegionServerIsRemote()
private org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse next() throws IOException
IOException
private void setAlreadyClosed()
protected Result[] rpcCall() throws Exception
RegionServerCallable
rpcCall
in class RegionServerCallable<Result[],org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface>
Exception
boolean isHeartbeatMessage()
private void setHeartbeatMessage(boolean heartbeatMessage)
private void close()
private org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanResponse openScanner() throws IOException
IOException
public void setClose()
public void setRenew(boolean val)
val
- true if only the lease should be renewedpublic HRegionInfo getHRegionInfo()
getHRegionInfo
in class RegionServerCallable<Result[],org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface>
public int getCaching()
public void setCaching(int caching)
caching
- the number of rows for cachingpublic ScannerCallable getScannerCallableForReplica(int id)
ScannerCallable.MoreResults moreResultsInRegion()
void setMoreResultsInRegion(ScannerCallable.MoreResults moreResults)
ScannerCallable.MoreResults moreResultsForScan()
void setMoreResultsForScan(ScannerCallable.MoreResults moreResults)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.