@InterfaceAudience.Private public class ClientAsyncPrefetchScanner extends ClientSimpleScanner
prefetchCondition().| Modifier and Type | Class and Description |
|---|---|
private class |
ClientAsyncPrefetchScanner.PrefetchRunnable |
| Modifier and Type | Field and Description |
|---|---|
private AtomicLong |
cacheSizeInBytes |
private Queue<Exception> |
exceptionsQueue |
private Lock |
lock |
private long |
maxCacheSize |
private Condition |
notEmpty |
private Condition |
notFull |
private Thread |
prefetcher |
private Consumer<Boolean> |
prefetchListener |
cache, caching, callable, caller, closed, conf, currentRegion, lastNext, lastResult, maxScannerResultSize, pool, primaryOperationTimeout, rpcControllerFactory, scan, scanMetricsPublished, scannerTimeout, tableNamescanMetrics| Constructor and Description |
|---|
ClientAsyncPrefetchScanner(org.apache.hadoop.conf.Configuration configuration,
Scan scan,
TableName name,
ClusterConnection connection,
RpcRetryingCallerFactory rpcCallerFactory,
RpcControllerFactory rpcControllerFactory,
ExecutorService pool,
int replicaCallTimeoutMicroSecondScan) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEstimatedSize(long estimatedSize) |
void |
close()
Closes the scanner and releases any resources it has allocated
|
private void |
handleException() |
protected void |
initCache() |
Result |
next()
Grab the next row's worth of values.
|
private Result |
pollCache() |
private boolean |
prefetchCondition() |
private long |
resultSize2CacheSize(long maxResultSize) |
(package private) void |
setPrefetchListener(Consumer<Boolean> prefetchListener) |
createScannerCallable, setNewStartKeygetCacheCount, getCacheSize, getCaching, getConf, getConnection, getMaxResultSize, getPool, getPrimaryOperationTimeout, getRetries, getScan, getScannerTimeout, getTable, getTimestamp, initSyncCache, isAnyRPCcancelled, loadCache, moveToNextRegion, nextWithSyncCache, renewLease, writeScanMetricsgetScanMetrics, initScanMetricsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waititerator, nextforEach, spliteratorprivate long maxCacheSize
private AtomicLong cacheSizeInBytes
private Queue<Exception> exceptionsQueue
private Thread prefetcher
private Consumer<Boolean> prefetchListener
public ClientAsyncPrefetchScanner(org.apache.hadoop.conf.Configuration configuration, Scan scan, TableName name, ClusterConnection connection, RpcRetryingCallerFactory rpcCallerFactory, RpcControllerFactory rpcControllerFactory, ExecutorService pool, int replicaCallTimeoutMicroSecondScan) throws IOException
IOExceptionvoid setPrefetchListener(Consumer<Boolean> prefetchListener)
protected void initCache()
initCache in class ClientScannerprivate long resultSize2CacheSize(long maxResultSize)
public Result next() throws IOException
ResultScannernext in interface ResultScannernext in class ClientScannerIOException - epublic void close()
ResultScannerclose in interface Closeableclose in interface AutoCloseableclose in interface ResultScannerclose in class ClientScannerprotected void addEstimatedSize(long estimatedSize)
addEstimatedSize in class ClientScannerprivate void handleException() throws IOException
IOExceptionprivate boolean prefetchCondition()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.