Package io.deephaven.client.impl
Interface Session
- All Superinterfaces:
ApplicationService
,AutoCloseable
,ConfigService
,ConsoleService
,InputTableService
,ObjectService
,TableCreator<TableHandle>
,TableHandleManager
,TableService
- All Known Implementing Classes:
SessionBase
,SessionImpl
public interface Session
extends AutoCloseable, ApplicationService, ConsoleService, InputTableService, ObjectService, TableService, ConfigService
A session represents a client-side connection to a Deephaven server.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.client.impl.ApplicationService
ApplicationService.Cancel, ApplicationService.Listener
Nested 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 TypeMethodDescriptionchannel()
The authenticated channel.void
close()
Closes the session, waiting some amount of time for completion.Closes the session and return a future containing the results.CompletableFuture<? extends ServerObject>
export
(HasTypedTicket typedTicket) ExportstypedTicket
to a client-managed server object.Advanced usage, creates a new table export ID forthis
session, but must be managed by the caller.Creates a new statefulTableService
that 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.Releases an export ID.Methods inherited from interface io.deephaven.client.impl.ApplicationService
subscribeToFields
Methods inherited from interface io.deephaven.client.impl.ConfigService
getAuthenticationConstants, getConfigurationConstants
Methods inherited from interface io.deephaven.client.impl.ConsoleService
console, publish
Methods inherited from interface io.deephaven.client.impl.InputTableService
addToInputTable, deleteFromInputTable
Methods inherited from interface io.deephaven.client.impl.ObjectService
bidirectional, connect, fetch, fetchable
Methods 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, timeTable
Methods inherited from interface io.deephaven.client.impl.TableHandleManager
execute, execute, execute, executeInputs, executeInputs, executeLogic, executeLogic, executeLogic
Methods inherited from interface io.deephaven.client.impl.TableService
batch, batch, executeAsync, executeAsync, serial
-
Method Details
-
close
void close()Closes the session, waiting some amount of time for completion. Logs on error. Delegates tocloseFuture()
.- Specified by:
close
in interfaceAutoCloseable
-
closeFuture
CompletableFuture<Void> closeFuture()Closes the session and return a future containing the results. Will return the same future if invoked more than once.- Returns:
- the future
-
newExportId
ExportId newExportId()Advanced usage, creates a new table export ID forthis
session, but must be managed by the caller. Useful for more advanced integrations, particularly around doPut. Callers are responsible forreleasing
the export ID if necessary.- Returns:
- the new export ID
- See Also:
-
release
Releases an export ID.- Parameters:
exportId
- the export ID- Returns:
- the future
-
publish
Makes 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
-
export
ExportstypedTicket
to a client-managed server object.- Parameters:
typedTicket
- the typed ticket- Returns:
- the future
-
newStatefulTableService
TableService newStatefulTableService()Creates a new statefulTableService
that 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 forh1
and simply execute thewhere
operation.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"));
Whilethis
Session
also implementsTableService
, query executions againstthis
are 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:
-
channel
DeephavenChannel channel()The authenticated channel.- Returns:
- the authenticated channel
-