deephaven.barrage¶
This module defines the BarrageSession wrapper class and provides a factory function to create an instance of it for accessing resources on remote Deephaven servers.
- class BarrageSession(j_barrage_session, j_managed_channel=None)[source]¶
Bases:
objectA Deephaven Barrage session to a remote server.
Initializes a Barrage session.
When BarrageSession is created via the barrage_session() factory function, j_managed_channel is always provided, and when BarrageSession.close() is called, it will shut down the channel as well as close the j_barrage_session.
When BarrageSession is initialized directly and j_managed_channel is None, when BarrageSession.close() is called, it will only close the j_barrage_session, it is the responsibility of the user to shut down the associated channel if needed.
- close()[source]¶
Closes the barrage session.
If the BarrageSession is initialized with a managed channel, the channel will be shut down as well.
- Return type:
None
- snapshot(ticket)[source]¶
Returns a snapshot of a published remote table with the given ticket.
Note, if the remote table is closed or its owner session is closed, the ticket becomes invalid. If the same ticket is snapshot multiple times, multiple snapshots will be created.
- barrage_session(host, port=10000, auth_type='Anonymous', auth_token='', use_tls=False, tls_root_certs=None, extra_headers=None, accept_compression=None)[source]¶
Creates a new Deephaven gRPC session to a remote server. Each call returns a new session.
Note: this function has no arguments for a TLS client certificate or private key. For mutual TLS, set the server’s outbound SSL identity with the “outbound.ssl.identity.*” configuration properties and pass use_tls=True without tls_root_certs. Passing tls_root_certs replaces the server’s outbound SSL configuration, including its client identity.
- Parameters:
host (
str) – the host name or IP address of the Deephaven server.port (
int) – the port number that the remote Deephaven server is listening on, default is 10000.auth_type (
str) – the authentication type string, can be ‘Anonymous’, ‘Basic’, or any custom-built authenticator in the server, such as “io.deephaven.authentication.psk.PskAuthenticationHandler”, default is ‘Anonymous’.auth_token (
str) – the authentication token string. When auth_type is ‘Basic’, it must be the Base64 encoding of “user:password”; this function sends it as is, without encoding it. When auth_type is ‘Anonymous’, leave it empty, since authentication fails with a non-empty token. When auth_type is a custom-built authenticator, it must conform to the specific requirement of the authenticatoruse_tls (
bool) – if True, use a TLS connection. Defaults to Falsetls_root_certs (
bytes|None) – PEM encoded root certificates to use for the TLS connection, or None to use the server’s outbound TLS configuration and the JDK’s default trusted certificates. If set, use_tls must be True. Defaults to Noneextra_headers (
dict[str,str] |None) – extra headers to set when configuring the gRPC channel. Defaults to None.accept_compression (
str|Sequence[str] |None) – the compression type, or types, that the session accepts, such as “gzip”, “zstd” and “snappy”. The remote server compresses only tables that allow one of them. None accepts every supported type; an empty sequence accepts none, so data is always sent uncompressed. Defaults to None.
- Return type:
- Returns:
a Deephaven Barrage session
- Raises:
DHError –