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
           
 
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 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()
           
 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.
 void setColumnFamilyRegex(String regex)
          Deprecated. since 1.4, useaddScanIterator(IteratorSetting)
 void setColumnQualifierRegex(String regex)
          Deprecated. since 1.4, use addScanIterator(IteratorSetting)
protected static void setOptions(ScannerOptions dst, ScannerOptions src)
           
 void setRowRegex(String regex)
          Deprecated. since 1.4, use addScanIterator(IteratorSetting)
 void setScanIteratorOption(String iteratorName, String key, String value)
          Deprecated. since 1.4, use updateScanIteratorOption(String, String, String)
 void setScanIterators(int priority, String iteratorClass, String iteratorName)
          Deprecated. since 1.4, use addScanIterator(IteratorSetting)
 void setupRegex(String iteratorName, int iteratorPriority)
          Deprecated. since 1.4, use addScanIterator(IteratorSetting)
 void setValueRegex(String regex)
          Deprecated. since 1.4, use addScanIterator(IteratorSetting)
 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
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

setScanIterators

public void setScanIterators(int priority,
                             String iteratorClass,
                             String iteratorName)
Deprecated. since 1.4, use addScanIterator(IteratorSetting)

Specified by:
setScanIterators in interface ScannerBase

setScanIteratorOption

public void setScanIteratorOption(String iteratorName,
                                  String key,
                                  String value)
Deprecated. since 1.4, use updateScanIteratorOption(String, String, String)

Specified by:
setScanIteratorOption in interface ScannerBase

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

setupRegex

public void setupRegex(String iteratorName,
                       int iteratorPriority)
                throws IOException
Deprecated. since 1.4, use addScanIterator(IteratorSetting)

Must call this method to initialize regular expresions on a scanner.

Specified by:
setupRegex in interface ScannerBase
Parameters:
iteratorName - a nickname for the iterator
iteratorPriority - determines the order in which iterators are applied (system iterators are always applied first, then per-table and scan-time, lowest first)
Throws:
IOException - if an exception occurs reading from the iterator stack
See Also:
RegExFilter

setRowRegex

public void setRowRegex(String regex)
Deprecated. since 1.4, use addScanIterator(IteratorSetting)

Set a row regular expression that filters non matching entries server side.

Specified by:
setRowRegex in interface ScannerBase
Parameters:
regex - java regular expression to match
See Also:
RegExFilter

setColumnFamilyRegex

public void setColumnFamilyRegex(String regex)
Deprecated. since 1.4, useaddScanIterator(IteratorSetting)

Set a column family regular expression that filters non matching entries server side.

Specified by:
setColumnFamilyRegex in interface ScannerBase
Parameters:
regex - java regular expression to match
See Also:
RegExFilter

setColumnQualifierRegex

public void setColumnQualifierRegex(String regex)
Deprecated. since 1.4, use addScanIterator(IteratorSetting)

Set a column qualifier regular expression that filters non matching entries server side.

Specified by:
setColumnQualifierRegex in interface ScannerBase
Parameters:
regex - java regular expression to match
See Also:
RegExFilter

setValueRegex

public void setValueRegex(String regex)
Deprecated. since 1.4, use addScanIterator(IteratorSetting)

Set a value regular expression that filters non matching entries server side.

Specified by:
setValueRegex in interface ScannerBase
Parameters:
regex - java regular expression to match
See Also:
RegExFilter

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


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.