Class PqStoragePhtImpl

java.lang.Object
com.illumon.iris.controller.pqstorage.PqStoragePhtImpl
All Implemented Interfaces:
PqStorage

public class PqStoragePhtImpl extends Object implements PqStorage
Implementation of PqStorage which uses PersistentHashtable for its underlying storage.
  • Constructor Details

    • PqStoragePhtImpl

      public PqStoragePhtImpl()
  • Method Details

    • getPersistentQueryConfiguration

      @Nullable public PersistentQueryConfiguration getPersistentQueryConfiguration(long serial)
      Description copied from interface: PqStorage
      Return the PersistentQueryConfiguration for the specified serial.
      Specified by:
      getPersistentQueryConfiguration in interface PqStorage
      Parameters:
      serial - the serial for the query
      Returns:
      the query, or null if it does not exist
    • addPersistentQueryConfiguration

      public boolean addPersistentQueryConfiguration(@NotNull PersistentQueryConfiguration config) throws IOException
      Description copied from interface: PqStorage
      Add the specified persistent query configuration. If the configuration already exists, it will not be updated.
      Specified by:
      addPersistentQueryConfiguration in interface PqStorage
      Parameters:
      config - the configuration to add
      Returns:
      true if the configuration was added, false if it already existed
      Throws:
      IOException - if an error occurs during the persistence operation
    • updatePersistentQueryConfiguration

      public boolean updatePersistentQueryConfiguration(@NotNull PersistentQueryConfiguration config) throws IOException
      Description copied from interface: PqStorage
      Update the specified persistent query configuration. If the configuration does not exist, it will not be created.
      Specified by:
      updatePersistentQueryConfiguration in interface PqStorage
      Parameters:
      config - the configuration to update
      Returns:
      true if the (existing) configuration was updated, false if it did not exist
      Throws:
      IOException - if an error occurs during the persistence operation
    • deletePersistentQueryConfiguration

      public boolean deletePersistentQueryConfiguration(@NotNull PersistentQueryConfiguration config) throws IOException
      Description copied from interface: PqStorage
      Delete the specified persistent query configuration.
      Specified by:
      deletePersistentQueryConfiguration in interface PqStorage
      Parameters:
      config - the configuration to update
      Returns:
      true if the configuration was deleted, false if it did not exist
      Throws:
      IOException - if an error occurs during the persistence operation
    • commitCheckPoint

      public void commitCheckPoint() throws IOException
      Description copied from interface: PqStorage
      Commit a checkpoint. This may be a no-op.
      Specified by:
      commitCheckPoint in interface PqStorage
      Throws:
      IOException - if an error occurs committing the checkpoint
    • disconnect

      public void disconnect(boolean forceCheckpoint)
      Description copied from interface: PqStorage
      Disconnect from the storage mechanism.
      Specified by:
      disconnect in interface PqStorage
      Parameters:
      forceCheckpoint - if true, perform a checkpoint
    • keySet

      public Set<Long> keySet()
      Description copied from interface: PqStorage
      Return the Set of persisted serials. There are no guarantees on the type, mutability, serializability, or thread-safety of the Set returned.
      Specified by:
      keySet in interface PqStorage
      Returns:
      a Set of the serials
    • values

      Description copied from interface: PqStorage
      Return a Collection containing all of the persisted PersistentQueryConfiguration instances. Updates to these PersistentQueryConfiguration instances should be persisted via PqStorage.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:
      values in interface PqStorage
      Returns:
      a Collection of persistent query configurations