|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.accumulo.core.iterators.system.SynchronizedIterator<K,V>
public class SynchronizedIterator<K extends org.apache.hadoop.io.WritableComparable<?>,V extends org.apache.hadoop.io.Writable>
SynchronizedIterator: wrap a SortedKeyValueIterator so that all of its methods are synchronized
Constructor Summary | |
---|---|
SynchronizedIterator()
|
|
SynchronizedIterator(SortedKeyValueIterator<K,V> source)
|
Method Summary | |
---|---|
SortedKeyValueIterator<K,V> |
deepCopy(IteratorEnvironment env)
Creates a deep copy of this iterator as though seek had not yet been called. |
K |
getTopKey()
Returns top key. |
V |
getTopValue()
Returns top value. |
boolean |
hasTop()
Returns true if the iterator has more elements. |
void |
init(SortedKeyValueIterator<K,V> source,
Map<String,String> options,
IteratorEnvironment env)
Initializes the iterator. |
void |
next()
Advances to the next K,V pair. |
void |
seek(Range range,
Collection<ByteSequence> columnFamilies,
boolean inclusive)
Seeks to the first key in the Range, restricting the resulting K,V pairs to those with the specified columns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SynchronizedIterator()
public SynchronizedIterator(SortedKeyValueIterator<K,V> source)
Method Detail |
---|
public void init(SortedKeyValueIterator<K,V> source, Map<String,String> options, IteratorEnvironment env) throws IOException
SortedKeyValueIterator
init
in interface SortedKeyValueIterator<K extends org.apache.hadoop.io.WritableComparable<?>,V extends org.apache.hadoop.io.Writable>
source
- SortedKeyValueIterator source to read data from.options
- Map map of string option names to option values.env
- IteratorEnvironment environment in which iterator is being run.
IOException
- unused.public boolean hasTop()
SortedKeyValueIterator
hasTop
in interface SortedKeyValueIterator<K extends org.apache.hadoop.io.WritableComparable<?>,V extends org.apache.hadoop.io.Writable>
public void next() throws IOException
SortedKeyValueIterator
next
in interface SortedKeyValueIterator<K extends org.apache.hadoop.io.WritableComparable<?>,V extends org.apache.hadoop.io.Writable>
IOException
- if an I/O error occurs.public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException
SortedKeyValueIterator
SortedKeyValueIterator.init(org.apache.accumulo.core.iterators.SortedKeyValueIterator, java.util.Map, org.apache.accumulo.core.iterators.IteratorEnvironment)
is called.
Iterators that examine groups of adjacent key/value pairs (e.g. rows) to determine their top key and value should be sure that they properly handle a seek
to a key in the middle of such a group (e.g. the middle of a row). Even if the client always seeks to a range containing an entire group (a,c), the tablet
server could send back a batch of entries corresponding to (a,b], then reseek the iterator to range (b,c) when the scan is continued.
seek
in interface SortedKeyValueIterator<K extends org.apache.hadoop.io.WritableComparable<?>,V extends org.apache.hadoop.io.Writable>
range
- Range of keys to iterate over.columnFamilies
- Collection of column families to include or exclude.inclusive
- boolean that indicates whether to include (true) or exclude (false) column families.
IOException
- if an I/O error occurs.public K getTopKey()
SortedKeyValueIterator
getTopKey
in interface SortedKeyValueIterator<K extends org.apache.hadoop.io.WritableComparable<?>,V extends org.apache.hadoop.io.Writable>
public V getTopValue()
SortedKeyValueIterator
getTopValue
in interface SortedKeyValueIterator<K extends org.apache.hadoop.io.WritableComparable<?>,V extends org.apache.hadoop.io.Writable>
public SortedKeyValueIterator<K,V> deepCopy(IteratorEnvironment env)
SortedKeyValueIterator
deepCopy
in interface SortedKeyValueIterator<K extends org.apache.hadoop.io.WritableComparable<?>,V extends org.apache.hadoop.io.Writable>
env
- IteratorEnvironment environment in which iterator is being run.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |