org.apache.hadoop.hbase.client
Class ScannerCallable

java.lang.Object
  extended by org.apache.hadoop.hbase.client.RegionServerCallable<Result[]>
      extended by org.apache.hadoop.hbase.client.ScannerCallable
All Implemented Interfaces:
Callable<Result[]>, RetryingCallable<Result[]>
Direct Known Subclasses:
ReversedScannerCallable

@InterfaceAudience.Private
public class ScannerCallable
extends RegionServerCallable<Result[]>

Scanner operations such as create, next, etc. Used by ResultScanners made by HTable. Passed to a retrying caller such as RpcRetryingCaller so fails are retried.


Field Summary
protected  boolean closed
           
protected  PayloadCarryingRpcController controller
           
protected  boolean instantiated
           
protected  boolean isRegionServerRemote
           
static org.apache.commons.logging.Log LOG
           
static String LOG_SCANNER_ACTIVITY
           
static String LOG_SCANNER_LATENCY_CUTOFF
           
protected  boolean renew
           
protected  ScanMetrics scanMetrics
           
 
Fields inherited from class org.apache.hadoop.hbase.client.RegionServerCallable
connection, location, MIN_WAIT_DEAD_SERVER, row, serverHasMoreResults, serverHasMoreResultsContext, tableName
 
Constructor Summary
ScannerCallable(HConnection connection, byte[] tableName, Scan scan, ScanMetrics scanMetrics)
          Deprecated. Use ScannerCallable(HConnection, TableName, Scan, ScanMetrics, PayloadCarryingRpcController)
ScannerCallable(HConnection connection, TableName tableName, Scan scan, ScanMetrics scanMetrics, PayloadCarryingRpcController controller)
           
 
Method Summary
 Result[] call()
           
protected  void checkIfRegionServerIsRemote()
          compare the local machine hostname with region server's hostname to decide if hbase client connects to a remote region server
 int getCaching()
          Get the number of rows that will be fetched on next
 HRegionInfo getHRegionInfo()
           
protected  Scan getScan()
           
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
 void setRenew(boolean val)
           
protected  void updateResultsMetrics(Result[] rrs)
           
 
Methods inherited from class org.apache.hadoop.hbase.client.RegionServerCallable
getExceptionMessageAdditionalDetail, getLocation, getRow, getServerHasMoreResults, getStub, getTableName, hasMoreResultsContext, setHasMoreResultsContext, setLocation, setServerHasMoreResults, sleep, throwable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_SCANNER_LATENCY_CUTOFF

public static final String LOG_SCANNER_LATENCY_CUTOFF
See Also:
Constant Field Values

LOG_SCANNER_ACTIVITY

public static final String LOG_SCANNER_ACTIVITY
See Also:
Constant Field Values

LOG

public static final org.apache.commons.logging.Log LOG

instantiated

protected boolean instantiated

closed

protected boolean closed

renew

protected boolean renew

scanMetrics

protected ScanMetrics scanMetrics

isRegionServerRemote

protected boolean isRegionServerRemote

controller

protected final PayloadCarryingRpcController controller
Constructor Detail

ScannerCallable

public ScannerCallable(HConnection connection,
                       TableName tableName,
                       Scan scan,
                       ScanMetrics scanMetrics,
                       PayloadCarryingRpcController controller)
Parameters:
connection - which connection
tableName - table callable is on
scan - the scan to execute
scanMetrics - the ScanMetrics to used, if it is null, ScannerCallable won't collect metrics
controller - to use when writing the rpc

ScannerCallable

@Deprecated
public ScannerCallable(HConnection connection,
                                  byte[] tableName,
                                  Scan scan,
                                  ScanMetrics scanMetrics)
Deprecated. Use ScannerCallable(HConnection, TableName, Scan, ScanMetrics, PayloadCarryingRpcController)

Method Detail

prepare

public void prepare(boolean reload)
             throws IOException
Description copied from class: RegionServerCallable
Prepare for connection to the server hosting region with row from tablename. Does lookup to find region location and hosting server.

Specified by:
prepare in interface RetryingCallable<Result[]>
Overrides:
prepare in class RegionServerCallable<Result[]>
Parameters:
reload - force reload of server location
Throws:
IOException

checkIfRegionServerIsRemote

protected void checkIfRegionServerIsRemote()
compare the local machine hostname with region server's hostname to decide if hbase client connects to a remote region server


call

public Result[] call()
              throws IOException
Throws:
IOException
See Also:
Callable.call()

updateResultsMetrics

protected void updateResultsMetrics(Result[] rrs)

openScanner

protected long openScanner()
                    throws IOException
Throws:
IOException

getScan

protected Scan getScan()

setClose

public void setClose()
Call this when the next invocation of call should close the scanner


setRenew

public void setRenew(boolean val)

getHRegionInfo

public HRegionInfo getHRegionInfo()
Overrides:
getHRegionInfo in class RegionServerCallable<Result[]>
Returns:
the HRegionInfo for the current region

getCaching

public int getCaching()
Get the number of rows that will be fetched on next

Returns:
the number of rows for caching

setCaching

public void setCaching(int caching)
Set the number of rows that will be fetched on next

Parameters:
caching - the number of rows for caching


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.