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 interfaceAn object that will be notified of changes to the state of the Controller.static classA basicPersistentQueryControllerClient.Observerimplementation with do-nothing methods. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(@NotNull PersistentQueryControllerClient.Observer observer) Add an Observer.voidaddObserverAndGetData(@NotNull PersistentQueryControllerClient.Observer observer) Add an Observer.longaddQuery(@NotNull PersistentQueryConfigMessage config) Adds a configuration to the controller's hash table.booleanauthenticate(@NotNull AuthToken token) Use the specified auth token to authenticate this client to the hashtable server.@Nullable PersistentQueryInfoMessageget(long querySerial) Get theinfofor the specified query serial.Get theinfofor the specified query name.@Nullable PersistentQueryInfoMessageGet theinfofor the specified query owner and name.@NotNull ControllerConfigurationMessageGet the currentControllerConfigurationMessage.@NotNull Map<Long,PersistentQueryInfoMessage> Get a copy of the current set of query data.booleanCheck if the client is connected to the Controller.default voidmodifyQuery(@NotNull PersistentQueryConfigMessage config) Modifies a configuration in the controller's hash table, and restart the query if it was running.voidmodifyQuery(@NotNull PersistentQueryConfigMessage config, boolean restartIfRunning) Modifies a configuration in the controller's hash table.voidCommand the PersistentQueryController to reload parts of its configuration without requiring a controller restart.voidremoveObserver(@NotNull PersistentQueryControllerClient.Observer observer) Remove the specifiedPersistentQueryControllerClient.Observerfrom the notification list.voidremoveQuery(long serialId) Removes a configuration from the controller's hash table by serial ID.default voidremoveQuery(@NotNull PersistentQueryConfigMessage config) Removes a configuration from the controller's hash table.default voidrestartQueries(@NotNull List<PersistentQueryConfigMessage> configs) Restarts one or more persistent queries.default voidrestartQueriesBySerial(@org.jetbrains.annotations.NotNull long[] querySerials) Restarts one or more persistent queries.voidrestartQueriesBySerial(@NotNull List<Long> querySerials) Restarts one or more persistent queries.default voidrestartQuery(@NotNull PersistentQueryConfigMessage config) Restart a persistent query.voidrestartReplicas(@NotNull List<ReplicaSpecifier> replicas) Restart one or more query replicas and/or spares.voidMake this client ephemeral.voidshutdown()Shut down the client.default voidstopQueries(@NotNull List<PersistentQueryConfigMessage> configs) Stops one or more persistent queries.default voidstopQueriesBySerial(@org.jetbrains.annotations.NotNull long[] querySerials) Stops one or more persistent query by serial id.voidstopQueriesBySerial(@NotNull List<Long> querySerials) Stop the specified queries by serial.default voidstopQuery(@NotNull PersistentQueryConfigMessage config) Stops a persistent query.voidSubscribe for updates for all visible queries.voidsubscribeWithFilter(@NotNull List<SubscriptionFilter> filters) Subscribe for updates narrowed to the PQs that match at least one of the supplied filter elements (OR-combined).voidupdateQueryStatus(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 initialputevents will be generated. If you want an initial snapshot with registration useaddObserverAndGetData(Observer)- Parameters:
observer- thePersistentQueryControllerClient.Observerto add
-
addObserverAndGetData
Add an Observer. If the controller is available thePersistentQueryControllerClient.Observer.handleConnectionEstablished()will be invoked immediately. Theputmethod will be immediately invoked for each existing query.- Parameters:
observer- thePersistentQueryControllerClient.Observerto add
-
removeObserver
Remove the specifiedPersistentQueryControllerClient.Observerfrom the notification list.- Parameters:
observer- the observer to remove.
-
get
Get theinfofor the specified query serial.- Parameters:
querySerial- the query serial- Returns:
- the
infoor null if it did not exist.
-
get
Get theinfofor the specified query name.- Parameters:
name- the name of the query- Returns:
- the
infoif it exists.
-
get
@Nullable @Nullable PersistentQueryInfoMessage get(@NotNull @NotNull String owner, @NotNull @NotNull String name) Get theinfofor the specified query owner and name.- Parameters:
owner- the expected owner of the queryname- the name of the query- Returns:
- the
infoif 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:
trueif is connected,falseotherwise
-
setEphemeral
void setEphemeral()Make this client ephemeral. An Ephemeral client will not try to reconnect once it has lost its connection. -
authenticate
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
-
subscribeWithFilter
void subscribeWithFilter(@NotNull @NotNull List<SubscriptionFilter> filters) throws UncheckedDeephavenException Subscribe for updates narrowed to the PQs that match at least one of the supplied filter elements (OR-combined). An empty list is equivalent tosubscribeToAll(). This method blocks until the initial snapshot is received or an error occurs.Per the proto contract on
SubscribeRequest.filters, the server may decide to ignore the filter (an older controller will not know about the field). The underlying gRPC client always re-applies the same filter locally, synthesizing remove notifications for any PQ that transitions out of the matching set (e.g. via rename or owner change), so callers see the same enter/leave semantics regardless.- Parameters:
filters- the filter list narrowing the subscription.- 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, andtableGroupsfields 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
-