org.apache.accumulo.core.client
Class IsolatedScanner

java.lang.Object
  extended by org.apache.accumulo.core.client.impl.ScannerOptions
      extended by org.apache.accumulo.core.client.IsolatedScanner
All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<Key,Value>>, Scanner, ScannerBase

public class IsolatedScanner
extends ScannerOptions
implements Scanner

A scanner that presents a row isolated view of a accumulo table. Rows are buffered in memory on the client side. If you think your rows may not fit into memory, then you can provide an alternative row buffer factory to the constructor. This would allow rows to be buffered to disk for example.


Nested Class Summary
static class IsolatedScanner.MemoryRowBuffer
           
static class IsolatedScanner.MemoryRowBufferFactory
           
static interface IsolatedScanner.RowBuffer
           
static interface IsolatedScanner.RowBufferFactory
           
 
Constructor Summary
IsolatedScanner(Scanner scanner)
           
IsolatedScanner(Scanner scanner, IsolatedScanner.RowBufferFactory bufferFactory)
           
 
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 a accumulo table.
 void setBatchSize(int size)
           
 void setRange(Range range)
           
 void setTimeOut(int timeOut)
          When failure occurs, the scanner automatically retries.
 
Methods inherited from class org.apache.accumulo.core.client.impl.ScannerOptions
clearColumns, clearScanIterators, fetchColumn, fetchColumn, fetchColumnFamily, getFetchedColumns, setColumnFamilyRegex, setColumnQualifierRegex, setOptions, setRowRegex, setScanIteratorOption, setScanIterators, setupRegex, setValueRegex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.accumulo.core.client.ScannerBase
clearColumns, clearScanIterators, fetchColumn, fetchColumnFamily, setColumnFamilyRegex, setColumnQualifierRegex, setRowRegex, setScanIteratorOption, setScanIterators, setupRegex, setValueRegex
 

Constructor Detail

IsolatedScanner

public IsolatedScanner(Scanner scanner)

IsolatedScanner

public IsolatedScanner(Scanner scanner,
                       IsolatedScanner.RowBufferFactory bufferFactory)
Method Detail

iterator

public java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator()
Description copied from interface: Scanner
Returns an iterator over a 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>>
Specified by:
iterator in interface Scanner

setTimeOut

public void setTimeOut(int timeOut)
Description copied from interface: Scanner
When failure occurs, the scanner automatically retries. This setting determines how long a scanner will retry. By default a scanner will retry forever.

Specified by:
setTimeOut in interface Scanner
Parameters:
timeOut - in seconds

getTimeOut

public int getTimeOut()
Specified by:
getTimeOut in interface Scanner
Returns:
the timeout configured for this scanner

setRange

public void setRange(Range range)
Specified by:
setRange in interface Scanner
Parameters:
range - key range to begin and end scan

getRange

public Range getRange()
Specified by:
getRange in interface Scanner
Returns:
the range configured for this scanner

setBatchSize

public void setBatchSize(int size)
Specified by:
setBatchSize in interface Scanner
Parameters:
size - the number of Keys/Value pairs to fetch per call to Accumulo

getBatchSize

public int getBatchSize()
Specified by:
getBatchSize in interface Scanner
Returns:
the batch size configured for this scanner

enableIsolation

public void enableIsolation()
Specified by:
enableIsolation in interface Scanner

disableIsolation

public void disableIsolation()
Specified by:
disableIsolation in interface Scanner


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