Interface ActionResolver

All Known Implementing Classes:
FlightSqlResolver

public interface ActionResolver
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doAction(@Nullable SessionState session, org.apache.arrow.flight.Action action, io.grpc.stub.StreamObserver<org.apache.arrow.flight.Result> observer)
    Executes the given action.
    boolean
    Returns true if this resolver is responsible for handling the action type.
    void
    listActions(@Nullable SessionState session, Consumer<org.apache.arrow.flight.ActionType> visitor)
    Invokes the visitor for the specific action types that this implementation supports for the given session; it should be the case that all consumed action types return true against handlesActionType(String).
  • Method Details

    • listActions

      void listActions(@Nullable @Nullable SessionState session, Consumer<org.apache.arrow.flight.ActionType> visitor)
      Invokes the visitor for the specific action types that this implementation supports for the given session; it should be the case that all consumed action types return true against handlesActionType(String). Unlike handlesActionType(String), the implementations should not invoke the visitor for action types in their domain that they do not implement.

      This is called in the context of ActionRouter.listActions(SessionState, Consumer) to allow flight consumers to understand the capabilities of this flight service.

      Parameters:
      session - the session
      visitor - the visitor
    • handlesActionType

      boolean handlesActionType(String type)
      Returns true if this resolver is responsible for handling the action type. Implementations should prefer to return true if they know the action type is in their domain even if they don't implement it; this allows them to provide a more specific error message for unimplemented action types.

      This is used in support of routing in ActionRouter.doAction(SessionState, Action, StreamObserver) calls.

      Parameters:
      type - the action type
      Returns:
      true if this resolver handles the action type
    • doAction

      void doAction(@Nullable @Nullable SessionState session, org.apache.arrow.flight.Action action, io.grpc.stub.StreamObserver<org.apache.arrow.flight.Result> observer)
      Executes the given action. Should only be called if handlesActionType(String) is true for the given action.

      This is called in the context of ActionRouter.doAction(SessionState, Action, StreamObserver) to allow flight consumers to execute an action against this flight service.

      Parameters:
      session - the session
      action - the action
      observer - the observer