Class PersistentMemoryConfig

java.lang.Object
com.hazelcast.config.PersistentMemoryConfig

public class PersistentMemoryConfig extends Object
Configuration class for persistent memory devices (e.g. Intel Optane).
  • Constructor Details

    • PersistentMemoryConfig

      public PersistentMemoryConfig()
    • PersistentMemoryConfig

      public PersistentMemoryConfig(@Nonnull PersistentMemoryConfig persistentMemoryConfig)
      Constructs an instance with copying the fields of the provided PersistentMemoryConfig.
      Parameters:
      persistentMemoryConfig - The configuration to copy
      Throws:
      NullPointerException - if persistentMemoryConfig is null
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Returns if the persistent memory is enabled.
      Returns:
      true if persistent memory allocation is enabled, false otherwise.
    • setEnabled

      public PersistentMemoryConfig setEnabled(boolean enabled)
      Enables or disables persistent memory.
      Returns:
      this NativeMemoryConfig instance
    • getDirectoryConfigs

      @Nonnull public List<PersistentMemoryDirectoryConfig> getDirectoryConfigs()
      Returns the persistent memory directory configurations to be used to store memory structures allocated by native memory manager.

      By default, there are no configuration is set indicating that volatile RAM is being used.

      Returns:
      the list of the persistent memory directory configurations
    • setDirectoryConfigs

      public PersistentMemoryConfig setDirectoryConfigs(@Nonnull List<PersistentMemoryDirectoryConfig> directoryConfigs)
      Sets the persistent memory directory configuration to the set of directories provided in the directoryConfigs argument.

      If the specified directories are not unique either in the directories themselves or in the NUMA nodes specified for them, InvalidConfigurationException is thrown. Setting the NUMA node on the subset of the configured directories while leaving not set on others also results in InvalidConfigurationException.

      Parameters:
      directoryConfigs - The persistent memory directories to set
      Returns:
      this PersistentMemoryConfig instance
      Throws:
      InvalidConfigurationException - If the configured directories violate consistency or uniqueness checks.
      NullPointerException - if directoryConfigs is null
    • addDirectoryConfig

      public PersistentMemoryConfig addDirectoryConfig(@Nonnull PersistentMemoryDirectoryConfig directoryConfig)
      Adds the persistent memory directory configuration to be used to store memory structures allocated by native memory manager.

      If the specified directories are not unique either in the directories themselves or in the NUMA nodes specified for them, InvalidConfigurationException is thrown. Setting the NUMA node on the subset of the configured directories while leaving not set on others also results in InvalidConfigurationException.

      Parameters:
      directoryConfig - the persistent memory directory configuration
      Returns:
      this PersistentMemoryConfig instance
      Throws:
      InvalidConfigurationException - If the configured directories violate consistency or uniqueness checks.
      NullPointerException - if directoryConfigs is null
    • getMode

      @Nonnull public PersistentMemoryMode getMode()
      Returns the mode in which the persistent memory should be used.
      Returns:
      the mode
    • setMode

      public PersistentMemoryConfig setMode(@Nonnull PersistentMemoryMode mode)
      Sets the mode in which the persistent memory should be used. The default mode is PersistentMemoryMode.MOUNTED.
      Parameters:
      mode - The mode of the persistent memory
      Throws:
      NullPointerException - if mode is null
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object