|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.iterators.user.WholeRowIterator
public class WholeRowIterator
The WholeRowIterator is designed to provide row-isolation so that queries see mutations as atomic. It does so by encapsulating an entire row of key/value pairs into a single key/value pair, which is returned through the client as an atomic operation.
One caveat is that when seeking in the WholeRowIterator using a range that starts at a non-inclusive first key in a row, (e.g. seek(new Range(new Key(new Text("row")),false,...),...)) this iterator will skip to the next row. This is done in order to prevent repeated scanning of the same row when system automatically creates ranges of that form, which happens in the case of the client calling continueScan, or in the case of the tablet server continuing a scan after swapping out sources.
To regain the original key/value pairs of the row, call the decodeRow function on the key/value pair that this iterator returned.
RowFilter
Constructor Summary | |
---|---|
WholeRowIterator()
|
Method Summary | |
---|---|
static SortedMap<Key,Value> |
decodeRow(Key rowKey,
Value rowValue)
|
SortedKeyValueIterator<Key,Value> |
deepCopy(IteratorEnvironment env)
Creates a deep copy of this iterator as though seek had not yet been called. |
static Value |
encodeRow(List<Key> keys,
List<Value> values)
|
protected boolean |
filter(org.apache.hadoop.io.Text currentRow,
List<Key> keys,
List<Value> values)
|
Key |
getTopKey()
Returns top key. |
Value |
getTopValue()
Returns top value. |
boolean |
hasTop()
Returns true if the iterator has more elements. |
void |
init(SortedKeyValueIterator<Key,Value> 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 WholeRowIterator()
Method Detail |
---|
public static final SortedMap<Key,Value> decodeRow(Key rowKey, Value rowValue) throws IOException
IOException
public static final Value encodeRow(List<Key> keys, List<Value> values) throws IOException
IOException
protected boolean filter(org.apache.hadoop.io.Text currentRow, List<Key> keys, List<Value> values)
currentRow
- All keys have this in their row portion (do not modify!).keys
- One key for each key in the row, ordered as they are given by the source iterator (do not modify!).values
- One value for each key in keys, ordered to correspond to the ordering in keys (do not modify!).
public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env)
SortedKeyValueIterator
deepCopy
in interface SortedKeyValueIterator<Key,Value>
env
- IteratorEnvironment environment in which iterator is being run.
public Key getTopKey()
SortedKeyValueIterator
getTopKey
in interface SortedKeyValueIterator<Key,Value>
public Value getTopValue()
SortedKeyValueIterator
getTopValue
in interface SortedKeyValueIterator<Key,Value>
public boolean hasTop()
SortedKeyValueIterator
hasTop
in interface SortedKeyValueIterator<Key,Value>
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException
SortedKeyValueIterator
init
in interface SortedKeyValueIterator<Key,Value>
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 void next() throws IOException
SortedKeyValueIterator
next
in interface SortedKeyValueIterator<Key,Value>
IOException
- if an I/O error occurs.public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException
SortedKeyValueIterator
seek
in interface SortedKeyValueIterator<Key,Value>
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |