@InterfaceAudience.Private public abstract class ClientScanner extends AbstractClientScanner
Modifier and Type | Field and Description |
---|---|
protected Queue<Result> |
cache |
protected int |
caching |
protected org.apache.hadoop.hbase.client.ScannerCallableWithReplicas |
callable |
protected RpcRetryingCaller<Result[]> |
caller |
protected boolean |
closed |
protected org.apache.hadoop.conf.Configuration |
conf |
protected HRegionInfo |
currentRegion |
protected long |
lastNext |
protected Result |
lastResult |
protected long |
maxScannerResultSize |
protected ExecutorService |
pool |
protected int |
primaryOperationTimeout |
protected RpcControllerFactory |
rpcControllerFactory |
protected Scan |
scan |
protected boolean |
scanMetricsPublished |
protected int |
scannerTimeout |
protected 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 |
---|---|
protected void |
addEstimatedSize(long estimatedHeapSizeOfResult) |
void |
close()
Closes the scanner and releases any resources it has allocated
|
protected abstract ScannerCallable |
createScannerCallable()
Will be called in moveToNextRegion to create ScannerCallable.
|
int |
getCacheCount() |
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 int |
getRetries() |
protected Scan |
getScan() |
protected int |
getScannerTimeout() |
protected TableName |
getTable() |
protected long |
getTimestamp() |
protected void |
initCache() |
protected void |
initSyncCache() |
protected void |
loadCache()
Contact the servers to load more
Result s in the cache. |
protected boolean |
moveToNextRegion()
Close the previous scanner and create a new ScannerCallable for the next scanner.
|
Result |
next()
Grab the next row's worth of values.
|
protected Result |
nextWithSyncCache() |
boolean |
renewLease()
Allow the client to renew the scanner's lease on the server.
|
protected abstract boolean |
setNewStartKey()
Will be called in moveToNextRegion when currentRegion is null.
|
protected void |
writeScanMetrics()
Publish the scan metrics.
|
getScanMetrics, initScanMetrics
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
iterator, next
forEach, spliterator
protected final Scan scan
protected boolean closed
protected HRegionInfo currentRegion
protected org.apache.hadoop.hbase.client.ScannerCallableWithReplicas callable
protected final int caching
protected long lastNext
protected Result lastResult
protected final long maxScannerResultSize
protected 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
protected final ExecutorService pool
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 ClusterConnection getConnection()
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 abstract boolean setNewStartKey()
false
if we have reached the stop row. Otherwise true
.protected abstract ScannerCallable createScannerCallable()
protected boolean moveToNextRegion()
Marked as protected only because TestClientScanner need to override this method.
protected void writeScanMetrics()
Scan.setScanMetricsEnabled(boolean)
protected void initSyncCache()
protected Result nextWithSyncCache() throws IOException
IOException
public int getCacheSize()
protected void loadCache() throws IOException
Result
s in the cache.IOException
protected void addEstimatedSize(long estimatedHeapSizeOfResult)
public int getCacheCount()
public void close()
ResultScanner
public boolean renewLease()
ResultScanner
protected void initCache()
public Result next() throws IOException
ResultScanner
IOException
- eCopyright © 2007–2019 Cloudera. All rights reserved.