org.apache.accumulo.examples.wikisearch.parser
Class QueryEvaluator
java.lang.Object
org.apache.accumulo.examples.wikisearch.parser.QueryEvaluator
public class QueryEvaluator
- extends Object
This class evaluates events against a query. The query is passed to the constructor and then parsed. It is evaluated against an event in the evaluate method.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QueryEvaluator
public QueryEvaluator(String query)
throws org.apache.commons.jexl2.parser.ParseException
- Throws:
org.apache.commons.jexl2.parser.ParseException
QueryEvaluator
public QueryEvaluator(String query,
boolean insensitive)
throws org.apache.commons.jexl2.parser.ParseException
- Throws:
org.apache.commons.jexl2.parser.ParseException
getQuery
public String getQuery()
printLiterals
public void printLiterals()
setLevel
public void setLevel(org.apache.log4j.Level lev)
rewriteQuery
public StringBuilder rewriteQuery(StringBuilder query,
String fieldName,
Collection<EventFields.FieldValue> fieldValues)
evaluate
public boolean evaluate(EventFields eventFields)
- Evaluates the query against an event.
- Parameters:
eventFields
-
getModifiedQuery
public String getModifiedQuery()
- Returns:
- rewritten query that was evaluated against the most recent event
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.