org.apache.accumulo.core.client.impl
Class ScannerOptions

java.lang.Object
  extended by org.apache.accumulo.core.client.impl.ScannerOptions
All Implemented Interfaces:
Iterable<Map.Entry<Key,Value>>, ScannerBase
Direct Known Subclasses:
ClientSideIteratorScanner, IsolatedScanner, MockScannerBase, OfflineScanner, ScannerImpl, TabletServerBatchReader

public class ScannerOptions
extends Object
implements ScannerBase


Field Summary
protected  SortedSet<Column> fetchedColumns
           
protected  List<IterInfo> serverSideIteratorList
           
protected  Map<String,Map<String,String>> serverSideIteratorOptions
           
protected  long timeOut
           
 
Constructor Summary
protected ScannerOptions()
           
  ScannerOptions(ScannerOptions so)
           
 
Method Summary
 void addScanIterator(IteratorSetting si)
          Adds server-side scan iterators.
 void clearColumns()
          Clears the columns to be fetched (useful for resetting the scanner for reuse).
 void clearScanIterators()
          Clears scan iterators prior to returning a scanner to the pool.
 void close()
          Closes any underlying connections on the scanner
 void fetchColumn(Column column)
           
 void fetchColumn(org.apache.hadoop.io.Text colFam, org.apache.hadoop.io.Text colQual)
          Adds a column to the list of columns that will be fetched by this scanner.
 void fetchColumnFamily(org.apache.hadoop.io.Text col)
          Limit a scan to the specified column family.
 SortedSet<Column> getFetchedColumns()
           
 long getTimeout(TimeUnit timeunit)
          Returns the setting for how long a scanner will automatically retry when a failure occurs.
 Iterator<Map.Entry<Key,Value>> iterator()
          Returns an iterator over an accumulo table.
 void removeScanIterator(String iteratorName)
          Remove an iterator from the list of iterators.
protected static void setOptions(ScannerOptions dst, ScannerOptions src)
           
 void setTimeout(long timeout, TimeUnit timeUnit)
          This setting determines how long a scanner will automatically retry when a failure occurs.
 void updateScanIteratorOption(String iteratorName, String key, String value)
          Override any existing options on the given named iterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverSideIteratorList

protected List<IterInfo> serverSideIteratorList

serverSideIteratorOptions

protected Map<String,Map<String,String>> serverSideIteratorOptions

fetchedColumns

protected SortedSet<Column> fetchedColumns

timeOut

protected long timeOut
Constructor Detail

ScannerOptions

protected ScannerOptions()

ScannerOptions

public ScannerOptions(ScannerOptions so)
Method Detail

addScanIterator

public void addScanIterator(IteratorSetting si)
Adds server-side scan iterators.

Specified by:
addScanIterator in interface ScannerBase
Parameters:
si - fully specified scan-time iterator, including all options for the iterator. Any changes to the iterator setting after this call are not propagated to the stored iterator.

removeScanIterator

public void removeScanIterator(String iteratorName)
Description copied from interface: ScannerBase
Remove an iterator from the list of iterators.

Specified by:
removeScanIterator in interface ScannerBase
Parameters:
iteratorName - nickname used for the iterator

updateScanIteratorOption

public void updateScanIteratorOption(String iteratorName,
                                     String key,
                                     String value)
Override any existing options on the given named iterator

Specified by:
updateScanIteratorOption in interface ScannerBase
Parameters:
iteratorName - the name of the iterator to change
key - the name of the option
value - the new value for the named option

fetchColumnFamily

public void fetchColumnFamily(org.apache.hadoop.io.Text col)
Limit a scan to the specified column family. This can limit which locality groups are read on the server side. To fetch multiple column families call this function multiple times.

Specified by:
fetchColumnFamily in interface ScannerBase
Parameters:
col - the column family to be fetched

fetchColumn

public void fetchColumn(org.apache.hadoop.io.Text colFam,
                        org.apache.hadoop.io.Text colQual)
Description copied from interface: ScannerBase
Adds a column to the list of columns that will be fetched by this scanner. The column is identified by family and qualifier. By default when no columns have been added the scanner fetches all columns.

Specified by:
fetchColumn in interface ScannerBase
Parameters:
colFam - the column family of the column to be fetched
colQual - the column qualifier of the column to be fetched

fetchColumn

public void fetchColumn(Column column)

clearColumns

public void clearColumns()
Description copied from interface: ScannerBase
Clears the columns to be fetched (useful for resetting the scanner for reuse). Once cleared, the scanner will fetch all columns.

Specified by:
clearColumns in interface ScannerBase

getFetchedColumns

public SortedSet<Column> getFetchedColumns()

clearScanIterators

public void clearScanIterators()
Clears scan iterators prior to returning a scanner to the pool.

Specified by:
clearScanIterators in interface ScannerBase

setOptions

protected static void setOptions(ScannerOptions dst,
                                 ScannerOptions src)

iterator

public Iterator<Map.Entry<Key,Value>> iterator()
Description copied from interface: ScannerBase
Returns 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.

Specified by:
iterator in interface Iterable<Map.Entry<Key,Value>>
Specified by:
iterator in interface ScannerBase
Returns:
an iterator over Key,Value pairs which meet the restrictions set on the scanner

setTimeout

public void setTimeout(long timeout,
                       TimeUnit timeUnit)
Description copied from interface: ScannerBase
This setting determines how long a scanner will automatically retry when a failure occurs. By default a scanner will retry forever. Setting to zero or Long.MAX_VALUE and TimeUnit.MILLISECONDS means to retry forever.

Specified by:
setTimeout in interface ScannerBase
timeUnit - determines how timeout is interpreted

getTimeout

public long getTimeout(TimeUnit timeunit)
Description copied from interface: ScannerBase
Returns the setting for how long a scanner will automatically retry when a failure occurs.

Specified by:
getTimeout in interface ScannerBase
Returns:
the timeout configured for this scanner

close

public void close()
Description copied from interface: ScannerBase
Closes any underlying connections on the scanner

Specified by:
close in interface ScannerBase


Copyright © 2013 Apache Accumulo Project. All Rights Reserved.