Package io.deephaven.server.session
Class TicketRouter
java.lang.Object
io.deephaven.server.session.TicketRouter
-
Constructor Summary
ConstructorsConstructorDescriptionTicketRouter(AuthorizationProvider authorizationProvider, Set<TicketResolver> resolvers) -
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) Resolve a flight descriptor and retrieve flight info for the flight.static org.apache.arrow.flight.impl.Flight.FlightInfogetFlightInfo(Table table, org.apache.arrow.flight.impl.Flight.FlightDescriptor descriptor, org.apache.arrow.flight.impl.Flight.Ticket ticket) getLogNameFor(Ticket ticket, String logId) Create a human readable string to identify this ticket.getLogNameFor(ByteBuffer ticket, String logId) Create a human readable string to identify this ticket.getLogNameFor(org.apache.arrow.flight.impl.Flight.Ticket ticket, String logId) Create a human readable string to identify this Flight.Ticket.<T> SessionState.ExportBuilder<T>publish(SessionState session, Ticket ticket, String logId, @Nullable Runnable onPublish) Publish a new result as a flight ticket to an export object future.<T> voidpublish(SessionState session, Ticket ticket, String logId, @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.<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.<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.ExportBuilder<T>publish(SessionState session, org.apache.arrow.flight.impl.Flight.Ticket ticket, String logId, @Nullable Runnable onPublish) Publish a new result as a flight ticket to an export object future.<T> SessionState.ExportObject<T>resolve(@Nullable SessionState session, Ticket ticket, String logId) Resolve a flight ticket to an export object future.<T> SessionState.ExportObject<T>resolve(@Nullable SessionState session, ByteBuffer ticket, String logId) Resolve a flight ticket (as ByteBuffer) 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.<T> SessionState.ExportObject<T>resolve(@Nullable SessionState session, org.apache.arrow.flight.impl.Flight.Ticket ticket, String logId) Resolve a flight ticket to an export object future.voidvisitFlightInfo(@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.
-
Constructor Details
-
TicketRouter
@Inject public TicketRouter(AuthorizationProvider authorizationProvider, Set<TicketResolver> resolvers)
-
-
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 contextticket- 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
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 contextticket- 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
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 contextticket- 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
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 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
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 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
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 contextticket- (as Flight.Ticket) 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
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 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 published- Returns:
- an export object; see
SessionStatefor 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 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
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 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 accessible to callerserrorHandler- an error handler to invoke if the source fails to produce a resultsource- 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 descriptorlogId- an end-user friendly identification of the ticket should an error occur- Returns:
- an export object that will resolve to the flight descriptor; see
SessionStatefor lifecycle propagation details
-
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
-
getLogNameFor
Create a human readable string to identify this Flight.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
-
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
-
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 seesvisitor- 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)
-