QueryFilter { public static QueryFilter create(Query q) throws QueryFilterException { List<Conjunction> dnf = createDisjunctiveNormalForm(q); Evaluator ev = DisjunctionEvaluator.create(dnf); return new QueryFilter(ev); } private  QueryFilter(Evaluator evaluator); static QueryFilter create(Query q); boolean evaluate(ServiceDocument document, ServiceDocumentDescription description); static final QueryFilter TRUE; static final QueryFilter FALSE; }
@Test(expected = UnsupportedMatchTypeException.class) public void unsupportedMatchTypePhrase() throws QueryFilterException { Query q = createTerm("c1", "v1"); q.term.matchType = MatchType.PHRASE; QueryFilter.create(q); }
@Test public void throughputQueryFilterCreation() throws QueryFilterException { if (!this.isStressTest) { return; } Query q = createBenchmarkQuery(); TimeBoundRunner r = new TimeBoundRunner(() -> { try { QueryFilter.create(q); } catch (QueryFilterException e) { throw new Error(e); } }); r.run(TimeUnit.SECONDS.toMillis(3)); r.print("queryFilterCreation"); }