barrage_session

The barrage_session function creates a new Deephaven gRPC session (BarrageSession) to a remote server. Each call opens its own connection. Use the session's subscribe and snapshot methods to retrieve remote tables, and close it when you are done.

Syntax

Parameters

ParameterTypeDescription
hoststr

The host name or IP address of the Deephaven server.

port optionalint

The port number that the remote Deephaven server is listening on. The default value is 10000.

auth_type optionalstr

The authentication type string. Can be "Anonymous", "Basic", or any custom-built authenticator in the server, such as "io.deephaven.authentication.psk.PskAuthenticationHandler". The default is "Anonymous".

auth_token optionalstr

The authentication token string. When auth_type is Basic, it must be the Base64 encoding of user:password; unlike pydeephaven.Session, barrage_session sends the token as is and does not encode it for you. When auth_type is Anonymous, leave auth_token empty; a non-empty token is sent to the server, which rejects it. When auth_type is a custom-built authenticator, auth_token must conform to the specific requirements of the authenticator.

use_tls optionalbool

If True, the connection will be encrypted using TLS. The default is False.

tls_root_certs optionalbytes

The PEM-encoded root certificates to use for TLS connection, or None (or an empty value) to use the local server's outbound TLS configuration (the outbound.ssl.* properties, or otherwise the server's own SSL configuration) together with the JDK's default trust store. barrage_session has no client certificate (mutual TLS) parameters; a client identity in the local server's outbound.ssl.* configuration is used only when tls_root_certs is None or empty, because a non-empty value replaces that configuration. A non-empty value requires a TLS connection, so use_tls must also be True; otherwise, barrage_session raises an error. Defaults to None.

extra_headers optionaldict[str, str]

Extra headers to set when configuring the gRPC channel. Defaults to None.

accept_compression optionalUnion[str, Sequence[str]]

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 these types; see Compress Barrage data. None accepts every supported type. An empty sequence accepts none, so data is always sent uncompressed. Defaults to None.

Returns

A BarrageSession.

Examples

The following example creates a BarrageSession on a Deephaven server running on localhost at port 10000. Every example except the pre-shared-key one uses the default anonymous authentication, so the target server must allow anonymous authentication (-DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler); the default server configuration uses pre-shared key authentication.

The following example connects to a BarrageSession on a Deephaven server running on localhost at port 9999. This example will fail unless there is already a Deephaven server running on localhost at port 9999.

The following example connects to a Deephaven server running on a remote host at IP address 192.0.2.1 and port 10000. This example will fail unless there is already a Deephaven server running at the specified IP address and port.

The following example connects to a Deephaven server running on localhost at port 9999, with pre-shared-key (PSK) authentication. This example will fail unless there is already a Deephaven server running on localhost at port 9999, with matching PSK authentication.

The following example creates a session that accepts only zstd compression from the remote server. Tables that do not allow zstd still arrive uncompressed.