public class CountingIterator extends WrappingIterator
Constructor and Description |
---|
CountingIterator(SortedKeyValueIterator<Key,Value> source) |
Modifier and Type | Method and Description |
---|---|
CountingIterator |
deepCopy(IteratorEnvironment env)
Creates a deep copy of this iterator as though seek had not yet been called.
|
long |
getCount() |
void |
init(SortedKeyValueIterator<Key,Value> source,
Map<String,String> options,
IteratorEnvironment env)
Initializes the iterator.
|
void |
next()
Advances to the next K,V pair.
|
getSource, getTopKey, getTopValue, hasTop, seek, setSource
public CountingIterator(SortedKeyValueIterator<Key,Value> source)
public CountingIterator deepCopy(IteratorEnvironment env)
SortedKeyValueIterator
deepCopy
in interface SortedKeyValueIterator<Key,Value>
deepCopy
in class WrappingIterator
env
- IteratorEnvironment environment in which iterator is being run.public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env)
SortedKeyValueIterator
init
in interface SortedKeyValueIterator<Key,Value>
init
in class WrappingIterator
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.public void next() throws IOException
SortedKeyValueIterator
next
in interface SortedKeyValueIterator<Key,Value>
next
in class WrappingIterator
IOException
- if an I/O error occurs.public long getCount()
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.