use of com.facebook.presto.verifier.framework.PrestoQueryException in project presto by prestodb.
the class PrestoExceptionClassifier method shouldResubmit.
public boolean shouldResubmit(Throwable throwable) {
if (!(throwable instanceof PrestoQueryException)) {
return false;
}
PrestoQueryException queryException = (PrestoQueryException) throwable;
Optional<ErrorCodeSupplier> errorCode = queryException.getErrorCode();
return errorCode.isPresent() && (resubmittedErrors.contains(errorCode.get()) || conditionalResubmittedErrors.stream().anyMatch(matcher -> matcher.matches(errorCode.get(), queryException.getQueryStage(), queryException.getMessage())));
}
use of com.facebook.presto.verifier.framework.PrestoQueryException in project presto by prestodb.
the class TestPrestoExceptionClassifier method assertPrestoQueryException.
private void assertPrestoQueryException(QueryException queryException, Optional<ErrorCodeSupplier> errorCode, boolean retryable, QueryActionStats queryActionStats, QueryStage queryStage) {
assertTrue(queryException instanceof PrestoQueryException);
assertEquals(queryException.getQueryStage(), queryStage);
PrestoQueryException exception = (PrestoQueryException) queryException;
assertEquals(exception.getErrorCode(), errorCode);
assertEquals(exception.isRetryable(), retryable);
assertEquals(exception.getQueryActionStats(), queryActionStats);
}
Aggregations