Interface PersistentQueryControllerClient

All Superinterfaces:
PersistentQueryScriptSource
All Known Implementing Classes:
PersistentQueryControllerClientImpl

public interface PersistentQueryControllerClient extends PersistentQueryScriptSource
Implementations of this interface provide a client that can communicate with the Persistent Query Controller to query and manage the state of Persistent Queries.
  • Method Details

    • addObserver

      void addObserver(@NotNull @NotNull PersistentQueryControllerClient.Observer observer)
      Add an Observer. If the controller is available the PersistentQueryControllerClient.Observer.handleConnectionEstablished() will be invoked immediately. No initial put events will be generated. If you want an initial snapshot with registration use addObserverAndGetData(Observer)
      Parameters:
      observer - the PersistentQueryControllerClient.Observer to add
    • addObserverAndGetData

      void addObserverAndGetData(@NotNull @NotNull PersistentQueryControllerClient.Observer observer)
      Add an Observer. If the controller is available the PersistentQueryControllerClient.Observer.handleConnectionEstablished() will be invoked immediately. The put method will be immediately invoked for each existing query.
      Parameters:
      observer - the PersistentQueryControllerClient.Observer to add
    • removeObserver

      void removeObserver(@NotNull @NotNull PersistentQueryControllerClient.Observer observer)
      Remove the specified PersistentQueryControllerClient.Observer from the notification list.
      Parameters:
      observer - the observer to remove.
    • get

      @Nullable @Nullable PersistentQueryInfoMessage get(long querySerial)
      Get the info for the specified query serial.
      Parameters:
      querySerial - the query serial
      Returns:
      the info or null if it did not exist.
    • get

      PersistentQueryInfoMessage get(@NotNull @NotNull String name)
      Get the info 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 the info for the specified query owner and name.
      Parameters:
      owner - the expected owner of the query
      name - the name of the query
      Returns:
      the info if it exists.
    • getDataCopy

      @NotNull @NotNull Map<Long,PersistentQueryInfoMessage> 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

      void subscribeToAll() throws UncheckedDeephavenException
      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

      void shutdown() throws IOException
      Shut down the client.
      Throws:
      IOException - if an error occurs while shutting down
    • getConfiguration

      @NotNull @NotNull ControllerConfigurationMessage getConfiguration()
      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

      long addQuery(@NotNull @NotNull PersistentQueryConfigMessage config)
      Adds a configuration to the controller's hash table.
      Parameters:
      config - the configuration to add
      Returns:
      the serial number of the added configuration
    • modifyQuery

      @FinalDefault default void modifyQuery(@NotNull @NotNull PersistentQueryConfigMessage config)
      Modifies a configuration in the controller's hash table, and restart the query if it was running.
      Parameters:
      config - the updated configuration
    • modifyQuery

      void modifyQuery(@NotNull @NotNull PersistentQueryConfigMessage config, boolean restartIfRunning)
      Modifies a configuration in the controller's hash table.
      Parameters:
      config - the updated configuration
      restartIfRunning - restart the query when it is running if set to true
    • removeQuery

      default void removeQuery(@NotNull @NotNull PersistentQueryConfigMessage config)
      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

      default void restartQuery(@NotNull @NotNull PersistentQueryConfigMessage config)
      Restart a persistent query. This implementation delegates to restartQueries(List) )}.
      Parameters:
      config - the persistent query configuration to be restarted.
    • restartQueries

      default void restartQueries(@NotNull @NotNull List<PersistentQueryConfigMessage> configs)
      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

      void restartQueriesBySerial(@NotNull @NotNull List<Long> querySerials)
      Restarts one or more persistent queries.
      Parameters:
      querySerials - a list of serial ids to restart
    • restartReplicas

      void restartReplicas(@NotNull @NotNull List<ReplicaSpecifier> replicas)
      Restart one or more query replicas and/or spares.
      Parameters:
      replicas - the replicas or spares to restart.
    • stopQuery

      default void stopQuery(@NotNull @NotNull PersistentQueryConfigMessage config)
      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

      default void stopQueries(@NotNull @NotNull List<PersistentQueryConfigMessage> configs)
      Stops one or more persistent queries.
      Parameters:
      configs - the persistent query configurations to be stopped
    • stopQueriesBySerial

      void stopQueriesBySerial(@NotNull @NotNull List<Long> querySerials)
      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,String[]> tableGroups) throws IOException
      Publish an update for a persistent query. This is intended for use by Interactive Consoles only. The status. scopeFields, and tableGroups 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 status
      scopeFields - an optional map of exportable objects
      tableGroups - an optional map of exportable object to ACL groups.
      Throws:
      IOException - if a problem occurs during the update