Package com.hazelcast.config
Class PersistentMemoryConfig
java.lang.Object
com.hazelcast.config.PersistentMemoryConfig
Configuration class for persistent memory devices (e.g. Intel Optane).
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentMemoryConfig(PersistentMemoryConfig persistentMemoryConfig) Constructs an instance with copying the fields of the providedPersistentMemoryConfig. -
Method Summary
Modifier and TypeMethodDescriptionaddDirectoryConfig(PersistentMemoryDirectoryConfig directoryConfig) Adds the persistent memory directory configuration to be used to store memory structures allocated by native memory manager.booleanReturns the persistent memory directory configurations to be used to store memory structures allocated by native memory manager.getMode()Returns the mode in which the persistent memory should be used.inthashCode()booleanReturns if the persistent memory is enabled.setDirectoryConfigs(List<PersistentMemoryDirectoryConfig> directoryConfigs) Sets the persistent memory directory configuration to the set of directories provided in thedirectoryConfigsargument.setEnabled(boolean enabled) Enables or disables persistent memory.setMode(PersistentMemoryMode mode) Sets the mode in which the persistent memory should be used.toString()
-
Constructor Details
-
PersistentMemoryConfig
public PersistentMemoryConfig() -
PersistentMemoryConfig
Constructs an instance with copying the fields of the providedPersistentMemoryConfig.- Parameters:
persistentMemoryConfig- The configuration to copy- Throws:
NullPointerException- ifpersistentMemoryConfigisnull
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns if the persistent memory is enabled.- Returns:
trueif persistent memory allocation is enabled,falseotherwise.
-
setEnabled
Enables or disables persistent memory.- Returns:
- this
NativeMemoryConfiginstance
-
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 thedirectoryConfigsargument. If the specified directories are not unique either in the directories themselves or in the NUMA nodes specified for them,InvalidConfigurationExceptionis thrown. Setting the NUMA node on the subset of the configured directories while leaving not set on others also results inInvalidConfigurationException.- Parameters:
directoryConfigs- The persistent memory directories to set- Returns:
- this
PersistentMemoryConfiginstance - Throws:
InvalidConfigurationException- If the configured directories violate consistency or uniqueness checks.NullPointerException- ifdirectoryConfigsisnull
-
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,InvalidConfigurationExceptionis thrown. Setting the NUMA node on the subset of the configured directories while leaving not set on others also results inInvalidConfigurationException.- Parameters:
directoryConfig- the persistent memory directory configuration- Returns:
- this
PersistentMemoryConfiginstance - Throws:
InvalidConfigurationException- If the configured directories violate consistency or uniqueness checks.NullPointerException- ifdirectoryConfigsisnull
-
getMode
Returns the mode in which the persistent memory should be used.- Returns:
- the mode
-
setMode
Sets the mode in which the persistent memory should be used. The default mode isPersistentMemoryMode.MOUNTED.- Parameters:
mode- The mode of the persistent memory- Throws:
NullPointerException- ifmodeisnull
-
equals
-
hashCode
public int hashCode() -
toString
-