@InterfaceAudience.Private public class ClientSmallReversedScanner extends ReversedClientScanner
Client scanner for small reversed scan. Generally, only one RPC is called to fetch the scan results, unless the results cross multiple regions or the row count of results exceed the caching.
For small scan, it will get better performance thanReversedClientScanner
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ClientSmallReversedScanner.SmallReversedScannerCallable
A reversed ScannerCallable which supports backward small scanning.
|
protected static class |
ClientSmallReversedScanner.SmallReversedScannerCallableFactory |
Modifier and Type | Field and Description |
---|---|
private ClientSmallReversedScanner.SmallReversedScannerCallableFactory |
callableFactory |
private static org.apache.commons.logging.Log |
LOG |
private ScannerCallableWithReplicas |
smallReversedScanCallable |
cache, caching, callable, caller, closed, conf, currentRegion, lastCellLoadedToCache, lastNext, lastResult, MAX_BYTE_ARRAY, maxScannerResultSize, partialResults, partialResultsRow, pool, primaryOperationTimeout, rpcControllerFactory, scan, scanMetricsPublished, scannerTimeout
scanMetrics
Constructor and Description |
---|
ClientSmallReversedScanner(org.apache.hadoop.conf.Configuration conf,
Scan scan,
TableName tableName,
ClusterConnection connection,
RpcRetryingCallerFactory rpcFactory,
RpcControllerFactory controllerFactory,
ExecutorService pool,
int primaryOperationTimeout)
Create a new ReversibleClientScanner for the specified table.
|
ClientSmallReversedScanner(org.apache.hadoop.conf.Configuration conf,
Scan scan,
TableName tableName,
ClusterConnection connection,
RpcRetryingCallerFactory rpcFactory,
RpcControllerFactory controllerFactory,
ExecutorService pool,
int primaryOperationTimeout,
ClientSmallReversedScanner.SmallReversedScannerCallableFactory callableFactory)
Create a new ReversibleClientScanner for the specified table.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the scanner and releases any resources it has allocated
|
protected void |
initializeScannerInConstruction() |
protected void |
loadCache()
Contact the servers to load more
Result s in the cache. |
Result |
next()
Grab the next row's worth of values.
|
private boolean |
nextScanner(int nbRows,
boolean done,
boolean currentRegionDone)
Gets a scanner for following scan.
|
protected void |
setScannerCallableFactory(ClientSmallReversedScanner.SmallReversedScannerCallableFactory callableFactory) |
checkScanStopRow, getScannerCallable, nextScanner
call, createClosestRowBefore, getCacheSize, getCaching, getConf, getConnection, getMaxResultSize, getPool, getPrimaryOperationTimeout, getResultsToAddToCache, getRetries, getScan, getScannerCallable, getScannerTimeout, getTable, getTableName, getTimestamp, isAnyRPCcancelled, renewLease, updateLastCellLoadedToCache, writeScanMetrics
getScanMetrics, initScanMetrics, iterator, next
private static final org.apache.commons.logging.Log LOG
private ScannerCallableWithReplicas smallReversedScanCallable
private ClientSmallReversedScanner.SmallReversedScannerCallableFactory callableFactory
public ClientSmallReversedScanner(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 rangeGetconnection
- Connection identifying the clusterrpcFactory
- Factory used to create the RpcRetryingCaller
controllerFactory
- Factory used to access RPC payloadspool
- Threadpool for RPC threadsprimaryOperationTimeout
- Call timeoutIOException
- If the remote call failsClientSmallReversedScanner(org.apache.hadoop.conf.Configuration conf, Scan scan, TableName tableName, ClusterConnection connection, RpcRetryingCallerFactory rpcFactory, RpcControllerFactory controllerFactory, ExecutorService pool, int primaryOperationTimeout, ClientSmallReversedScanner.SmallReversedScannerCallableFactory callableFactory) throws IOException
Scan
's start row may be changed.conf
- The Configuration
to use.scan
- Scan
to use in this scannertableName
- The table that we wish to rangeGetconnection
- Connection identifying the clusterrpcFactory
- Factory used to create the RpcRetryingCaller
controllerFactory
- Factory used to access RPC payloadspool
- Threadpool for RPC threadsprimaryOperationTimeout
- Call timeoutcallableFactory
- Factory used to create the ClientSmallScanner.SmallScannerCallable
IOException
- If the remote call failsprivate boolean nextScanner(int nbRows, boolean done, boolean currentRegionDone) throws IOException
nbRows
- done
- true if Server-side says we're done scanning.currentRegionDone
- true if scan is over on current regionIOException
public Result next() throws IOException
ResultScanner
next
in interface ResultScanner
next
in class ClientScanner
IOException
- eprotected void loadCache() throws IOException
ClientScanner
Result
s in the cache.loadCache
in class ClientScanner
IOException
protected void initializeScannerInConstruction() throws IOException
initializeScannerInConstruction
in class ClientScanner
IOException
public void close()
ResultScanner
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ResultScanner
close
in class ClientScanner
protected void setScannerCallableFactory(ClientSmallReversedScanner.SmallReversedScannerCallableFactory callableFactory)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.