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
ConstructorDescriptionPersistentMemoryConfig
(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.boolean
Returns 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.int
hashCode()
boolean
Returns if the persistent memory is enabled.setDirectoryConfigs
(List<PersistentMemoryDirectoryConfig> directoryConfigs) Sets the persistent memory directory configuration to the set of directories provided in thedirectoryConfigs
argument.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
- ifpersistentMemoryConfig
isnull
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns if the persistent memory is enabled.- Returns:
true
if persistent memory allocation is enabled,false
otherwise.
-
setEnabled
Enables or disables persistent memory.- Returns:
- this
NativeMemoryConfig
instance
-
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 thedirectoryConfigs
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 inInvalidConfigurationException
.- Parameters:
directoryConfigs
- The persistent memory directories to set- Returns:
- this
PersistentMemoryConfig
instance - Throws:
InvalidConfigurationException
- If the configured directories violate consistency or uniqueness checks.NullPointerException
- ifdirectoryConfigs
isnull
-
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 inInvalidConfigurationException
.- Parameters:
directoryConfig
- the persistent memory directory configuration- Returns:
- this
PersistentMemoryConfig
instance - Throws:
InvalidConfigurationException
- If the configured directories violate consistency or uniqueness checks.NullPointerException
- ifdirectoryConfigs
isnull
-
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
- ifmode
isnull
-
equals
-
hashCode
public int hashCode() -
toString
-