Class CallStatus

java.lang.Object
org.apache.arrow.flight.CallStatus

public class CallStatus extends Object
The result of a Flight RPC, consisting of a status code with an optional description and/or exception that led to the status.

If raised or sent through FlightProducer.StreamListener.onError(Throwable) or OutboundStreamListener.error(Throwable), the client call will raise the same error (a FlightRuntimeException with the same FlightStatusCode and description). The exception within, if present, will not be sent to the client.

  • Field Details

    • UNKNOWN

      public static final CallStatus UNKNOWN
    • INTERNAL

      public static final CallStatus INTERNAL
    • INVALID_ARGUMENT

      public static final CallStatus INVALID_ARGUMENT
    • TIMED_OUT

      public static final CallStatus TIMED_OUT
    • NOT_FOUND

      public static final CallStatus NOT_FOUND
    • ALREADY_EXISTS

      public static final CallStatus ALREADY_EXISTS
    • CANCELLED

      public static final CallStatus CANCELLED
    • UNAUTHENTICATED

      public static final CallStatus UNAUTHENTICATED
    • UNAUTHORIZED

      public static final CallStatus UNAUTHORIZED
    • UNIMPLEMENTED

      public static final CallStatus UNIMPLEMENTED
    • UNAVAILABLE

      public static final CallStatus UNAVAILABLE
    • RESOURCE_EXHAUSTED

      public static final CallStatus RESOURCE_EXHAUSTED
  • Constructor Details

    • CallStatus

      public CallStatus(FlightStatusCode code, Throwable cause, String description, ErrorFlightMetadata metadata)
      Create a new status.
      Parameters:
      code - The status code.
      cause - An exception that resulted in this status (or null).
      description - A description of the status (or null).
    • CallStatus

      public CallStatus(FlightStatusCode code)
      Create a new status with no cause or description.
      Parameters:
      code - The status code.
  • Method Details

    • code

      public FlightStatusCode code()
      The status code describing the result of the RPC.
    • cause

      public Throwable cause()
      The exception that led to this result. May be null.
    • description

      public String description()
      A description of the result.
    • metadata

      public ErrorFlightMetadata metadata()
      Metadata associated with the exception. May be null.
    • withDescription

      public CallStatus withDescription(String message)
      Return a copy of this status with an error message.
    • withCause

      public CallStatus withCause(Throwable t)
      Return a copy of this status with the given exception as the cause. This will not be sent over the wire.
    • withMetadata

      public CallStatus withMetadata(ErrorFlightMetadata metadata)
      Return a copy of this status with associated exception metadata.
    • toRuntimeException

      public FlightRuntimeException toRuntimeException()
      Convert the status to an equivalent exception.
    • toString

      public String toString()
      Overrides:
      toString in class Object