org.apache.accumulo.core.iterators.user
Class WholeRowIterator

java.lang.Object
  extended by org.apache.accumulo.core.iterators.user.RowEncodingIterator
      extended by org.apache.accumulo.core.iterators.user.WholeRowIterator
All Implemented Interfaces:
SortedKeyValueIterator<Key,Value>
Direct Known Subclasses:
WholeRowIterator

public class WholeRowIterator
extends RowEncodingIterator

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.

This iterator extends the RowEncodingIterator, providing implementations for rowEncoder and rowDecoder which serializes all column and value information from a given row into a single ByteStream in a value.

As with the RowEncodingIterator, when seeking in the WholeRowIterator using a range that starts at a non-inclusive first key in a row, this iterator will skip to the next row.

To regain the original key/value pairs of the row, call the decodeRow function on the key/value pair that this iterator returned.

See Also:
RowFilter

Field Summary
 
Fields inherited from class org.apache.accumulo.core.iterators.user.RowEncodingIterator
sourceIter
 
Constructor Summary
WholeRowIterator()
           
 
Method Summary
static SortedMap<Key,Value> decodeRow(Key rowKey, Value rowValue)
           
 SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env)
          Implement deepCopy.
static Value encodeRow(List<Key> keys, List<Value> values)
           
 SortedMap<Key,Value> rowDecoder(Key rowKey, Value rowValue)
          Given a value generated by the rowEncoder implementation, recreate the original Key, Value pairs.
 Value rowEncoder(List<Key> keys, List<Value> values)
          Take a stream of keys and values.
 
Methods inherited from class org.apache.accumulo.core.iterators.user.RowEncodingIterator
filter, getTopKey, getTopValue, hasTop, init, next, seek
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WholeRowIterator

public WholeRowIterator()
Method Detail

deepCopy

public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env)
Description copied from class: RowEncodingIterator
Implement deepCopy. Ensure sourceIter is copied appropriately.

Specified by:
deepCopy in interface SortedKeyValueIterator<Key,Value>
Specified by:
deepCopy in class RowEncodingIterator
Parameters:
env - IteratorEnvironment environment in which iterator is being run.
Returns:
SortedKeyValueIterator a copy of this iterator (with the same source and settings).

rowDecoder

public SortedMap<Key,Value> rowDecoder(Key rowKey,
                                       Value rowValue)
                                throws IOException
Description copied from class: RowEncodingIterator
Given a value generated by the rowEncoder implementation, recreate the original Key, Value pairs.

Specified by:
rowDecoder in class RowEncodingIterator
Throws:
IOException

rowEncoder

public Value rowEncoder(List<Key> keys,
                        List<Value> values)
                 throws IOException
Description copied from class: RowEncodingIterator
Take a stream of keys and values. Return values in the same order encoded such that all portions of the key (except for the row value) and the original value are encoded in some way.

Specified by:
rowEncoder in class RowEncodingIterator
Throws:
IOException

decodeRow

public static final SortedMap<Key,Value> decodeRow(Key rowKey,
                                                   Value rowValue)
                                            throws IOException
Throws:
IOException

encodeRow

public static final Value encodeRow(List<Key> keys,
                                    List<Value> values)
                             throws IOException
Throws:
IOException


Copyright © 2015 Apache Accumulo Project. All rights reserved.