org.apache.accumulo.core.client
Interface Scanner

All Superinterfaces:
java.lang.Iterable<java.util.Map.Entry<Key,Value>>, ScannerBase
All Known Implementing Classes:
IsolatedScanner, MockScanner, ScannerImpl

public interface Scanner
extends ScannerBase, java.lang.Iterable<java.util.Map.Entry<Key,Value>>

Walk a table over a given range. provides scanner functionality "Clients can iterate over multiple column families, and there are several mechanisms for limiting the rows, columns, and timestamps traversed by a scan. For example, we could restrict [a] scan ... to only produce anchors whose columns match [a] regular expression ..., or to only produce anchors whose timestamps fall within ten days of the current time."


Method Summary
 void disableIsolation()
           
 void enableIsolation()
           
 int getBatchSize()
           
 Range getRange()
           
 int getTimeOut()
           
 java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator()
          Returns an iterator over an accumulo table.
 void setBatchSize(int size)
           
 void setRange(Range range)
           
 void setTimeOut(int timeOut)
          When failure occurs, the scanner automatically retries.
 
Methods inherited from interface org.apache.accumulo.core.client.ScannerBase
clearColumns, clearScanIterators, fetchColumn, fetchColumnFamily, setColumnFamilyRegex, setColumnQualifierRegex, setRowRegex, setScanIteratorOption, setScanIterators, setupRegex, setValueRegex
 

Method Detail

setTimeOut

void setTimeOut(int timeOut)
When failure occurs, the scanner automatically retries. This setting determines how long a scanner will retry. By default a scanner will retry forever.

Parameters:
timeOut - in seconds

getTimeOut

int getTimeOut()
Returns:
the timeout configured for this scanner

setRange

void setRange(Range range)
Parameters:
range - key range to begin and end scan

getRange

Range getRange()
Returns:
the range configured for this scanner

setBatchSize

void setBatchSize(int size)
Parameters:
size - the number of Keys/Value pairs to fetch per call to Accumulo

getBatchSize

int getBatchSize()
Returns:
the batch size configured for this scanner

enableIsolation

void enableIsolation()

disableIsolation

void disableIsolation()

iterator

java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator()
Returns an iterator over an accumulo table. This iterator uses the options that are currently set on the scanner for its lifetime. So setting options on a Scanner object will have no effect on existing iterators. Keys are returned in sorted order by the iterator.

Specified by:
iterator in interface java.lang.Iterable<java.util.Map.Entry<Key,Value>>


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