Class PersistentQueryControllerClientImpl
java.lang.Object
io.deephaven.enterprise.dnd.controller.PersistentQueryControllerClientImpl
- All Implemented Interfaces:
- PersistentQueryControllerClient,- PersistentQueryScriptSource
public class PersistentQueryControllerClientImpl
extends Object
implements PersistentQueryControllerClient
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.deephaven.enterprise.dnd.controller.PersistentQueryControllerClientPersistentQueryControllerClient.Observer, PersistentQueryControllerClient.ObserverImpl
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final io.deephaven.hash.KeyedLongObjectHashMap<PersistentQueryInfoMessage>
- 
Constructor SummaryConstructorsConstructorDescriptionPersistentQueryControllerClientImpl(@NotNull ControllerClientGrpc grpcClient) PersistentQueryControllerClientImpl(@NotNull String who, @NotNull io.deephaven.shadow.core.io.grpc.ManagedChannel channel) PersistentQueryControllerClientImpl(@NotNull String who, @NotNull io.deephaven.shadow.core.io.grpc.ManagedChannel channel, @NotNull ScheduledExecutorService executorService) PersistentQueryControllerClientImpl(@NotNull String who, @NotNull io.deephaven.shadow.core.io.grpc.ManagedChannel channel, @NotNull ScheduledExecutorService executorService, @NotNull AuthenticationClient authClient, long heartBeatPeriodMillis, long heartBeatTimeoutMillis) 
- 
Method SummaryModifier 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.@Nullable PersistentQueryInfoMessageGet 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.@Nullable StringgetScriptBody(@NotNull String scriptPath, boolean isPathRelative, @Nullable String scriptLoaderStateJson) Get the body of the specified script as the currently authenticated user.@Nullable StringgetScriptBodyByQuery(@NotNull String scriptPath, long querySerial, boolean isPathRelative, @Nullable String scriptLoaderStateJson) Get a script by path for the owner of a specific query by serial, with optional script loader state information.@Nullable StringgetScriptBodyByUser(@NotNull String scriptPath, @NotNull String ownerName, boolean isPathRelative, @Nullable String scriptLoaderStateJson) Get the body of the specified script as the specified user.getScriptPaths(@Nullable String scriptLoaderStateJson, boolean useRelativePath) Get all script paths available for the currently authenticated user.getScriptPathsByQuery(long querySerial, @Nullable String scriptLoaderState, boolean useRelativePath) Get all script paths available to the owner of a specific query by serial, providing optional script loader state information.getScriptPathsByUser(@NotNull String userName, @Nullable String scriptLoaderStateJson, boolean useRelativePath) Get the script paths available for the specified user.booleanCheck if the client is connected to the Controller.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.voidrestartQueriesBySerial(@NotNull List<Long> serials) Restarts one or more persistent queries.voidrestartReplicas(@NotNull List<ReplicaSpecifier> replicas) Restart one or more query replicas and/or spares.voidMake this client ephemeral.voidshutdown()Shut down the client.voidstopQueriesBySerial(@NotNull List<Long> serials) Stop the specified queries by serial.voidSubscribe for updates for all visible queries.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 class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.enterprise.dnd.controller.PersistentQueryControllerClientmodifyQuery, removeQuery, restartQueries, restartQueriesBySerial, restartQuery, stopQueries, stopQueriesBySerial, stopQueryMethods inherited from interface io.deephaven.enterprise.dnd.controller.PersistentQueryScriptSourcegetScriptBody, getScriptBodyByQuery, getScriptBodyByUser, getScriptPaths, getScriptPathsByQuery, getScriptPathsByUser
- 
Field Details- 
queryMap
 
- 
- 
Constructor Details- 
PersistentQueryControllerClientImplpublic PersistentQueryControllerClientImpl(@NotNull @NotNull String who, @NotNull @NotNull io.deephaven.shadow.core.io.grpc.ManagedChannel channel) 
- 
PersistentQueryControllerClientImplpublic PersistentQueryControllerClientImpl(@NotNull @NotNull String who, @NotNull @NotNull io.deephaven.shadow.core.io.grpc.ManagedChannel channel, @NotNull @NotNull ScheduledExecutorService executorService) 
- 
PersistentQueryControllerClientImplpublic PersistentQueryControllerClientImpl(@NotNull @NotNull String who, @NotNull @NotNull io.deephaven.shadow.core.io.grpc.ManagedChannel channel, @NotNull @NotNull ScheduledExecutorService executorService, @NotNull @NotNull AuthenticationClient authClient, long heartBeatPeriodMillis, long heartBeatTimeoutMillis) 
- 
PersistentQueryControllerClientImpl
 
- 
- 
Method Details- 
addObserverDescription copied from interface:PersistentQueryControllerClientAdd 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 usePersistentQueryControllerClient.addObserverAndGetData(Observer)- Specified by:
- addObserverin interface- PersistentQueryControllerClient
- Parameters:
- observer- the- PersistentQueryControllerClient.Observerto add
 
