} catch (NoSuchElementException e) { PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.EQUALS_NODE_TWO_LITERALS, e, MessageFormat.format( "Node: {0}", PrintingVisitor.formattedQueryString(node).replace('\n', ' '))); throw new InvalidFieldIndexQueryFatalQueryException(qe); PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.FIELD_NOT_INDEXED, MessageFormat.format( "Fieldname: {0}", fieldName)); throw new InvalidFieldIndexQueryFatalQueryException(qe);
crq = retrieve(queryId, owner); } catch (IOException e) { PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.CACHED_RUNNING_QUERY_ERROR, e); log.error(qe); response.addException(qe.getBottomQueryException()); throw new PreConditionFailedException(qe, response);
PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.WILDCARDS_BOTH_SIDES, MessageFormat.format( "Term: {0}", normalizedQueryTerm)); log.error(qe);
} catch (NoSuchElementException e) { PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.EQUALS_NODE_TWO_LITERALS, e, MessageFormat.format( "Node: {0}", PrintingVisitor.formattedQueryString(node).replace('\n', ' '))); throw new InvalidFieldIndexQueryFatalQueryException(qe); PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.FIELD_NOT_INDEXED, MessageFormat.format( "Fieldname: {0}", fieldName)); throw new InvalidFieldIndexQueryFatalQueryException(qe);
protected ASTJexlScript parseQueryAndValidatePattern(String query, TraceStopwatch stopwatch) { ASTJexlScript queryTree; try { queryTree = JexlASTHelper.parseJexlQuery(query); ValidPatternVisitor.check(queryTree); } catch (StackOverflowError soe) { if (log.isTraceEnabled()) { log.trace("Stack trace for overflow " + soe); } stopwatch.stop(); PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_DEPTH_OR_TERM_THRESHOLD_EXCEEDED, soe); log.warn(qe); throw new DatawaveFatalQueryException(qe); } catch (ParseException e) { stopwatch.stop(); BadRequestQueryException qe = new BadRequestQueryException(DatawaveErrorCode.UNPARSEABLE_JEXL_QUERY, e, MessageFormat.format("Query: {0}", query)); log.warn(qe); throw new DatawaveFatalQueryException(qe); } catch (PatternSyntaxException e) { stopwatch.stop(); BadRequestQueryException qe = new BadRequestQueryException(DatawaveErrorCode.INVALID_REGEX, e, MessageFormat.format("Query: {0}", query)); log.warn(qe); throw new DatawaveFatalQueryException(qe); } return queryTree; }
PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_DEPTH_THRESHOLD_EXCEEDED, MessageFormat.format( "{0} > {1}, last operation: {2}", depth, config.getMaxDepthThreshold(), "RangeStreamLookup")); throw new DatawaveFatalQueryException(qe);
log.error(e2.getMessage(), e2); PreConditionFailedQueryException e = new PreConditionFailedQueryException(DatawaveErrorCode.CACHED_RESULTS_PERSIST_ERROR, e1); throw new PreConditionFailedException(e, null);
public static void validateQuerySize(String lastOperation, JexlNode queryTree, ShardQueryConfiguration config) { final QueryStopwatch timers = config.getTimers(); TraceStopwatch stopwatch = timers.newStartedStopwatch("DefaultQueryPlanner - Validate against term and depth thresholds"); // check the query depth (up to config.getMaxDepthThreshold() + 1) int depth = DepthVisitor.getDepth(queryTree, config.getMaxDepthThreshold()); if (depth > config.getMaxDepthThreshold()) { PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_DEPTH_THRESHOLD_EXCEEDED, MessageFormat.format( "{0} > {1}, last operation: {2}", depth, config.getMaxDepthThreshold(), lastOperation)); throw new DatawaveFatalQueryException(qe); } // count the terms int termCount = TermCountingVisitor.countTerms(queryTree); if (termCount > config.getMaxTermThreshold()) { PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_TERM_THRESHOLD_EXCEEDED, MessageFormat.format( "{0} > {1}, last operation: {2}", termCount, config.getMaxTermThreshold(), lastOperation)); throw new DatawaveFatalQueryException(qe); } stopwatch.stop(); }
PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.FIELD_PHRASE_QUERY_NOT_INDEXED, MessageFormat.format("Field: {0}", field)); throw new IllegalArgumentException(qe);
crq = retrieve(id, owner); } catch (IOException e1) { throw new PreConditionFailedQueryException(DatawaveErrorCode.CACHED_RESULTS_IMPORT_ERROR, e1);
PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.IGNORE_PATTERN_FOR_INDEX_LOOKUP, MessageFormat.format("Pattern: {0}", pattern)); log.debug(qe);
throw new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_TIMEOUT_OR_SERVER_ERROR, MessageFormat.format("id = {0}", id)); } else {
throw new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_TIMEOUT_OR_SERVER_ERROR, MessageFormat.format("id = {0}", id)); } else {
PreConditionFailedQueryException qe = new PreConditionFailedQueryException( DatawaveErrorCode.FULL_TABLE_SCAN_REQUIRED_BUT_DISABLED); throw new DatawaveFatalQueryException(qe);
crq = retrieve(queryId, owner); } catch (IOException e) { throw new PreConditionFailedQueryException(DatawaveErrorCode.CACHED_RESULTS_IMPORT_ERROR); throw new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_NOT_CACHED); if (!crq.getUser().equals(owner)) { throw new UnauthorizedQueryException(DatawaveErrorCode.QUERY_OWNER_MISMATCH, MessageFormat.format("{0} != {1}", crq.getUser(), owner));
throw new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_NOT_CACHED); throw new PreConditionFailedQueryException(DatawaveErrorCode.REQUESTED_PAGE_SIZE_TOO_LARGE, MessageFormat.format("{0} > {1}.", pagesize, cachedResultsConfiguration.getMaxPageSize()));
log.trace("Stack trace for overflow " + e); PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_DEPTH_OR_TERM_THRESHOLD_EXCEEDED, e); log.warn(qe); throw new DatawaveFatalQueryException(qe); PreConditionFailedQueryException qe = new PreConditionFailedQueryException(DatawaveErrorCode.FULL_TABLE_SCAN_REQUIRED_BUT_DISABLED); throw new FullTableScansDisallowedException(qe);
crq = retrieve(queryId, owner); } catch (IOException e) { throw new PreConditionFailedQueryException(DatawaveErrorCode.CACHED_RESULTS_IMPORT_ERROR, e); throw new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_NOT_CACHED); if (!crq.getUser().equals(owner)) { throw new UnauthorizedQueryException(DatawaveErrorCode.QUERY_OWNER_MISMATCH, MessageFormat.format("{0} != {1}", crq.getUser(), owner));
} catch (RejectedExecutionException e) { throw new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_TIMEOUT_OR_SERVER_ERROR, e, MessageFormat.format("id = {0}", queryId));
crq = retrieve(queryId, owner); } catch (IOException e) { throw new PreConditionFailedQueryException(DatawaveErrorCode.CACHED_RESULTS_IMPORT_ERROR, e); throw new PreConditionFailedQueryException(DatawaveErrorCode.QUERY_NOT_CACHED);