Search in sources :

Example 1 with RegExFilter

use of org.apache.accumulo.core.iterators.user.RegExFilter in project accumulo by apache.

the class RegExTest method runTest.

private void runTest(Range range, String rowRegEx, String cfRegEx, String cqRegEx, String valRegEx, int expected) throws Exception {
    SortedKeyValueIterator<Key, Value> source = new SortedMapIterator(data);
    Set<ByteSequence> es = ImmutableSet.of();
    IteratorSetting is = new IteratorSetting(50, "regex", RegExFilter.class);
    RegExFilter.setRegexs(is, rowRegEx, cfRegEx, cqRegEx, valRegEx, false);
    RegExFilter iter = new RegExFilter();
    iter.init(source, is.getOptions(), null);
    iter.seek(range, es, false);
    runTest(iter, rowRegEx, cfRegEx, cqRegEx, valRegEx, expected);
}
Also used : RegExFilter(org.apache.accumulo.core.iterators.user.RegExFilter) IteratorSetting(org.apache.accumulo.core.client.IteratorSetting) Value(org.apache.accumulo.core.data.Value) SortedMapIterator(org.apache.accumulo.core.iterators.SortedMapIterator) Key(org.apache.accumulo.core.data.Key) ByteSequence(org.apache.accumulo.core.data.ByteSequence)

Aggregations

IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)1 ByteSequence (org.apache.accumulo.core.data.ByteSequence)1 Key (org.apache.accumulo.core.data.Key)1 Value (org.apache.accumulo.core.data.Value)1 SortedMapIterator (org.apache.accumulo.core.iterators.SortedMapIterator)1 RegExFilter (org.apache.accumulo.core.iterators.user.RegExFilter)1