Search in sources :

Example 1 with PrestoSparkRetryableExecutionException

use of com.facebook.presto.spark.classloader_interface.PrestoSparkRetryableExecutionException in project presto by prestodb.

the class PrestoSparkExecutionExceptionFactory method toPrestoSparkExecutionException.

public PrestoSparkExecutionException toPrestoSparkExecutionException(Throwable throwable) {
    ExecutionFailureInfo failureInfo = toFailure(throwable);
    byte[] serialized = codec.toJsonBytes(failureInfo);
    byte[] compressed = compress(serialized);
    String encodedExecutionFailureInfo = Base64.getEncoder().encodeToString(compressed);
    if (isRetryable(failureInfo)) {
        return new PrestoSparkRetryableExecutionException(throwable.getMessage(), encodedExecutionFailureInfo, throwable);
    } else {
        return new PrestoSparkNonRetryableExecutionException(throwable.getMessage(), encodedExecutionFailureInfo, throwable);
    }
}
Also used : PrestoSparkRetryableExecutionException(com.facebook.presto.spark.classloader_interface.PrestoSparkRetryableExecutionException) PrestoSparkNonRetryableExecutionException(com.facebook.presto.spark.classloader_interface.PrestoSparkNonRetryableExecutionException) ExecutionFailureInfo(com.facebook.presto.execution.ExecutionFailureInfo)

Aggregations

ExecutionFailureInfo (com.facebook.presto.execution.ExecutionFailureInfo)1 PrestoSparkNonRetryableExecutionException (com.facebook.presto.spark.classloader_interface.PrestoSparkNonRetryableExecutionException)1 PrestoSparkRetryableExecutionException (com.facebook.presto.spark.classloader_interface.PrestoSparkRetryableExecutionException)1