Class SessionImpl
- All Implemented Interfaces:
ApplicationService,ConfigService,ConsoleService,InputTableService,ObjectService,Session,TableHandleManager,TableService,TableCreator<TableHandle>,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.client.impl.ApplicationService
ApplicationService.Cancel, ApplicationService.ListenerNested classes/interfaces inherited from interface io.deephaven.client.impl.ObjectService
ObjectService.Bidirectional, ObjectService.Fetchable, ObjectService.MessageStream<Message>Nested classes/interfaces inherited from interface io.deephaven.qst.TableCreator
TableCreator.OperationsToTable<TOPS extends TableOperations<TOPS,TABLE>, TABLE>, TableCreator.TableToOperations<TOPS extends TableOperations<TOPS, TABLE>, TABLE> Nested classes/interfaces inherited from interface io.deephaven.client.impl.TableService
TableService.TableHandleFuture -
Method Summary
Modifier and TypeMethodDescriptionaddToInputTable(HasTicketId destination, HasTicketId source) Addsourceto the input tabledestination.batch()A batch table handle manager.batch(boolean mixinStacktraces) A batch table handle manager.CompletableFuture<? extends ObjectService.Bidirectional>bidirectional(HasTypedTicket typedTicket) ExportstypedTicketto a client-managed bidirectional server object.channel()The authenticated channel.voidclose()Closes the session, waiting some amount of time for completion.Closes the session and return a future containing the results.connect(HasTypedTicket typedTicket, ObjectService.MessageStream<ServerData> receiveStream) The low-level interface for initiating a connection for a bidirectional message stream fortypedTicket.CompletableFuture<? extends ConsoleSession>Creates a new console session of script typetype.static SessionImplcreate(SessionImplConfig config) Creates a session.static SessionImplcreate(SessionImplConfig config, Authentication authentication) protected TableServicedelegate()deleteFromInputTable(HasTicketId destination, HasTicketId source) Deletesourcefrom the input tabledestination.executeAsync(TableSpec table) Executes the giventableand returns a future.List<? extends TableService.TableHandleFuture>executeAsync(Iterable<? extends TableSpec> tables) Executes the giventablesand returns a future for each.CompletableFuture<? extends ServerObject>export(HasTypedTicket typedTicket) ExportstypedTicketto a client-managed server object.fetch(HasTypedTicket typedTicket) The low-level interface for fetching data.CompletableFuture<? extends ObjectService.Fetchable>fetchable(HasTypedTicket typedTicket) ExportstypedTicketto a client-managed fetchable server object.Returns constants from the server that may be helpful to correctly authenticate with the server.Returns constants from the server that are specified as being appropriate for clients to read.Advanced usage, creates a new table export ID forthissession, but must be managed by the caller.Creates a new statefulTableServicethat keeps references to the exports created from said service for executing queries with maximum cacheability.publish(HasTicketId resultId, HasTicketId sourceId) Makes a copy from a source ticket and publishes to a result ticket.publish(String name, HasTicketId ticketId) Publishesticketinto the global scope withname.Releases an export ID.serial()A serial table handle manager.subscribeToFields(ApplicationService.Listener listener) Methods inherited from class io.deephaven.client.impl.TableHandleManagerDelegate
emptyTable, execute, execute, execute, executeInputs, executeInputs, executeLogic, executeLogic, executeLogic, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, multiJoin, newTable, newTable, of, of, of, of, of, timeTable, timeTableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.qst.TableCreator
emptyTable, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, multiJoin, newTable, newTable, of, of, of, of, of, ticket, ticket, timeTable, timeTableMethods inherited from interface io.deephaven.client.impl.TableHandleManager
execute, execute, execute, executeInputs, executeInputs, executeLogic, executeLogic, executeLogicMethods inherited from interface io.deephaven.client.impl.TableService
executeAsync, executeAsync
-
Method Details
-
create
Creates a session. Closing the session does not close the underlying channel.- Parameters:
config- the config- Returns:
- the session
- Throws:
InterruptedException- if the thread is interrupted
-
create
-
_hackBearerHandler
-
newStatefulTableService
Description copied from interface:SessionCreates a new statefulTableServicethat keeps references to the exports created from said service for executing queries with maximum cacheability. This allows callers to implicitly take advantage of existing exports when they are executing new queries. In the following example, the second query does not need to re-execute from the beginning; it is able to build off of the export forh1and simply execute thewhereoperation.TableServices ts = session.tableServices(); TableHandle h1 = ts.execute(TableSpec.emptyTable(42).view("I=ii")); TableHandle h2 = ts.execute(TableSpec.emptyTable(42).view("I=ii").where("I % 2 == 0"));WhilethisSessionalso implementsTableService, query executions againstthisare not cached. In the following example, the second query is re-executed from the beginning.TableHandle h1 = session.execute(TableSpec.emptyTable(42).view("I=ii")); TableHandle h2 = session.execute(TableSpec.emptyTable(42).view("I=ii").where("I % 2 == 0"));When using a statefulTableService, callers may encounter exceptions that refer to an "unreferenceable table". This is an indication that the caller is trying to export a strict sub-DAG of the existing exports; this is problematic because there isn't (currently) a way to construct a query that guarantees the returned export would refer to the same physical table that the existing exports are based on. The following example demonstrates a case where such an exception would occur.TableServices ts = session.tableServices(); TableHandle h1 = ts.execute(TableSpec.emptyTable(42).view("I=ii").where("I % 2 == 0")); // This execution will throw an "unreferenceable table" exception. TableHandle h2 = ts.execute(TableSpec.emptyTable(42).view("I=ii"));- Returns:
- a new stateful table services
- See Also:
-
batch
Description copied from interface:TableServiceA batch table handle manager.- Returns:
- a batch manager
-
batch
Description copied from interface:TableServiceA batch table handle manager.When
mixinStacktraces == true, preemptive stacktraces will taken in the theTableCreationLogicmethods. While relatively expensive, in exceptional circumstances this mixin allows errors to be more appropriately attributed with their source.- Parameters:
mixinStacktraces- if stacktraces should be mixin- Returns:
- a batch manager
-
serial
Description copied from interface:TableServiceA serial table handle manager.- Returns:
- a serial manager
-
console
Description copied from interface:ConsoleServiceCreates a new console session of script typetype.Note: the server does not currently support independent console sessions. See Issue 1172.
- Parameters:
type- the script type- Returns:
- the console session future
-
publish
Description copied from interface:ConsoleServicePublishesticketinto the global scope withname.- Parameters:
name- the name, must conform toSourceVersion.isName(CharSequence)ticketId- the export ID- Returns:
- the publish completable future
-
publish
Description copied from interface:SessionMakes a copy from a source ticket and publishes to a result ticket. Neither the source ticket, nor the destination ticket, need to be a client managed ticket.- Parameters:
resultId- the result idsourceId- the source id- Returns:
- the future
-
fetch
Description copied from interface:ObjectServiceThe low-level interface for fetching data. SeeObjectService.fetchable(HasTypedTicket)for a higher-level interface.- Parameters:
typedTicket- the typed ticket- Returns:
- the future
-
connect
public ObjectService.MessageStream<ClientData> connect(HasTypedTicket typedTicket, ObjectService.MessageStream<ServerData> receiveStream) Description copied from interface:ObjectServiceThe low-level interface for initiating a connection for a bidirectional message stream fortypedTicket. SeeObjectService.bidirectional(HasTypedTicket)for a higher-level interface.Opens a bidirectional message stream for a
typedTicket. References sent to the server are generictyped tickets, while the references received from the server areserver objects. The caller is responsible forreleasingorclosingthe server objects.This provides a generic stream feature for Deephaven instances to use to add arbitrary functionality. This API lets a client open a stream to a particular object on the server, to be mediated by a server side plugin. In theory this could effectively be used to "tunnel" a custom gRPC call, but in practice there are a few deliberate shortcomings that still make this possible, but not trivial.
Presently it is required that the server respond immediately, at least to acknowledge that the object was correctly contacted (as opposed to waiting for a pending ticket, or dealing with network lag, etc). This is a small (and possibly not required, but convenient) departure from a offering a gRPC stream (a server-streaming or bidi-streaming call need not send a message right away).
- Parameters:
typedTicket- the typed ticketreceiveStream- the stream where the client will receive messages- Returns:
- the stream where the client will send messages
-
export
Description copied from interface:SessionExportstypedTicketto a client-managed server object.- Parameters:
typedTicket- the typed ticket- Returns:
- the future
-
fetchable
Description copied from interface:ObjectServiceExportstypedTicketto a client-managed fetchable server object.- Parameters:
typedTicket- the typed ticket- Returns:
- the future
- See Also:
-
bidirectional
public CompletableFuture<? extends ObjectService.Bidirectional> bidirectional(HasTypedTicket typedTicket) Description copied from interface:ObjectServiceExportstypedTicketto a client-managed bidirectional server object.- Parameters:
typedTicket- the typed ticket- Returns:
- the future
- See Also:
-
close
public void close()Description copied from interface:SessionCloses the session, waiting some amount of time for completion. Logs on error. Delegates toSession.closeFuture(). -
closeFuture
Description copied from interface:SessionCloses the session and return a future containing the results. Will return the same future if invoked more than once.- Returns:
- the future
-
delegate
-
newExportId
Description copied from interface:SessionAdvanced usage, creates a new table export ID forthissession, but must be managed by the caller. Useful for more advanced integrations, particularly around doPut. Callers are responsible forreleasingthe export ID if necessary.- Returns:
- the new export ID
- See Also:
-
release
Description copied from interface:SessionReleases an export ID.- Parameters:
exportId- the export ID- Returns:
- the future
-
channel
Description copied from interface:SessionThe authenticated channel.- Returns:
- the authenticated channel
-
addToInputTable
Description copied from interface:InputTableServiceAddsourceto the input tabledestination.- Parameters:
destination- the input tablesource- the source to add- Returns:
- the future
-
deleteFromInputTable
Description copied from interface:InputTableServiceDeletesourcefrom the input tabledestination.- Parameters:
destination- the input tablesource- the source to delete- Returns:
- the future
-
subscribeToFields
-
getAuthenticationConstants
Description copied from interface:ConfigServiceReturns constants from the server that may be helpful to correctly authenticate with the server. As such, authentication is not required to obtain these values. -
getConfigurationConstants
Description copied from interface:ConfigServiceReturns constants from the server that are specified as being appropriate for clients to read. By default these include values like the suggested authentication token refresh interval, and the server-side version of deephaven, barrage, and java. -
executeAsync
Description copied from interface:TableServiceExecutes the giventableand returns a future. If this is a stateful instance, the request will build off of the existing exports.- Specified by:
executeAsyncin interfaceTableService- Parameters:
table- the table spec- Returns:
- the table handle future
-
executeAsync
public List<? extends TableService.TableHandleFuture> executeAsync(Iterable<? extends TableSpec> tables) Description copied from interface:TableServiceExecutes the giventablesand returns a future for each. If this is a stateful instance, the request will build off of the existing exports.- Specified by:
executeAsyncin interfaceTableService- Parameters:
tables- the tables specs- Returns:
- the table handle futures
-