- 
addObserverAndGetDatapublic void addObserverAndGetData(@NotNull @NotNull PersistentQueryControllerClient.Observer observer) Description copied from interface:PersistentQueryControllerClientAdd an Observer. If the controller is available thePersistentQueryControllerClient.Observer.handleConnectionEstablished()will be invoked immediately. Theputmethod will be immediately invoked for each existing query.- Specified by:
- addObserverAndGetDatain interface- PersistentQueryControllerClient
- Parameters:
- observer- the- PersistentQueryControllerClient.Observerto add
 
- 
removeObserverDescription copied from interface:PersistentQueryControllerClientRemove the specifiedPersistentQueryControllerClient.Observerfrom the notification list.- Specified by:
- removeObserverin interface- PersistentQueryControllerClient
- Parameters:
- observer- the observer to remove.
 
- 
getDataCopyDescription copied from interface:PersistentQueryControllerClientGet a copy of the current set of query data.- Specified by:
- getDataCopyin interface- PersistentQueryControllerClient
- Returns:
- a copy of the current set of queries.
 
- 
isConnectedpublic boolean isConnected()Description copied from interface:PersistentQueryControllerClientCheck if the client is connected to the Controller.- Specified by:
- isConnectedin interface- PersistentQueryControllerClient
- Returns:
- trueif is connected,- falseotherwise
 
- 
setEphemeralpublic void setEphemeral()Description copied from interface:PersistentQueryControllerClientMake this client ephemeral. An Ephemeral client will not try to reconnect once it has lost its connection.- Specified by:
- setEphemeralin interface- PersistentQueryControllerClient
 
- 
authenticateDescription copied from interface:PersistentQueryControllerClientUse the specified auth token to authenticate this client to the hashtable server.- Specified by:
- authenticatein interface- PersistentQueryControllerClient
- Parameters:
- token- the token for authentication
- Returns:
- true if authentication was successful.
 
- 
subscribeToAllDescription copied from interface:PersistentQueryControllerClientSubscribe for updates for all visible queries. This method will block until subscription is complete, or an error occurs.- Specified by:
- subscribeToAllin interface- PersistentQueryControllerClient
- Throws:
- UncheckedDeephavenException- If an error occurs
 
- 
shutdownDescription copied from interface:PersistentQueryControllerClientShut down the client.- Specified by:
- shutdownin interface- PersistentQueryControllerClient
- Throws:
- IOException- if an error occurs while shutting down
 
- 
getConfigurationDescription copied from interface:PersistentQueryControllerClientGet the currentControllerConfigurationMessage.- Specified by:
- getConfigurationin interface- PersistentQueryControllerClient
- Returns:
- the current controller configuration
 
- 
reloadConfigurationpublic void reloadConfiguration()Description copied from interface:PersistentQueryControllerClientCommand 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. - Specified by:
- reloadConfigurationin interface- PersistentQueryControllerClient
 
- 
addQueryDescription copied from interface:PersistentQueryControllerClientAdds a configuration to the controller's hash table.- Specified by:
- addQueryin interface- PersistentQueryControllerClient
- Parameters:
- config- the configuration to add
- Returns:
- the serial number of the added configuration
 
- 
modifyQuerypublic void modifyQuery(@NotNull @NotNull PersistentQueryConfigMessage config, boolean restartIfRunning) Description copied from interface:PersistentQueryControllerClientModifies a configuration in the controller's hash table.- Specified by:
- modifyQueryin interface- PersistentQueryControllerClient
- Parameters:
- config- the updated configuration
- restartIfRunning- restart the query when it is running if set to true
 
- 
removeQuerypublic void removeQuery(long serialId) Description copied from interface:PersistentQueryControllerClientRemoves a configuration from the controller's hash table by serial ID.- Specified by:
- removeQueryin interface- PersistentQueryControllerClient
- Parameters:
- serialId- the serial ID of configuration to remove
 
- 
restartQueriesBySerialDescription copied from interface:PersistentQueryControllerClientRestarts one or more persistent queries.- Specified by:
- restartQueriesBySerialin interface- PersistentQueryControllerClient
- Parameters:
- serials- a list of serial ids to restart
 
- 
restartReplicasDescription copied from interface:PersistentQueryControllerClientRestart one or more query replicas and/or spares.- Specified by:
- restartReplicasin interface- PersistentQueryControllerClient
- Parameters:
- replicas- the replicas or spares to restart.
 
- 
stopQueriesBySerialDescription copied from interface:PersistentQueryControllerClientStop the specified queries by serial.- Specified by:
- stopQueriesBySerialin interface- PersistentQueryControllerClient
- Parameters:
- serials- the serials
 
- 
getDescription copied from interface:PersistentQueryControllerClientGet theinfofor the specified query serial.- Specified by:
- getin interface- PersistentQueryControllerClient
- Parameters:
- querySerial- the query serial
- Returns:
- the infoor null if it did not exist.
 
