Class ScopeTicketResolver

All Implemented Interfaces:
PathResolver, TicketResolver

@Singleton public class ScopeTicketResolver extends TicketResolverBase
  • Constructor Details

  • Method Details

    • getLogNameFor

      public String getLogNameFor(ByteBuffer ticket, String logId)
      Description copied from interface: TicketResolver
      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
    • 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)
      Description copied from interface: TicketResolver
      Retrieve a FlightInfo for a given FlightDescriptor.
      descriptor - the flight descriptor to retrieve a ticket for
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      a FlightInfo describing this flight
    • forAllFlightInfo

      public void forAllFlightInfo(@Nullable @Nullable SessionState session, Consumer<org.apache.arrow.flight.impl.Flight.FlightInfo> visitor)
      Description copied from interface: TicketResolver
      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
    • resolve

      public <T> SessionState.ExportObject<T> resolve(@Nullable @Nullable SessionState session, ByteBuffer ticket, String logId)
      Description copied from interface: TicketResolver
      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 - (as ByteByffer) 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)
      Description copied from interface: TicketResolver
      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)
      Description copied from interface: TicketResolver
      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.FlightDescriptor descriptor, String logId, @Nullable @Nullable Runnable onPublish)
      Description copied from interface: TicketResolver
      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
    • flightTicketForName

      public static org.apache.arrow.flight.impl.Flight.Ticket flightTicketForName(String name)
      Convenience method to convert from a scoped variable name to Flight.Ticket
      Parameters:
      name - the scoped variable name to convert
      Returns:
      the flight ticket this descriptor represents
    • ticketForName

      public static Ticket ticketForName(String name)
      Convenience method to convert from a scoped variable name to Ticket
      Parameters:
      name - the scoped variable name to convert
      Returns:
      the flight ticket this descriptor represents
    • descriptorForName

      public static org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptorForName(String name)
      Convenience method to convert from a scoped variable name to Flight.FlightDescriptor
      Parameters:
      name - the scoped variable name to convert
      Returns:
      the flight descriptor this descriptor represents
    • nameForTicket

      public static String nameForTicket(ByteBuffer ticket, String logId)
      Convenience method to convert from a Flight.Ticket (as ByteBuffer) to scope variable name
      Parameters:
      ticket - the ticket to convert
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      the query scope name this ticket represents
    • nameForDescriptor

      public static String nameForDescriptor(org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId)
      Convenience method to convert from a Flight.FlightDescriptor to scoped Variable Name
      Parameters:
      descriptor - the descriptor to convert
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      the query scope name this descriptor represents
    • ticketToDescriptor

      public static org.apache.arrow.flight.impl.Flight.FlightDescriptor ticketToDescriptor(org.apache.arrow.flight.impl.Flight.Ticket ticket, String logId)
      Convenience method to convert from a Flight.Ticket to a Flight.FlightDescriptor.
      Parameters:
      ticket - the ticket to convert
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      a flight descriptor that represents the ticket
    • descriptorToTicket

      public static org.apache.arrow.flight.impl.Flight.Ticket descriptorToTicket(org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId)
      Convenience method to convert from a Flight.Descriptor to a Flight.Ticket.
      Parameters:
      descriptor - the descriptor to convert
      logId - an end-user friendly identification of the ticket should an error occur
      Returns:
      a flight ticket that represents the descriptor