use of org.apache.accumulo.core.iterators.system.CountingIterator in project accumulo by apache.
the class FirstEntryInRowIteratorTest method process.
private static long process(TreeMap<Key, Value> sourceMap, TreeMap<Key, Value> resultMap, Range range, IteratorSetting iteratorSetting) throws IOException {
org.apache.accumulo.core.iterators.SortedMapIterator source = new SortedMapIterator(sourceMap);
CountingIterator counter = new CountingIterator(source);
FirstEntryInRowIterator feiri = new FirstEntryInRowIterator();
IteratorEnvironment env = new BaseIteratorEnvironment();
feiri.init(counter, iteratorSetting.getOptions(), env);
feiri.seek(range, LocalityGroupUtil.EMPTY_CF_SET, false);
while (feiri.hasTop()) {
resultMap.put(feiri.getTopKey(), feiri.getTopValue());
feiri.next();
}
return counter.getCount();
}
Aggregations