@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 Consumer<Boolean> |
prefetchListener |
cache, caching, callable, caller, closed, conf, currentRegion, lastNext, lastResult, maxScannerResultSize, pool, primaryOperationTimeout, readRpcTimeout, rpcControllerFactory, scan, scanMetricsPublished, scannerTimeout, span, tableName
scanMetrics
Constructor and Description |
---|
ClientAsyncPrefetchScanner(org.apache.hadoop.conf.Configuration configuration,
Scan scan,
TableName name,
ClusterConnection connection,
RpcRetryingCallerFactory rpcCallerFactory,
RpcControllerFactory rpcControllerFactory,
ExecutorService pool,
int scanReadRpcTimeout,
int scannerTimeout,
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, setNewStartKey
getCacheCount, getCacheSize, getCaching, getConf, getConnection, getMaxResultSize, getPool, getPrimaryOperationTimeout, getRetries, getScan, getScannerTimeout, getScanReplicaId, getTable, getTimestamp, initSyncCache, isAnyRPCcancelled, loadCache, moveToNextRegion, nextWithSyncCache, renewLease, writeScanMetrics
getScanMetrics, initScanMetrics
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
iterator, next
forEach, spliterator
private long maxCacheSize
private AtomicLong cacheSizeInBytes
private final Queue<Exception> exceptionsQueue
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 scanReadRpcTimeout, int scannerTimeout, int replicaCallTimeoutMicroSecondScan) throws IOException
IOException
void setPrefetchListener(Consumer<Boolean> prefetchListener)
protected void initCache()
initCache
in class ClientScanner
private long resultSize2CacheSize(long maxResultSize)
public Result next() throws IOException
ResultScanner
next
in interface ResultScanner
next
in class ClientScanner
IOException
- epublic void close()
ResultScanner
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ResultScanner
close
in class ClientScanner
protected void addEstimatedSize(long estimatedSize)
addEstimatedSize
in class ClientScanner
private void handleException() throws IOException
IOException
private boolean prefetchCondition()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.