org.apache.accumulo.core.client
Interface BatchScanner

All Superinterfaces:
Iterable<Map.Entry<Key,Value>>, ScannerBase
All Known Implementing Classes:
MockBatchDeleter, MockBatchScanner, TabletServerBatchDeleter, TabletServerBatchReader

public interface BatchScanner
extends ScannerBase

Implementations of BatchScanner support efficient lookups of many ranges in accumulo. Use this when looking up lots of ranges and you expect each range to contain a small amount of data. Also only use this when you do not care about the returned data being in sorted order. If you want to lookup a few ranges and expect those ranges to contain a lot of data, then use the Scanner instead. Also, the Scanner will return data in sorted order, this will not.


Method Summary
 void close()
          Cleans up and finalizes the scanner
 void setRanges(Collection<Range> ranges)
          Allows scanning over multiple ranges efficiently.
 void setTimeout(long timeout, TimeUnit timeUnit)
          Sets a timeout threshold for a server to respond.
 
Methods inherited from interface org.apache.accumulo.core.client.ScannerBase
addScanIterator, clearColumns, clearScanIterators, fetchColumn, fetchColumnFamily, getTimeout, iterator, removeScanIterator, updateScanIteratorOption
 

Method Detail

setRanges

void setRanges(Collection<Range> ranges)
Allows scanning over multiple ranges efficiently.

Parameters:
ranges - specifies the non-overlapping ranges to query

close

void close()
Cleans up and finalizes the scanner

Specified by:
close in interface ScannerBase

setTimeout

void setTimeout(long timeout,
                TimeUnit timeUnit)
Sets a timeout threshold for a server to respond. The batch scanner will accomplish as much work as possible before throwing an exception. BatchScanner iterators will throw a TimedOutException when all needed servers timeout. Setting the timeout to zero or Long.MAX_VALUE and TimeUnit.MILLISECONDS means no timeout.

If not set, there is not timeout. The BatchScanner will retry forever.

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


Copyright © 2015 Apache Accumulo Project. All rights reserved.