use of datawave.query.exceptions.DatawaveQueryException in project datawave by NationalSecurityAgency.
the class IndexQueryPlanner method getQueryIterator.
@Override
public IteratorSetting getQueryIterator(MetadataHelper metadataHelper, ShardQueryConfiguration config, Query settings, String queryString, Boolean isFullTable) throws DatawaveQueryException {
if (isFullTable) {
QueryException qe = new QueryException(DatawaveErrorCode.FULL_TABLE_SCAN_DISALLOWED);
throw new FullTableScansDisallowedException(qe);
}
IteratorSetting cfg = super.getQueryIterator(metadataHelper, config, settings, queryString, isFullTable);
if (null == cfg) {
try {
cfg = settingFuture.get();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
}
cfg.setIteratorClass(FieldIndexOnlyQueryIterator.class.getName());
return cfg;
}
use of datawave.query.exceptions.DatawaveQueryException in project datawave by NationalSecurityAgency.
the class TimedVisitorManager method timedVisit.
/**
* Wrap visitor execution with a timer and debug msg
*
* @param timers
* a {@link QueryStopwatch}
* @param stageName
* the name for this operation, for example "Fix Not Null Intent" or "Expand Regex Nodes"
* @param visitorManager
* an interface that allows us to pass a lambda operation {@link VisitorManager}
* @return the query tree, a {@link ASTJexlScript}
* @throws DatawaveQueryException
* if something goes wrong
*/
public ASTJexlScript timedVisit(QueryStopwatch timers, String stageName, VisitorManager visitorManager) throws DatawaveQueryException {
ASTJexlScript script;
TraceStopwatch stopwatch = timers.newStartedStopwatch("DefaultQueryPlanner - " + stageName);
try {
script = visitorManager.apply();
if (isDebugEnabled) {
logQuery(script, "Query after visit: " + stageName);
}
if (validateAst) {
try {
ASTValidator.isValid(script, stageName);
} catch (InvalidQueryTreeException e) {
throw new DatawaveQueryException(e);
}
}
} finally {
stopwatch.stop();
}
return script;
}
Aggregations