Package io.deephaven.server.session
Interface TicketResolver
- All Known Subinterfaces:
CommandResolver,PathResolver
- All Known Implementing Classes:
ApplicationTicketResolver,ExportTicketResolver,FlightSqlResolver,PathResolverPrefixedBase,ScopeTicketResolver,SharedTicketResolver,TicketResolverBase
public interface TicketResolver
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionSessionState.ExportObject<org.apache.arrow.flight.impl.Flight.FlightInfo>flightInfoFor(@Nullable SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId) Retrieve a FlightInfo for a given FlightDescriptor.voidforAllFlightInfo(@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.getLogNameFor(ByteBuffer ticket, String logId) Create a human readable string to identify this ticket.<T> SessionState.ExportBuilder<T>publish(SessionState session, ByteBuffer ticket, String logId, @Nullable Runnable onPublish) Publish a new result as a flight ticket to an export object future.default <T> voidpublish(SessionState session, ByteBuffer ticket, String logId, @Nullable Runnable onPublish, SessionState.ExportErrorHandler errorHandler, SessionState.ExportObject<T> source) Publish the result of the source object as the result represented by the destination ticket.<T> SessionState.ExportBuilder<T>publish(SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId, @Nullable Runnable onPublish) Publish a new result as a flight descriptor to an export object future.<T> SessionState.ExportObject<T>resolve(@Nullable SessionState session, ByteBuffer ticket, String logId) Resolve a flight ticket to an export object future.<T> SessionState.ExportObject<T>resolve(@Nullable SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId) Resolve a flight descriptor to an export object future.byteTickets are disambiguated by their first byte.
-
Method Details
-
ticketRoute
byte ticketRoute()Tickets are disambiguated by their first byte. Each resolver claims one byte; and there may not be any duplicates. Some ticket resolvers do not produce any tickets, but rather depend entirely on Flight descriptors, in which case they do not require a byte, in those cases the resolver should return 0 indicating that no ticket prefix is necessary.- Returns:
- the single byte prefix used as a route on the ticket; or zero for no ticket resolution
-
resolve
<T> SessionState.ExportObject<T> resolve(@Nullable @Nullable SessionState session, ByteBuffer 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 contextticket- (as ByteByffer) the ticket to resolvelogId- an end-user friendly identification of the ticket should an error occur- Returns:
- an export object; see
SessionStatefor lifecycle propagation details
-
resolve
<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 contextdescriptor- the descriptor to resolvelogId- an end-user friendly identification of the ticket should an error occur- Returns:
- an export object; see
SessionStatefor lifecycle propagation details
-
publish
<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 contextticket- (as ByteByffer) the ticket to publish tologId- an end-user friendly identification of the ticket should an error occuronPublish- an optional callback to invoke when the result is published- Returns:
- an export object; see
SessionStatefor lifecycle propagation details
-
publish
<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 contextdescriptor- (as Flight.Descriptor) the descriptor to publish tologId- an end-user friendly identification of the ticket should an error occuronPublish- an optional callback to invoke when the result is published- Returns:
- an export object; see
SessionStatefor lifecycle propagation details
-
publish
default <T> void publish(SessionState session, ByteBuffer ticket, String logId, @Nullable @Nullable Runnable onPublish, SessionState.ExportErrorHandler errorHandler, SessionState.ExportObject<T> source) Publish the result of the source object as the result represented by the destination ticket.- Type Parameters:
T- the type of the result the export will publish- Parameters:
session- the user session contextticket- the ticket to publish tologId- an end-user friendly identification of the ticket should an error occuronPublish- an optional callback to invoke when the result is publishederrorHandler- the error handler to invoke if the source object fails to exportsource- the source object to export
-
flightInfoFor
SessionState.ExportObject<org.apache.arrow.flight.impl.Flight.FlightInfo> flightInfoFor(@Nullable @Nullable SessionState session, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, String logId) Retrieve a FlightInfo for a given FlightDescriptor.- Parameters:
descriptor- the flight descriptor to retrieve a ticket forlogId- an end-user friendly identification of the ticket should an error occur- Returns:
- a FlightInfo describing this flight
-
getLogNameFor
Create a human readable string to identify this ticket.- Parameters:
ticket- the ticket to parselogId- an end-user friendly identification of the ticket should an error occur- Returns:
- a string that is good for log/error messages
- ApiNote:
- There is not a
Flight.FlightDescriptorequivalent as the path must already be displayable.
-
forAllFlightInfo
void forAllFlightInfo(@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 seesvisitor- the callback to invoke per descriptor path
-