Package com.hazelcast.config
Class DataPersistenceConfig
java.lang.Object
com.hazelcast.config.DataPersistenceConfig
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
Configures the Persistence per Hazelcast data structure.
Note: If either, but not both, data-persistence (
Note: If either, but not both, data-persistence (
DataPersistenceConfig
) or
hot-restart (HotRestartConfig
) is enabled,
Hazelcast will use the configuration of the enabled element. If both are
enabled, Hazelcast will use the data-persistence (DataPersistenceConfig
)
configuration. hot-restart element (and thus HotRestartConfig
)
will be removed in a future release.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
int
Returns type identifier for this class.int
Returns DataSerializableFactory factory ID for this class.final int
hashCode()
boolean
Returns whether persistence enabled on related data structure.boolean
isFsync()
Returns whether disk write should be followed by anfsync()
system call.void
Reads fields from the input streamsetEnabled
(boolean enabled) Sets whether hot restart is enabled on related data structure.setFsync
(boolean fsync) Sets whether disk write should be followed by anfsync()
system call.toString()
void
Writes object fields to output stream
-
Constructor Details
-
DataPersistenceConfig
public DataPersistenceConfig() -
DataPersistenceConfig
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns whether persistence enabled on related data structure.- Returns:
- true if persistence enabled, false otherwise
-
setEnabled
Sets whether hot restart is enabled on related data structure.- Returns:
- DataPersistenceConfig
-
isFsync
public boolean isFsync()Returns whether disk write should be followed by anfsync()
system call.- Returns:
- true if fsync is be called after disk write, false otherwise
-
setFsync
Sets whether disk write should be followed by anfsync()
system call.- Parameters:
fsync
- fsync- Returns:
- this DataPersistenceConfig
-
toString
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
-
hashCode
public final int hashCode()
-