Interface FlightProducer

All Known Subinterfaces:
FlightSqlProducer
All Known Implementing Classes:
BasicFlightSqlProducer, NoOpFlightProducer, NoOpFlightSqlProducer

public interface FlightProducer
API to Implement an Arrow Flight producer.
  • Method Details

    • getStream

      void getStream(FlightProducer.CallContext context, Ticket ticket, FlightProducer.ServerStreamListener listener)
      Return data for a stream.
      Parameters:
      context - Per-call context.
      ticket - The application-defined ticket identifying this stream.
      listener - An interface for sending data back to the client.
    • listFlights

      void listFlights(FlightProducer.CallContext context, Criteria criteria, FlightProducer.StreamListener<FlightInfo> listener)
      List available data streams on this service.
      Parameters:
      context - Per-call context.
      criteria - Application-defined criteria for filtering streams.
      listener - An interface for sending data back to the client.
    • getFlightInfo

      FlightInfo getFlightInfo(FlightProducer.CallContext context, FlightDescriptor descriptor)
      Get information about a particular data stream.
      Parameters:
      context - Per-call context.
      descriptor - The descriptor identifying the data stream.
      Returns:
      Metadata about the stream.
    • pollFlightInfo

      default PollInfo pollFlightInfo(FlightProducer.CallContext context, FlightDescriptor descriptor)
      Begin or get an update on execution of a long-running query.

      If the descriptor would begin a query, the server should return a response immediately to not block the client. Otherwise, the server should not return an update until progress is made to not spam the client with inactionable updates.

      Parameters:
      context - Per-call context.
      descriptor - The descriptor identifying the data stream.
      Returns:
      Metadata about execution.
    • getSchema

      default SchemaResult getSchema(FlightProducer.CallContext context, FlightDescriptor descriptor)
      Get schema for a particular data stream.
      Parameters:
      context - Per-call context.
      descriptor - The descriptor identifying the data stream.
      Returns:
      Schema for the stream.
    • acceptPut

      Accept uploaded data for a particular stream.
      Parameters:
      context - Per-call context.
      flightStream - The data stream being uploaded.
    • doExchange

      default void doExchange(FlightProducer.CallContext context, FlightStream reader, FlightProducer.ServerStreamListener writer)
      This method is used to perform a bidirectional data exchange between a client and a server.
      Parameters:
      context - Per-call context.
      reader - The FlightStream from which data is read.
      writer - The ServerStreamListener to which data is written.
      Throws:
      RuntimeException - if the method is not implemented.
    • doAction

      void doAction(FlightProducer.CallContext context, Action action, FlightProducer.StreamListener<Result> listener)
      Generic handler for application-defined RPCs.
      Parameters:
      context - Per-call context.
      action - Client-supplied parameters.
      listener - A stream of responses.
    • listActions

      List available application-defined RPCs.
      Parameters:
      context - Per-call context.
      listener - An interface for sending data back to the client.