Package org.apache.accumulo.iteratortest
Class SimpleKVReusingIterator
- java.lang.Object
-
- org.apache.accumulo.iteratortest.SimpleKVReusingIterator
-
- All Implemented Interfaces:
SortedKeyValueIterator<Key,Value>
,YieldingKeyValueIterator<Key,Value>
public class SimpleKVReusingIterator extends Object implements SortedKeyValueIterator<Key,Value>
Internally, Accumulo reuses the same instance of Key and Value to reduce the number of objects to be garbage collected. This iterator simulates that.
-
-
Constructor Summary
Constructors Constructor Description SimpleKVReusingIterator(SortedKeyValueIterator<Key,Value> source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SortedKeyValueIterator<Key,Value>
deepCopy(IteratorEnvironment env)
Key
getTopKey()
Value
getTopValue()
boolean
hasTop()
void
init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env)
void
next()
void
seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.accumulo.core.iterators.YieldingKeyValueIterator
enableYielding
-
-
-
-
Constructor Detail
-
SimpleKVReusingIterator
public SimpleKVReusingIterator(SortedKeyValueIterator<Key,Value> source)
-
-
Method Detail
-
init
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException
- Specified by:
init
in interfaceSortedKeyValueIterator<Key,Value>
- Throws:
IOException
-
hasTop
public boolean hasTop()
- Specified by:
hasTop
in interfaceSortedKeyValueIterator<Key,Value>
-
next
public void next() throws IOException
- Specified by:
next
in interfaceSortedKeyValueIterator<Key,Value>
- Throws:
IOException
-
seek
public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException
- Specified by:
seek
in interfaceSortedKeyValueIterator<Key,Value>
- Throws:
IOException
-
getTopKey
public Key getTopKey()
- Specified by:
getTopKey
in interfaceSortedKeyValueIterator<Key,Value>
-
getTopValue
public Value getTopValue()
- Specified by:
getTopValue
in interfaceSortedKeyValueIterator<Key,Value>
-
deepCopy
public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env)
- Specified by:
deepCopy
in interfaceSortedKeyValueIterator<Key,Value>
-
-