@InterfaceAudience.Private public class ClientScanner extends AbstractClientScanner
Modifier and Type | Field and Description |
---|---|
protected LinkedList<Result> |
cache |
protected int |
caching |
protected ScannerCallableWithReplicas |
callable |
protected RpcRetryingCaller<Result[]> |
caller |
protected boolean |
closed |
protected org.apache.hadoop.conf.Configuration |
conf |
private ClusterConnection |
connection |
protected HRegionInfo |
currentRegion |
protected Cell |
lastCellLoadedToCache
The last cell from a not full Row which is added to cache
|
protected long |
lastNext |
protected Result |
lastResult |
private static org.apache.commons.logging.Log |
LOG |
(package private) static byte[] |
MAX_BYTE_ARRAY |
protected long |
maxScannerResultSize |
private static KeyValue.MetaComparator |
metaComparator |
protected LinkedList<Result> |
partialResults
A list of partial results that have been returned from the server.
|
protected byte[] |
partialResultsRow
The row for which we are accumulating partial Results (i.e.
|
protected ExecutorService |
pool |
protected int |
primaryOperationTimeout |
private int |
retries |
protected RpcControllerFactory |
rpcControllerFactory |
protected Scan |
scan |
protected boolean |
scanMetricsPublished |
protected int |
scannerTimeout |
private TableName |
tableName |
scanMetrics
Constructor and Description |
---|
ClientScanner(org.apache.hadoop.conf.Configuration conf,
Scan scan,
TableName tableName,
ClusterConnection connection,
RpcRetryingCallerFactory rpcFactory,
RpcControllerFactory controllerFactory,
ExecutorService pool,
int primaryOperationTimeout)
Create a new ClientScanner for the specified table Note that the passed
Scan 's start
row maybe changed changed. |
Modifier and Type | Method and Description |
---|---|
private void |
addResultsToList(List<Result> outputList,
Result[] inputArray,
int start,
int end)
Helper method for adding results between the indices [start, end) to the outputList
|
private void |
addToPartialResults(Result result)
A convenience method for adding a Result to our list of partials.
|
(package private) Result[] |
call(ScannerCallableWithReplicas callable,
RpcRetryingCaller<Result[]> caller,
int scannerTimeout) |
protected boolean |
checkScanStopRow(byte[] endKey) |
private void |
clearPartialResults()
Convenience method for clearing the list of partials and resetting the partialResultsRow.
|
void |
close()
Closes the scanner and releases any resources it has allocated
|
private int |
compare(Cell a,
Cell b)
Compare two Cells considering reversed scanner.
|
protected static byte[] |
createClosestRowBefore(byte[] row)
Create the closest row before the specified row
|
private boolean |
doneWithRegion(long remainingResultSize,
int remainingRows,
boolean regionHasMoreResults) |
private Result |
filterLoadedCell(Result result) |
int |
getCacheSize() |
protected int |
getCaching() |
protected org.apache.hadoop.conf.Configuration |
getConf() |
protected ClusterConnection |
getConnection() |
protected long |
getMaxResultSize() |
protected ExecutorService |
getPool() |
protected int |
getPrimaryOperationTimeout() |
protected List<Result> |
getResultsToAddToCache(Result[] resultsFromServer,
boolean heartbeatMessage)
This method ensures all of our book keeping regarding partial results is kept up to date.
|
protected int |
getRetries() |
protected Scan |
getScan() |
protected ScannerCallableWithReplicas |
getScannerCallable(byte[] localStartKey,
int nbRows) |
protected int |
getScannerTimeout() |
protected TableName |
getTable() |
protected byte[] |
getTableName()
Deprecated.
As of release 0.96
(HBASE-9508).
This will be removed in HBase 2.0.0. Use
getTable() . |
protected long |
getTimestamp() |
protected void |
initializeScannerInConstruction() |
(package private) boolean |
isAnyRPCcancelled() |
protected void |
loadCache()
Contact the servers to load more
Result s in the cache. |
Result |
next()
Grab the next row's worth of values.
|
protected boolean |
nextScanner(int nbRows,
boolean done) |
private boolean |
possiblyNextScanner(int nbRows,
boolean done) |
boolean |
renewLease()
Allow the client to renew the scanner's lease on the server.
|
protected void |
updateLastCellLoadedToCache(Result result) |
protected void |
writeScanMetrics()
Publish the scan metrics.
|
getScanMetrics, initScanMetrics, iterator, next
private static final org.apache.commons.logging.Log LOG
static byte[] MAX_BYTE_ARRAY
protected Scan scan
protected boolean closed
protected HRegionInfo currentRegion
protected ScannerCallableWithReplicas callable
protected final LinkedList<Result> cache
protected final LinkedList<Result> partialResults
protected byte[] partialResultsRow
addToPartialResults(Result)
and clearPartialResults()
protected Cell lastCellLoadedToCache
protected final int caching
protected long lastNext
protected Result lastResult
protected final long maxScannerResultSize
private final ClusterConnection connection
private final TableName tableName
protected final int scannerTimeout
protected boolean scanMetricsPublished
protected RpcRetryingCaller<Result[]> caller
protected RpcControllerFactory rpcControllerFactory
protected org.apache.hadoop.conf.Configuration conf
protected final int primaryOperationTimeout
private int retries
protected final ExecutorService pool
private static KeyValue.MetaComparator metaComparator
public ClientScanner(org.apache.hadoop.conf.Configuration conf, Scan scan, TableName tableName, ClusterConnection connection, RpcRetryingCallerFactory rpcFactory, RpcControllerFactory controllerFactory, ExecutorService pool, int primaryOperationTimeout) throws IOException
Scan
's start
row maybe changed changed.conf
- The Configuration
to use.scan
- Scan
to use in this scannertableName
- The table that we wish to scanconnection
- Connection identifying the clusterIOException
protected void initializeScannerInConstruction() throws IOException
IOException
protected ClusterConnection getConnection()
@Deprecated protected byte[] getTableName()
protected TableName getTable()
protected int getRetries()
protected int getScannerTimeout()
protected org.apache.hadoop.conf.Configuration getConf()
protected Scan getScan()
protected ExecutorService getPool()
protected int getPrimaryOperationTimeout()
protected int getCaching()
protected long getTimestamp()
protected long getMaxResultSize()
protected boolean checkScanStopRow(byte[] endKey)
private boolean possiblyNextScanner(int nbRows, boolean done) throws IOException
IOException
protected boolean nextScanner(int nbRows, boolean done) throws IOException
IOException
boolean isAnyRPCcancelled()
Result[] call(ScannerCallableWithReplicas callable, RpcRetryingCaller<Result[]> caller, int scannerTimeout) throws IOException, RuntimeException
IOException
RuntimeException
@InterfaceAudience.Private protected ScannerCallableWithReplicas getScannerCallable(byte[] localStartKey, int nbRows)
protected void writeScanMetrics()
Scan.setScanMetricsEnabled(boolean)
This invocation clears the scan metrics. Metrics are aggregated in the Scan instance.
public Result next() throws IOException
ResultScanner
IOException
- epublic int getCacheSize()
protected void loadCache() throws IOException
Result
s in the cache.IOException
private boolean doneWithRegion(long remainingResultSize, int remainingRows, boolean regionHasMoreResults)
remainingResultSize
- remainingRows
- regionHasMoreResults
- protected List<Result> getResultsToAddToCache(Result[] resultsFromServer, boolean heartbeatMessage) throws IOException
resultsFromServer
- The array of Result
s returned from the serverheartbeatMessage
- Flag indicating whether or not the response received from the server
represented a complete response, or a heartbeat message that was sent to keep the
client-server connection aliveIOException
private void addToPartialResults(Result result) throws IOException
result
- The result that we want to add to our list of partial ResultsIOException
private void clearPartialResults()
private void addResultsToList(List<Result> outputList, Result[] inputArray, int start, int end)
outputList
- the list that results will be added toinputArray
- the array that results are taken fromstart
- beginning index (inclusive)end
- ending index (exclusive)public void close()
ResultScanner
protected static byte[] createClosestRowBefore(byte[] row)
row
- public boolean renewLease()
AbstractClientScanner
renewLease
in class AbstractClientScanner
protected void updateLastCellLoadedToCache(Result result)
private int compare(Cell a, Cell b)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.