Search in sources :

Example 1 with IndexRegexIteratorBuilder

use of datawave.query.iterator.builder.IndexRegexIteratorBuilder in project datawave by NationalSecurityAgency.

the class IteratorBuildingVisitor method ivarateRegex.

/**
 * Build the iterator stack using the regex ivarator (field index caching regex iterator)
 *
 * @param rootNode
 *            the node that was processed to generated this builder
 * @param sourceNode
 *            the source node derived from the root
 * @param data
 */
public void ivarateRegex(JexlNode rootNode, JexlNode sourceNode, Object data) throws IOException {
    IndexRegexIteratorBuilder builder = new IndexRegexIteratorBuilder();
    if (sourceNode instanceof ASTERNode || sourceNode instanceof ASTNRNode) {
        builder.setNegated(sourceNode instanceof ASTNRNode);
        builder.setField(JexlASTHelper.getIdentifier(sourceNode));
        builder.setValue(String.valueOf(JexlASTHelper.getLiteralValue(sourceNode)));
    } else {
        QueryException qe = new QueryException(DatawaveErrorCode.UNEXPECTED_SOURCE_NODE, MessageFormat.format("{0}", "ExceededValueThresholdMarkerJexlNode"));
        throw new DatawaveFatalQueryException(qe);
    }
    builder.negateAsNeeded(data);
    builder.forceDocumentBuild(!limitLookup && this.isQueryFullySatisfied);
    ivarate(builder, rootNode, sourceNode, data);
}
Also used : IndexRegexIteratorBuilder(datawave.query.iterator.builder.IndexRegexIteratorBuilder) DatawaveFatalQueryException(datawave.query.exceptions.DatawaveFatalQueryException) QueryException(datawave.webservice.query.exception.QueryException) ASTERNode(org.apache.commons.jexl2.parser.ASTERNode) ASTNRNode(org.apache.commons.jexl2.parser.ASTNRNode) DatawaveFatalQueryException(datawave.query.exceptions.DatawaveFatalQueryException)

Aggregations

DatawaveFatalQueryException (datawave.query.exceptions.DatawaveFatalQueryException)1 IndexRegexIteratorBuilder (datawave.query.iterator.builder.IndexRegexIteratorBuilder)1 QueryException (datawave.webservice.query.exception.QueryException)1 ASTERNode (org.apache.commons.jexl2.parser.ASTERNode)1 ASTNRNode (org.apache.commons.jexl2.parser.ASTNRNode)1