Interface PersistentQueryControllerClient
- All Superinterfaces:
PersistentQueryScriptSource
- All Known Implementing Classes:
PersistentQueryControllerClientImpl
Implementations of this interface provide a client that can communicate with the Persistent Query Controller to query
and manage the state of Persistent Queries.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
An object that will be notified of changes to the state of the Controller.static class
A basicPersistentQueryControllerClient.Observer
implementation with do-nothing methods. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addObserver
(@NotNull PersistentQueryControllerClient.Observer observer) Add an Observer.void
addObserverAndGetData
(@NotNull PersistentQueryControllerClient.Observer observer) Add an Observer.long
addQuery
(@NotNull PersistentQueryConfigMessage config) Adds a configuration to the controller's hash table.boolean
authenticate
(@NotNull io.deephaven.enterprise.auth.AuthToken token) Use the specified auth token to authenticate this client to the hashtable server.@Nullable PersistentQueryInfoMessage
get
(long querySerial) Get theinfo
for the specified query serial.Get theinfo
for the specified query name.@Nullable PersistentQueryInfoMessage
Get theinfo
for the specified query owner and name.@NotNull ControllerConfigurationMessage
Get the currentControllerConfigurationMessage
.@NotNull Map<Long,
PersistentQueryInfoMessage> Get a copy of the current set of query data.boolean
Check if the client is connected to the Controller.default void
modifyQuery
(@NotNull PersistentQueryConfigMessage config) Modifies a configuration in the controller's hash table, and restart the query if it was running.void
modifyQuery
(@NotNull PersistentQueryConfigMessage config, boolean restartIfRunning) Modifies a configuration in the controller's hash table.void
Command the PersistentQueryController to reload parts of its configuration without requiring a controller restart.void
removeObserver
(@NotNull PersistentQueryControllerClient.Observer observer) Remove the specifiedPersistentQueryControllerClient.Observer
from the notification list.void
removeQuery
(long serialId) Removes a configuration from the controller's hash table by serial ID.default void
removeQuery
(@NotNull PersistentQueryConfigMessage config) Removes a configuration from the controller's hash table.default void
restartQueries
(@NotNull List<PersistentQueryConfigMessage> configs) Restarts one or more persistent queries.default void
restartQueriesBySerial
(@org.jetbrains.annotations.NotNull long[] querySerials) Restarts one or more persistent queries.void
restartQueriesBySerial
(@NotNull List<Long> querySerials) Restarts one or more persistent queries.default void
restartQuery
(@NotNull PersistentQueryConfigMessage config) Restart a persistent query.void
restartReplicas
(@NotNull List<ReplicaSpecifier> replicas) Restart one or more query replicas and/or spares.void
Make this client ephemeral.void
shutdown()
Shut down the client.default void
stopQueries
(@NotNull List<PersistentQueryConfigMessage> configs) Stops one or more persistent queries.default void
stopQueriesBySerial
(@org.jetbrains.annotations.NotNull long[] querySerials) Stops one or more persistent query by serial id.void
stopQueriesBySerial
(@NotNull List<Long> querySerials) Stop the specified queries by serial.default void
stopQuery
(@NotNull PersistentQueryConfigMessage config) Stops a persistent query.void
Subscribe for updates for all visible queries.void
updateQueryStatus
(long querySerial, String processInfoId, @Nullable PersistentQueryStatusEnum status, @Nullable Map<String, ExportedObjectInfoMessage> scopeFields, @Nullable Map<String, String[]> tableGroups) Publish an update for a persistent query.Methods inherited from interface io.deephaven.enterprise.dnd.controller.PersistentQueryScriptSource
getScriptBody, getScriptBody, getScriptBodyByQuery, getScriptBodyByQuery, getScriptBodyByUser, getScriptBodyByUser, getScriptPaths, getScriptPaths, getScriptPathsByQuery, getScriptPathsByQuery, getScriptPathsByUser, getScriptPathsByUser
-
Method Details
-
addObserver
Add an Observer. If the controller is available thePersistentQueryControllerClient.Observer.handleConnectionEstablished()
will be invoked immediately. No initialput
events will be generated. If you want an initial snapshot with registration useaddObserverAndGetData(Observer)
- Parameters:
observer
- thePersistentQueryControllerClient.Observer
to add
-
addObserverAndGetData
Add an Observer. If the controller is available thePersistentQueryControllerClient.Observer.handleConnectionEstablished()
will be invoked immediately. Theput
method will be immediately invoked for each existing query.- Parameters:
observer
- thePersistentQueryControllerClient.Observer
to add
-
removeObserver
Remove the specifiedPersistentQueryControllerClient.Observer
from the notification list.- Parameters:
observer
- the observer to remove.
-
get
Get theinfo
for the specified query serial.- Parameters:
querySerial
- the query serial- Returns:
- the
info
or null if it did not exist.
-
get
Get theinfo
for the specified query name.- Parameters:
name
- the name of the query- Returns:
- the
info
if it exists.
-
get
@Nullable @Nullable PersistentQueryInfoMessage get(@NotNull @NotNull String owner, @NotNull @NotNull String name) Get theinfo
for the specified query owner and name.- Parameters:
owner
- the expected owner of the queryname
- the name of the query- Returns:
- the
info
if it exists.
-
getDataCopy
Get a copy of the current set of query data.- Returns:
- a copy of the current set of queries.
-
isConnected
boolean isConnected()Check if the client is connected to the Controller.- Returns:
true
if is connected,false
otherwise
-
setEphemeral
void setEphemeral()Make this client ephemeral. An Ephemeral client will not try to reconnect once it has lost its connection. -
authenticate
boolean authenticate(@NotNull @NotNull io.deephaven.enterprise.auth.AuthToken token) Use the specified auth token to authenticate this client to the hashtable server.- Parameters:
token
- the token for authentication- Returns:
- true if authentication was successful.
-
subscribeToAll
Subscribe for updates for all visible queries. This method will block until subscription is complete, or an error occurs.- Throws:
UncheckedDeephavenException
- If an error occurs
-
shutdown
Shut down the client.- Throws:
IOException
- if an error occurs while shutting down
-
getConfiguration
Get the currentControllerConfigurationMessage
.- Returns:
- the current controller configuration
-
reloadConfiguration
void reloadConfiguration()Command the PersistentQueryController to reload parts of its configuration without requiring a controller restart. The controller will broadcast the updated configuration to all connected clients.Note that not all properties or configuration parameters may be reloaded.
-
addQuery
Adds a configuration to the controller's hash table.- Parameters:
config
- the configuration to add- Returns:
- the serial number of the added configuration
-
modifyQuery
Modifies a configuration in the controller's hash table, and restart the query if it was running.- Parameters:
config
- the updated configuration
-
modifyQuery
Modifies a configuration in the controller's hash table.- Parameters:
config
- the updated configurationrestartIfRunning
- restart the query when it is running if set to true
-
removeQuery
Removes a configuration from the controller's hash table.- Parameters:
config
- the configuration to remove
-
removeQuery
void removeQuery(long serialId) Removes a configuration from the controller's hash table by serial ID.- Parameters:
serialId
- the serial ID of configuration to remove
-
restartQuery
Restart a persistent query. This implementation delegates torestartQueries(List)
)}.- Parameters:
config
- the persistent query configuration to be restarted.
-
restartQueries
Restarts one or more persistent queries.- Parameters:
configs
- the persistent query configurations to be restarted
-
restartQueriesBySerial
default void restartQueriesBySerial(@NotNull @org.jetbrains.annotations.NotNull long[] querySerials) Restarts one or more persistent queries.- Parameters:
querySerials
- an array of serial ids to restart
-
restartQueriesBySerial
Restarts one or more persistent queries.- Parameters:
querySerials
- a list of serial ids to restart
-
restartReplicas
Restart one or more query replicas and/or spares.- Parameters:
replicas
- the replicas or spares to restart.
-
stopQuery
Stops a persistent query.- Parameters:
config
- the persistent query configuration to be stopped.
-
stopQueriesBySerial
default void stopQueriesBySerial(@NotNull @org.jetbrains.annotations.NotNull long[] querySerials) Stops one or more persistent query by serial id.- Parameters:
querySerials
- the serial ids of the persistent query configurations to be stopped
-
stopQueries
Stops one or more persistent queries.- Parameters:
configs
- the persistent query configurations to be stopped
-
stopQueriesBySerial
Stop the specified queries by serial.- Parameters:
querySerials
- the serials
-
updateQueryStatus
void updateQueryStatus(long querySerial, String processInfoId, @Nullable @Nullable PersistentQueryStatusEnum status, @Nullable @Nullable Map<String, ExportedObjectInfoMessage> scopeFields, @Nullable @Nullable Map<String, throws IOExceptionString[]> tableGroups) Publish an update for a persistent query. This is intended for use by Interactive Consoles only. Thestatus
.scopeFields
, andtableGroups
fields may all be omitted. If all three are omitted the message will be treated as a basic heartbeat.- Parameters:
querySerial
- the serial of the query this update is for.status
- an optional new statusscopeFields
- an optional map of exportable objectstableGroups
- an optional map of exportable object to ACL groups.- Throws:
IOException
- if a problem occurs during the update
-