Package org.apache.accumulo.core.client
Class ClientSideIteratorScanner
java.lang.Object
org.apache.accumulo.core.clientImpl.ScannerOptions
org.apache.accumulo.core.client.ClientSideIteratorScanner
- All Implemented Interfaces:
- AutoCloseable,- Iterable<Map.Entry<Key,,- Value>> - Scanner,- ScannerBase
public class ClientSideIteratorScanner
extends org.apache.accumulo.core.clientImpl.ScannerOptions
implements Scanner
A scanner that instantiates iterators on the client side instead of on the tablet server. This
 can be useful for testing iterators or in cases where you don't want iterators affecting the
 performance of tablet servers.
 
Suggested usage:
 
 Scanner scanner = client.createScanner(tableName, authorizations);
 scanner = new ClientSideIteratorScanner(scanner);
 
 
 Iterators added to this scanner will be run in the client JVM. Separate scan iterators can be run on the server side and client side by adding iterators to the source scanner (which will execute server side) and to the client side scanner (which will execute client side).
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.accumulo.core.client.ScannerBaseScannerBase.ConsistencyLevel
- 
Field SummaryFields inherited from class org.apache.accumulo.core.clientImpl.ScannerOptionsbatchTimeout, classLoaderContext, executionHints, fetchedColumns, retryTimeout, serverSideIteratorList, serverSideIteratorOptions
- 
Constructor SummaryConstructorsConstructorDescriptionClientSideIteratorScanner(Scanner scanner) Constructs a scanner that can execute client-side iterators.
- 
Method SummaryModifier and TypeMethodDescriptionvoidClear any iterator sampler configuration.voidclose()Closes any underlying connections on the scanner.voidDisables row isolation.voidEnables row isolation.Returns the authorizations that have been set on the scannerintReturns the batch size (number of Key/Value pairs) that will be fetched at a time from a tablet server.getRange()Returns the range of keys to scan over.longThe number of batches of Key/Value pairs returned before theScannerwill begin to prefetch the next batchiterator()Returns an iterator over an accumulo table.voidsetBatchSize(int size) Sets the number of Key/Value pairs that will be fetched at a time from a tablet server.voidThis is provided for the case where no sampler configuration is set on the scanner, but there is a need to create iterator deep copies that have sampling enabled.voidSets the range of keys to scan over.voidsetReadaheadThreshold(long batches) Sets the number of batches of Key/Value pairs returned before theScannerwill begin to prefetch the next batchvoidSets the source Scanner.Methods inherited from class org.apache.accumulo.core.clientImpl.ScannerOptionsaddScanIterator, clearClassLoaderContext, clearColumns, clearSamplerConfiguration, clearScanIterators, fetchColumn, fetchColumn, fetchColumnFamily, getBatchTimeout, getClassLoaderContext, getConsistencyLevel, getFetchedColumns, getSamplerConfiguration, getTimeout, removeScanIterator, setBatchTimeout, setClassLoaderContext, setConsistencyLevel, setExecutionHints, setOptions, setSamplerConfiguration, setTimeout, updateScanIteratorOptionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.apache.accumulo.core.client.ScannerBaseaddScanIterator, clearClassLoaderContext, clearColumns, clearSamplerConfiguration, clearScanIterators, fetchColumn, fetchColumn, fetchColumn, fetchColumnFamily, fetchColumnFamily, forEach, getBatchTimeout, getClassLoaderContext, getConsistencyLevel, getSamplerConfiguration, getTimeout, removeScanIterator, setBatchTimeout, setClassLoaderContext, setConsistencyLevel, setExecutionHints, setSamplerConfiguration, setTimeout, stream, updateScanIteratorOption
- 
Constructor Details- 
ClientSideIteratorScannerConstructs a scanner that can execute client-side iterators.- Parameters:
- scanner- the source scanner
 
 
- 
- 
Method Details- 
setSourceSets the source Scanner.
- 
iteratorDescription copied from interface:ScannerBaseReturns an iterator over an accumulo table. This iterator uses the options that are currently set for its lifetime, so setting options will have no effect on existing iterators.Keys returned by the iterator are not guaranteed to be in sorted order. 
- 
getAuthorizationsDescription copied from interface:ScannerBaseReturns the authorizations that have been set on the scanner- Specified by:
- getAuthorizationsin interface- ScannerBase
- Overrides:
- getAuthorizationsin class- org.apache.accumulo.core.clientImpl.ScannerOptions
- Returns:
- The authorizations set on the scanner instance
 
- 
setRangeDescription copied from interface:ScannerSets the range of keys to scan over.
- 
getRangeDescription copied from interface:ScannerReturns the range of keys to scan over.
- 
setBatchSizepublic void setBatchSize(int size) Description copied from interface:ScannerSets the number of Key/Value pairs that will be fetched at a time from a tablet server.- Specified by:
- setBatchSizein interface- Scanner
- Parameters:
- size- the number of Key/Value pairs to fetch per call to Accumulo
 
- 
getBatchSizepublic int getBatchSize()Description copied from interface:ScannerReturns the batch size (number of Key/Value pairs) that will be fetched at a time from a tablet server.- Specified by:
- getBatchSizein interface- Scanner
- Returns:
- the batch size configured for this scanner
 
- 
enableIsolationpublic void enableIsolation()Description copied from interface:ScannerEnables row isolation. Writes that occur to a row after a scan of that row has begun will not be seen if this option is enabled.- Specified by:
- enableIsolationin interface- Scanner
 
- 
disableIsolationpublic void disableIsolation()Description copied from interface:ScannerDisables row isolation. Writes that occur to a row after a scan of that row has begun may be seen if this option is enabled.- Specified by:
- disableIsolationin interface- Scanner
 
- 
getReadaheadThresholdpublic long getReadaheadThreshold()Description copied from interface:ScannerThe number of batches of Key/Value pairs returned before theScannerwill begin to prefetch the next batch- Specified by:
- getReadaheadThresholdin interface- Scanner
- Returns:
- Number of batches before read-ahead begins
 
- 
setReadaheadThresholdpublic void setReadaheadThreshold(long batches) Description copied from interface:ScannerSets the number of batches of Key/Value pairs returned before theScannerwill begin to prefetch the next batch- Specified by:
- setReadaheadThresholdin interface- Scanner
- Parameters:
- batches- Non-negative number of batches
 
- 
setIteratorSamplerConfigurationThis is provided for the case where no sampler configuration is set on the scanner, but there is a need to create iterator deep copies that have sampling enabled. If sampler configuration is set on the scanner, then this method does not need to be called inorder to create deep copies with sampling.Setting this differently than the scanners sampler configuration may cause exceptions. - Since:
- 1.8.0
 
- 
clearIteratorSamplerConfigurationpublic void clearIteratorSamplerConfiguration()Clear any iterator sampler configuration.- Since:
- 1.8.0
 
- 
getIteratorSamplerConfiguration- Returns:
- currently set iterator sampler configuration.
- Since:
- 1.8.0
 
- 
closepublic void close()Description copied from interface:ScannerBaseCloses any underlying connections on the scanner. This may invalidate any iterators derived from the Scanner, causing them to throw exceptions.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- ScannerBase
- Overrides:
- closein class- org.apache.accumulo.core.clientImpl.ScannerOptions
 
 
-