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);
}
}
Aggregations