Class DeephavenClusterConnection
java.lang.Object
io.deephaven.enterprise.dnd.client.DeephavenClusterConnection
An object that maintains connections to Deephaven services on a remote cluster. This is used by the Java Client to
create and subscribe to queries, and also used by Core+ workers to connect to queries on different clusters.
-
Constructor Summary
ConstructorsConstructorDescriptionDeephavenClusterConnection(String connectionUrl) Create a new, unauthenticated connection to the specified Deephaven cluster.DeephavenClusterConnection(String connectionUrl, int corePoolSize, long controllerHeartBeatPeriodMillis, long controllerHeartBeatTimeoutMillis) Create a new, unauthenticated connection to the specified Deephaven cluster. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close all connections to the remote host.booleandelegateToken(AuthToken delegateToken) Use a delegate token to authenticate.Get theAuthenticationClientfor the cluster.io.deephaven.enterprise.controller.client.ControllerClientGrpcGet thecontroller clientfor the cluster.Get theScheduledExecutorServiceused for connections created by this object.Get the authenticatedUserContextfor this object.io.grpc.ManagedChannelmakeGrpcChannel(String host, int port, Map<String, String> extraHeaders) Construct a gRPC channel for communication with the Persistent QuerybooleanAuthenticate with the server using a username and passwordbooleanprivateKey(String keyFile) Authenticate to the server using a private key file.voidsetMaxInboundMessageSize(int maxInboundMessageSize) Set the maximum inbound message size for connections created by this object.
-
Constructor Details
-
DeephavenClusterConnection
Create a new, unauthenticated connection to the specified Deephaven cluster. Users should call one ofpassword(String, String),privateKey(String)ordelegateToken(AuthToken)to authenticate with the server before accessing the provided services. This call uses defaults for the corePoolSize (4), the controller heartbeat period (10 seconds) and the controller heart beat timeout (2 seconds).- Parameters:
connectionUrl- the url of the remote system in the format `https://server-address:port/iris/connection.json`- Throws:
IOException- if there is a problem establishing a connection to the remote cluster
-
DeephavenClusterConnection
public DeephavenClusterConnection(@NotNull String connectionUrl, int corePoolSize, long controllerHeartBeatPeriodMillis, long controllerHeartBeatTimeoutMillis) throws IOException Create a new, unauthenticated connection to the specified Deephaven cluster. Users should call one ofpassword(String, String),privateKey(String)ordelegateToken(AuthToken)to authenticate with the server before accessing the provided services.- Parameters:
connectionUrl- the url of the remote system in the format `https://server-address:port/iris/connection.json`corePoolSize- the size of the Core+ thread poolcontrollerHeartBeatPeriodMillis- heartbeat period to the controller, in millisecondscontrollerHeartBeatTimeoutMillis- heartbeat timeout to the controller, in milliseconds- Throws:
IOException- if there is a problem establishing a connection to the remote cluster
-
-
Method Details
-
close
public void close()Close all connections to the remote host. -
password
Authenticate with the server using a username and password- Parameters:
user- the usernamepassword- the password- Returns:
- true if successfully authenticated, false otherwise.
-
privateKey
Authenticate to the server using a private key file.- Parameters:
keyFile- the private key file- Returns:
- true if successfully authenticated, false otherwise.
-
delegateToken
Use a delegate token to authenticate.- Parameters:
delegateToken- the token to authenticate with- Returns:
- true if successfully authenticated, false otherwise.
-
setMaxInboundMessageSize
public void setMaxInboundMessageSize(int maxInboundMessageSize) Set the maximum inbound message size for connections created by this object.- Parameters:
maxInboundMessageSize- the new max inbound message size
-
getControllerClient
public io.deephaven.enterprise.controller.client.ControllerClientGrpc getControllerClient()Get thecontroller clientfor the cluster. The controller client will automatically be authenticated when any of the authentication methods have completed successfully.- Returns:
- the
ControllerClientGrpc
-
getAuthenticationClient
Get theAuthenticationClientfor the cluster.- Returns:
- the authentication client
-
getExecutor
Get theScheduledExecutorServiceused for connections created by this object.- Returns:
- the
ScheduledExecutorService
-
getUserContext
Get the authenticatedUserContextfor this object.- Returns:
- the authenticated
UserContext - Throws:
NotAuthenticatedException- if this connection has not been authenticated
-
makeGrpcChannel
public io.grpc.ManagedChannel makeGrpcChannel(@NotNull String host, int port, @Nullable Map<String, String> extraHeaders) throws IOExceptionConstruct a gRPC channel for communication with the Persistent Query- Parameters:
host- the host of the queryport- the port of the queryextraHeaders- a map of any extra HTTP headers to include, or null if none.- Returns:
- a new
ManagedChannelfor communication with the Persistent Query - Throws:
IOException- if there was a problem creating the channel
-