|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SortedKeyValueIterator<K extends org.apache.hadoop.io.WritableComparable<?>,V extends org.apache.hadoop.io.Writable>
An iterator that supports iterating over key and value pairs. Anything implementing this interface should return keys in sorted order.
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,
java.util.Map<java.lang.String,java.lang.String> options,
IteratorEnvironment env)
Initializes the iterator. |
void |
next()
Advances to the next K,V pair. |
void |
seek(Range range,
java.util.Collection<ByteSequence> columnFamilies,
boolean inclusive)
An iterator must seek to the first key in the range taking inclusiveness into account. |
Method Detail |
---|
void init(SortedKeyValueIterator<K,V> source, java.util.Map<java.lang.String,java.lang.String> options, IteratorEnvironment env) throws java.io.IOException
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.
java.io.IOException
- unused.
java.lang.IllegalArgumentException
- if there are problems with the options.
java.lang.UnsupportedOperationException
- if not supported.boolean hasTop()
java.lang.IllegalStateException
- if called before seek.void next() throws java.io.IOException
java.io.IOException
- if an I/O error occurs.
java.lang.IllegalStateException
- if called before seek.
NoSuchElementException
- if next element doesn't exist.void seek(Range range, java.util.Collection<ByteSequence> columnFamilies, boolean inclusive) throws java.io.IOException
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.
java.io.IOException
- if an I/O error occurs.
java.lang.IllegalArgumentException
- if there are problems with the parameters.K getTopKey()
java.lang.IllegalStateException
- if called before seek.
NoSuchElementException
- if top element doesn't exist.V getTopValue()
java.lang.IllegalStateException
- if called before seek.
NoSuchElementException
- if top element doesn't exist.SortedKeyValueIterator<K,V> deepCopy(IteratorEnvironment env)
env
- IteratorEnvironment environment in which iterator is being run.
java.lang.UnsupportedOperationException
- if not supported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |