org.apache.accumulo.core.client
Interface ScannerBase

All Superinterfaces:
Iterable<Map.Entry<Key,Value>>
All Known Subinterfaces:
BatchDeleter, BatchScanner, Scanner
All Known Implementing Classes:
ClientSideIteratorScanner, IsolatedScanner, MockBatchDeleter, MockBatchScanner, MockScanner, MockScannerBase, OfflineScanner, ScannerImpl, ScannerOptions, TabletServerBatchDeleter, TabletServerBatchReader

public interface ScannerBase
extends Iterable<Map.Entry<Key,Value>>

This class hosts configuration methods that are shared between different types of scanners.


Method Summary
 void addScanIterator(IteratorSetting cfg)
          Add a server-side scan iterator.
 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(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)
          Adds a column family to the list of columns that will be fetched by this scanner.
 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.
 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)
          Update the options for an iterator.
 

Method Detail

addScanIterator

void addScanIterator(IteratorSetting cfg)
Add a server-side scan iterator.

Parameters:
cfg - 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.
Throws:
IllegalArgumentException - if the setting conflicts with existing iterators

removeScanIterator

void removeScanIterator(String iteratorName)
Remove an iterator from the list of iterators.

Parameters:
iteratorName - nickname used for the iterator

updateScanIteratorOption

void updateScanIteratorOption(String iteratorName,
                              String key,
                              String value)
Update the options for an iterator. Note that this does not change the iterator options during a scan, it just replaces the given option on a configured iterator before a scan is started.

Parameters:
iteratorName - the name of the iterator to change
key - the name of the option
value - the new value for the named option

fetchColumnFamily

void fetchColumnFamily(org.apache.hadoop.io.Text col)
Adds a column family to the list of columns that will be fetched by this scanner. By default when no columns have been added the scanner fetches all columns.

Parameters:
col - the column family to be fetched

fetchColumn

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. The column is identified by family and qualifier. By default when no columns have been added the scanner fetches all columns.

Parameters:
colFam - the column family of the column to be fetched
colQual - the column qualifier of the column to be fetched

clearColumns

void clearColumns()
Clears the columns to be fetched (useful for resetting the scanner for reuse). Once cleared, the scanner will fetch all columns.


clearScanIterators

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


iterator

Iterator<Map.Entry<Key,Value>> iterator()
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>>
Returns:
an iterator over Key,Value pairs which meet the restrictions set on the scanner

setTimeout

void setTimeout(long timeOut,
                TimeUnit timeUnit)
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.

Parameters:
timeOut -
timeUnit - determines how timeout is interpreted
Since:
1.5.0

getTimeout

long getTimeout(TimeUnit timeUnit)
Returns the setting for how long a scanner will automatically retry when a failure occurs.

Returns:
the timeout configured for this scanner
Since:
1.5.0

close

void close()
Closes any underlying connections on the scanner

Since:
1.5.0


Copyright © 2013 Apache Accumulo Project. All Rights Reserved.