use of org.apache.accumulo.core.iterators.Filter in project accumulo by apache.
the class VisibilityFilterTest method verify.
private void verify(TreeMap<Key, Value> source, int expectedSourceSize, Map<String, String> options, Text expectedCF, Text expectedCQ, Text expectedCV, int expectedFinalCount) throws IOException {
assertEquals(expectedSourceSize, source.size());
Filter filter = new VisibilityFilter();
filter.init(new SortedMapIterator(source), options, null);
filter.seek(new Range(), EMPTY_COL_FAMS, false);
int count = 0;
while (filter.hasTop()) {
count++;
// System.out.println(DefaultFormatter.formatEntry(Collections.singletonMap(filter.getTopKey(), filter.getTopValue()).entrySet().iterator().next(),
// false));
assertEquals(expectedCF, filter.getTopKey().getColumnFamily());
assertEquals(expectedCQ, filter.getTopKey().getColumnQualifier());
assertEquals(expectedCV, filter.getTopKey().getColumnVisibility());
filter.next();
}
assertEquals(expectedFinalCount, count);
}
Aggregations