Class TicketRouter

java.lang.Object
io.deephaven.server.session.TicketRouter

@Singleton public class TicketRouter extends Object
  • Constructor Details

  • Method Details

    • resolve

      public <T> SessionState.ExportObject<T> resolve(@Nullable @Nullable SessionState session, ByteBuffer ticket, String logId)
      Resolve a flight ticket (as ByteBuffer) to an export object future.
      Type Parameters:
      T - the expected return type of the ticket; this is not validated
      Parameters:
      session - the user session context
      ticket - the ticket to resolve
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      an export object; see SessionState for lifecycle propagation details
    • resolve

      public <T> SessionState.ExportObject<T> resolve(@Nullable @Nullable SessionState session, org.apache.arrow.flight.impl.Flight.Ticket ticket, String logId)
      Resolve a flight ticket to an export object future.
      Type Parameters:
      T - the expected return type of the ticket; this is not validated
      Parameters:
      session - the user session context
      ticket - the ticket to resolve
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      an export object; see SessionState for lifecycle propagation details
    • resolve

      public <T> SessionState.ExportObject<T> resolve(@Nullable @Nullable SessionState session, Ticket ticket, String logId)
      Resolve a flight ticket to an export object future.
      Type Parameters:
      T - the expected return type of the ticket; this is not validated
      Parameters:
      session - the user session context
      ticket - the ticket to resolve
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      an export object; see SessionState for lifecycle propagation details
    • resolve

      public <T> SessionState.ExportObject<T> resolve(@Nullable @Nullable SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId)
      Resolve a flight descriptor to an export object future.
      Type Parameters:
      T - the expected return type of the ticket; this is not validated
      Parameters:
      session - the user session context
      descriptor - the descriptor to resolve
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      an export object; see SessionState for lifecycle propagation details
    • publish

      public <T> SessionState.ExportBuilder<T> publish(SessionState session, ByteBuffer ticket, String logId, @Nullable @Nullable Runnable onPublish)
      Publish a new result as a flight ticket to an export object future.

      The user must call SessionState.ExportBuilder.submit(java.util.concurrent.Callable<T>) to publish the result value.

      Type Parameters:
      T - the type of the result the export will publish
      Parameters:
      session - the user session context
      ticket - (as ByteByffer) the ticket to publish to
      logId - an end-user friendly identification of the ticket should an error occur
      onPublish - an optional callback to invoke when the result is published
      Returns:
      an export object; see SessionState for lifecycle propagation details
    • publish

      public <T> SessionState.ExportBuilder<T> publish(SessionState session, org.apache.arrow.flight.impl.Flight.Ticket ticket, String logId, @Nullable @Nullable Runnable onPublish)
      Publish a new result as a flight ticket to an export object future.

      The user must call SessionState.ExportBuilder.submit(java.util.concurrent.Callable<T>) to publish the result value.

      Type Parameters:
      T - the type of the result the export will publish
      Parameters:
      session - the user session context
      ticket - (as Flight.Ticket) the ticket to publish to
      logId - an end-user friendly identification of the ticket should an error occur
      onPublish - an optional callback to invoke when the result is published
      Returns:
      an export object; see SessionState for lifecycle propagation details
    • publish

      public <T> SessionState.ExportBuilder<T> publish(SessionState session, Ticket ticket, String logId, @Nullable @Nullable Runnable onPublish)
      Publish a new result as a flight ticket to an export object future.

      The user must call SessionState.ExportBuilder.submit(java.util.concurrent.Callable<T>) to publish the result value.

      Type Parameters:
      T - the type of the result the export will publish
      Parameters:
      session - the user session context
      ticket - the ticket to publish to
      logId - an end-user friendly identification of the ticket should an error occur
      onPublish - an optional callback to invoke when the result is published
      Returns:
      an export object; see SessionState for lifecycle propagation details
    • publish

      public <T> SessionState.ExportBuilder<T> publish(SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId, @Nullable @Nullable Runnable onPublish)
      Publish a new result as a flight descriptor to an export object future.

      The user must call SessionState.ExportBuilder.submit(java.util.concurrent.Callable<T>) to publish the result value.

      Type Parameters:
      T - the type of the result the export will publish
      Parameters:
      session - the user session context
      descriptor - (as Flight.Descriptor) the descriptor to publish to
      logId - an end-user friendly identification of the ticket should an error occur
      onPublish - an optional callback to invoke when the result is published
      Returns:
      an export object; see SessionState for lifecycle propagation details
    • publish

      public <T> void publish(SessionState session, Ticket ticket, String logId, @Nullable @Nullable Runnable onPublish, SessionState.ExportErrorHandler errorHandler, SessionState.ExportObject<T> source)
      Publish a new result as a flight ticket as to-be defined by the supplied source.
      Type Parameters:
      T - the type of the result the export will publish
      Parameters:
      session - the user session context
      ticket - the ticket to publish to
      logId - an end-user friendly identification of the ticket should an error occur
      onPublish - an optional callback to invoke when the result is accessible to callers
      errorHandler - an error handler to invoke if the source fails to produce a result
      source - the source object to publish
    • flightInfoFor

      public SessionState.ExportObject<org.apache.arrow.flight.impl.Flight.FlightInfo> flightInfoFor(@Nullable @Nullable SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId)
      Resolve a flight descriptor and retrieve flight info for the flight.
      Parameters:
      session - the user session context; ticket resolvers may expose flights that do not require a session (such as via DoGet)
      descriptor - the flight descriptor
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      an export object that will resolve to the flight descriptor; see SessionState for lifecycle propagation details
    • getLogNameFor

      public String getLogNameFor(Ticket ticket, String logId)
      Create a human readable string to identify this ticket.
      Parameters:
      ticket - the ticket to parse
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      a string that is good for log/error messages
    • getLogNameFor

      public String getLogNameFor(org.apache.arrow.flight.impl.Flight.Ticket ticket, String logId)
      Create a human readable string to identify this Flight.Ticket.
      Parameters:
      ticket - the ticket to parse
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      a string that is good for log/error messages
    • getLogNameFor

      public String getLogNameFor(ByteBuffer ticket, String logId)
      Create a human readable string to identify this ticket.
      Parameters:
      ticket - the ticket to parse
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      a string that is good for log/error messages
    • visitFlightInfo

      public void visitFlightInfo(@Nullable @Nullable SessionState session, Consumer<org.apache.arrow.flight.impl.Flight.FlightInfo> visitor)
      This invokes the provided visitor for each valid flight descriptor this ticket resolver exposes via flight.
      Parameters:
      session - optional session that the resolver can use to filter which flights a visitor sees
      visitor - the callback to invoke per descriptor path
    • getFlightInfo

      public static org.apache.arrow.flight.impl.Flight.FlightInfo getFlightInfo(Table table, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, org.apache.arrow.flight.impl.Flight.Ticket ticket)