use of org.apache.accumulo.core.iteratorsImpl.system.SourceSwitchingIterator in project accumulo by apache.
the class SourceSwitchingIteratorTest method test1.
@Test
public void test1() throws Exception {
TreeMap<Key, Value> tm1 = new TreeMap<>();
put(tm1, "r1", "cf1", "cq1", 5, "v1");
put(tm1, "r1", "cf1", "cq3", 5, "v2");
put(tm1, "r2", "cf1", "cq1", 5, "v3");
SortedMapIterator smi = new SortedMapIterator(tm1);
TestDataSource tds = new TestDataSource(smi);
SourceSwitchingIterator ssi = new SourceSwitchingIterator(tds);
ssi.seek(new Range(), new ArrayList<>(), false);
testAndCallNext(ssi, "r1", "cf1", "cq1", 5, "v1", true);
testAndCallNext(ssi, "r1", "cf1", "cq3", 5, "v2", true);
testAndCallNext(ssi, "r2", "cf1", "cq1", 5, "v3", true);
assertFalse(ssi.hasTop());
}
Aggregations