trueCount++;
map2.put(k, map.get(k));
}
}
SortedMapIterator source = new SortedMapIterator(map);
WholeRowIterator iter = new WholeRowIterator(source);
SortedMap<Key,Value> resultMap = new TreeMap<Key,Value>();
iter.seek(new Range(), new ArrayList<ByteSequence>(), false);
int numRows = 0;
while (iter.hasTop()) {
numRows++;
Key rowKey = iter.getTopKey();
Value rowValue = iter.getTopValue();
resultMap.putAll(WholeRowIterator.decodeRow(rowKey, rowValue));
iter.next();
}
assertTrue(numRows == 5);
assertEquals(resultMap, map);
WholeRowIterator iter2 = new WholeRowIterator(source) {
@Override
public boolean filter(Text row, List<Key> keys, List<Value> values) {
return toInclude.get(row);
}
};
resultMap.clear();
iter2.seek(new Range(), new ArrayList<ByteSequence>(), false);
numRows = 0;
while (iter2.hasTop()) {
numRows++;
Key rowKey = iter2.getTopKey();
Value rowValue = iter2.getTopValue();
resultMap.putAll(WholeRowIterator.decodeRow(rowKey, rowValue));
iter2.next();
}
assertTrue(numRows == trueCount);
assertEquals(resultMap, map2);
}