- 
getDescription copied from interface:PersistentQueryControllerClientGet theinfofor the specified query name.- Specified by:
- getin interface- PersistentQueryControllerClient
- Parameters:
- name- the name of the query
- Returns:
- the infoif it exists.
 
- 
get@Nullable public @Nullable PersistentQueryInfoMessage get(@NotNull @NotNull String owner, @NotNull @NotNull String name) Description copied from interface:PersistentQueryControllerClientGet theinfofor the specified query owner and name.- Specified by:
- getin interface- PersistentQueryControllerClient
- Parameters:
- owner- the expected owner of the query
- name- the name of the query
- Returns:
- the infoif it exists.
 
- 
updateQueryStatuspublic void updateQueryStatus(long querySerial, String processInfoId, @Nullable @Nullable PersistentQueryStatusEnum status, @Nullable @Nullable Map<String, ExportedObjectInfoMessage> scopeFields, @Nullable @Nullable Map<String, String[]> tableGroups) Description copied from interface:PersistentQueryControllerClientPublish 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.- Specified by:
- updateQueryStatusin interface- PersistentQueryControllerClient
- 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.
 
- 
getScriptPathsByUser@NotNull public @NotNull Set<String> getScriptPathsByUser(@NotNull @NotNull String userName, @Nullable @Nullable String scriptLoaderStateJson, boolean useRelativePath) Description copied from interface:PersistentQueryScriptSourceGet the script paths available for the specified user.- Specified by:
- getScriptPathsByUserin interface- PersistentQueryScriptSource
- Parameters:
- userName- the user to fetch paths for
- scriptLoaderStateJson- optional script loader state information
- useRelativePath- whether to return relative or display script paths
- Returns:
- the set of paths available for the specified user
 
- 
getScriptPaths@NotNull public @NotNull Set<String> getScriptPaths(@Nullable @Nullable String scriptLoaderStateJson, boolean useRelativePath) Description copied from interface:PersistentQueryScriptSourceGet all script paths available for the currently authenticated user.- Specified by:
- getScriptPathsin interface- PersistentQueryScriptSource
- Parameters:
- scriptLoaderStateJson- optional script loader state information
- useRelativePath- whether to return relative or display script paths
- Returns:
- the set of paths available for the current user
 
- 
getScriptPathsByQuery@NotNull public @NotNull Set<String> getScriptPathsByQuery(long querySerial, @Nullable @Nullable String scriptLoaderState, boolean useRelativePath) Description copied from interface:PersistentQueryScriptSourceGet all script paths available to the owner of a specific query by serial, providing optional script loader state information.- Specified by:
- getScriptPathsByQueryin interface- PersistentQueryScriptSource
- Parameters:
- querySerial- the query serial
- scriptLoaderState- an optional loader state
- useRelativePath- whether to return relative or display script paths
- Returns:
- The paths available to the serial ID.
 
- 
getScriptBody@Nullable public @Nullable String getScriptBody(@NotNull @NotNull String scriptPath, boolean isPathRelative, @Nullable @Nullable String scriptLoaderStateJson) Description copied from interface:PersistentQueryScriptSourceGet the body of the specified script as the currently authenticated user.- Specified by:
- getScriptBodyin interface- PersistentQueryScriptSource
- Parameters:
- scriptPath- the script path
- isPathRelative- if the- scriptPathis a relative path
- scriptLoaderStateJson- optional script loader state information
- Returns:
- the body of the script
 
- 
getScriptBodyByUser@Nullable public @Nullable String getScriptBodyByUser(@NotNull @NotNull String scriptPath, @NotNull @NotNull String ownerName, boolean isPathRelative, @Nullable @Nullable String scriptLoaderStateJson) Description copied from interface:PersistentQueryScriptSourceGet the body of the specified script as the specified user.- Specified by:
- getScriptBodyByUserin interface- PersistentQueryScriptSource
- Parameters:
- scriptPath- the script path
- ownerName- the user to fetch the body as
- isPathRelative- if the- scriptPathis relative
- scriptLoaderStateJson- optional script loader state information
- Returns:
- the body of the script
 
- 
getScriptBodyByQuery@Nullable public @Nullable String getScriptBodyByQuery(@NotNull @NotNull String scriptPath, long querySerial, boolean isPathRelative, @Nullable @Nullable String scriptLoaderStateJson) Description copied from interface:PersistentQueryScriptSourceGet a script by path for the owner of a specific query by serial, with optional script loader state information.- Specified by:
- getScriptBodyByQueryin interface- PersistentQueryScriptSource
- Parameters:
- scriptPath- The path string.
- querySerial- The Serial ID.
- isPathRelative- if the- scriptPathis relative
- scriptLoaderStateJson- optional script loader state information
- Returns:
- The contents of the script.
 
 
-