Class PqStorageEtcdV2Impl
java.lang.Object
io.deephaven.enterprise.controller.pqstorage.PqStorageEtcdV2Impl
- All Implemented Interfaces:
PqStorage
A V2 implementation of PQ storage in ETCD. This implementation stores PQ data under the prefix
/main/data/persistent-query-v2/configuration/ and uses a global revision number to maintain synchronization.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddPersistentQueryConfiguration(@NotNull PersistentQueryConfiguration config) Add the specified persistent query configuration.voidCommit a checkpoint.booleandeletePersistentQueryConfiguration(@NotNull PersistentQueryConfiguration config) Delete the specified persistent query configuration.voiddisconnect(boolean forceCheckpoint) Disconnect from the storage mechanism.@Nullable PersistentQueryConfigurationgetPersistentQueryConfiguration(long serial) Return thePersistentQueryConfigurationfor the specified serial.voidDo any initialization work required.keySet()Return the Set of persisted serials.booleanupdatePersistentQueryConfiguration(@NotNull PersistentQueryConfiguration config) Update the specified persistent query configuration.values()Return a Collection containing all the persistedPersistentQueryConfigurationinstances.
-
Constructor Details
-
PqStorageEtcdV2Impl
- Throws:
PqStorageException
-
-
Method Details
-
initialize
Description copied from interface:PqStorageDo any initialization work required.- Specified by:
initializein interfacePqStorage- Throws:
PqStorageException
-
getPersistentQueryConfiguration
@Nullable public @Nullable PersistentQueryConfiguration getPersistentQueryConfiguration(long serial) throws PqStorageException Description copied from interface:PqStorageReturn thePersistentQueryConfigurationfor the specified serial.- Specified by:
getPersistentQueryConfigurationin interfacePqStorage- Parameters:
serial- the serial for the query- Returns:
- the query, or null if it does not exist
- Throws:
PqStorageException
-
addPersistentQueryConfiguration
public boolean addPersistentQueryConfiguration(@NotNull @NotNull PersistentQueryConfiguration config) throws PqStorageException Description copied from interface:PqStorageAdd the specified persistent query configuration. If the configuration already exists, it will not be updated.- Specified by:
addPersistentQueryConfigurationin interfacePqStorage- Parameters:
config- the configuration to add- Returns:
- true if the configuration was added, false if it already existed
- Throws:
PqStorageException
-
updatePersistentQueryConfiguration
public boolean updatePersistentQueryConfiguration(@NotNull @NotNull PersistentQueryConfiguration config) throws PqStorageException Description copied from interface:PqStorageUpdate the specified persistent query configuration. If the configuration does not exist, it will not be created.- Specified by:
updatePersistentQueryConfigurationin interfacePqStorage- Parameters:
config- the configuration to update- Returns:
- true if the (existing) configuration was updated, false if it did not exist
- Throws:
PqStorageException
-
deletePersistentQueryConfiguration
public boolean deletePersistentQueryConfiguration(@NotNull @NotNull PersistentQueryConfiguration config) throws PqStorageException Description copied from interface:PqStorageDelete the specified persistent query configuration.- Specified by:
deletePersistentQueryConfigurationin interfacePqStorage- Parameters:
config- the configuration to update- Returns:
- true if the configuration was deleted, false if it did not exist
- Throws:
PqStorageException
-
commitCheckPoint
public void commitCheckPoint()Description copied from interface:PqStorageCommit a checkpoint. This may be a no-op.- Specified by:
commitCheckPointin interfacePqStorage
-
disconnect
public void disconnect(boolean forceCheckpoint) Description copied from interface:PqStorageDisconnect from the storage mechanism.- Specified by:
disconnectin interfacePqStorage- Parameters:
forceCheckpoint- if true, perform a checkpoint
-
keySet
Description copied from interface:PqStorageReturn the Set of persisted serials. There are no guarantees on the type, mutability, serializability, or thread-safety of the Set returned.- Specified by:
keySetin interfacePqStorage- Returns:
- a Set of the serials
- Throws:
PqStorageException
-
values
Description copied from interface:PqStorageReturn a Collection containing all the persistedPersistentQueryConfigurationinstances. Updates to these PersistentQueryConfiguration instances should be persisted viaPqStorage.updatePersistentQueryConfiguration(com.illumon.iris.controller.PersistentQueryConfiguration). There are no guarantees on the type, mutability, serializability, or thread-safety of the Collection returned, or of the objects contained within the Collection.- Specified by:
valuesin interfacePqStorage- Returns:
- a Collection of persistent query configurations
- Throws:
PqStorageException
-