Class DataPersistenceConfig

  • All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable

    public class DataPersistenceConfig
    extends java.lang.Object
    implements IdentifiedDataSerializable
    Configures the Persistence per Hazelcast data structure.

    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 Detail

      • DataPersistenceConfig

        public DataPersistenceConfig()
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Returns whether persistence enabled on related data structure.
        Returns:
        true if persistence enabled, false otherwise
      • setEnabled

        public DataPersistenceConfig setEnabled​(boolean enabled)
        Sets whether hot restart is enabled on related data structure.
        Returns:
        DataPersistenceConfig
      • isFsync

        public boolean isFsync()
        Returns whether disk write should be followed by an fsync() system call.
        Returns:
        true if fsync is be called after disk write, false otherwise
      • setFsync

        public DataPersistenceConfig setFsync​(boolean fsync)
        Sets whether disk write should be followed by an fsync() system call.
        Parameters:
        fsync - fsync
        Returns:
        this DataPersistenceConfig
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • writeData

        public void writeData​(ObjectDataOutput out)
                       throws java.io.IOException
        Description copied from interface: DataSerializable
        Writes object fields to output stream
        Specified by:
        writeData in interface DataSerializable
        Parameters:
        out - output
        Throws:
        java.io.IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
      • readData

        public void readData​(ObjectDataInput in)
                      throws java.io.IOException
        Description copied from interface: DataSerializable
        Reads fields from the input stream
        Specified by:
        readData in interface DataSerializable
        Parameters:
        in - input
        Throws:
        java.io.IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.
      • equals

        public final boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object