Class AlluxioStatusException

    • Constructor Detail

      • AlluxioStatusException

        public AlluxioStatusException​(io.grpc.Status status)
        Parameters:
        status - the status code for this exception
    • Method Detail

      • getStatus

        public io.grpc.Status getStatus()
        Returns:
        the internal status for this exception
      • getStatusCode

        public io.grpc.Status.Code getStatusCode()
        Returns:
        the status code for this exception
      • toGrpcStatusException

        public io.grpc.StatusException toGrpcStatusException()
        Returns:
        a gRPC status exception representation of this exception
      • from

        public static AlluxioStatusException from​(io.grpc.Status status)
        Converts an Alluxio exception from status and message representation to native representation. The status must not be null or Status.OK.
        Parameters:
        status - the status
        Returns:
        an AlluxioStatusException for the given status and message
      • fromCheckedException

        public static AlluxioStatusException fromCheckedException​(java.lang.Throwable throwable)
        Converts checked throwables to Alluxio status exceptions. Unchecked throwables should not be passed to this method. Use Throwables.propagateIfPossible before passing a Throwable to this method.
        Parameters:
        throwable - a throwable
        Returns:
        the converted AlluxioStatusException
      • fromThrowable

        public static AlluxioStatusException fromThrowable​(java.lang.Throwable t)
        Converts an arbitrary throwable to an Alluxio status exception. This method should be used with caution because it could potentially convert an unchecked exception (indicating a bug) to a checked Alluxio status exception.
        Parameters:
        t - a throwable
        Returns:
        the converted AlluxioStatusException
      • fromStatusRuntimeException

        public static AlluxioStatusException fromStatusRuntimeException​(io.grpc.StatusRuntimeException e)
        Converts a gRPC StatusRuntimeException to an Alluxio status exception.
        Parameters:
        e - a gRPC StatusRuntimeException
        Returns:
        the converted AlluxioStatusException
      • fromIOException

        public static AlluxioStatusException fromIOException​(java.io.IOException ioe)
        Converts an IOException to a corresponding status exception. Unless special cased, IOExceptions are converted to UnavailableException.
        Parameters:
        ioe - the IO exception to convert
        Returns:
        the corresponding status exception