com.hazelcast.config

## Class HotRestartPersistenceConfig

- java.lang.Object
- - com.hazelcast.config.HotRestartPersistenceConfig

-     public class HotRestartPersistenceConfig
      extends Object

  Configures the Hot Restart stores.

  Hot restart stores are used to hold copy of in-memory data in disk to be able to restart very fast without needing to load data from a central storage.

  HotRestartConfig configures whether hot restart is enabled, where disk data will be stored, should data be persisted sync or async etc.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_DATA_LOAD_TIMEOUT` Default load timeout
    `static int` | `DEFAULT_PARALLELISM` Default level of parallelism in Hot Restart Persistence.
    `static int` | `DEFAULT_VALIDATION_TIMEOUT` Default validation timeout
    `static String` | `HOT_RESTART_BASE_DIR_DEFAULT` Default directory name for the Hot Restart store's home

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HotRestartPersistenceConfig()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `File` | `getBackupDir()` Base directory for hot backups.
    `File` | `getBaseDir()` Base directory for all Hot Restart stores.
    `HotRestartClusterDataRecoveryPolicy` | `getClusterDataRecoveryPolicy()` Returns the policy to be used when the cluster is started
    `int` | `getDataLoadTimeoutSeconds()` Returns configured data load timeout for hot-restart process.
    `int` | `getParallelism()` Gets the configured number of Hot Restart store instance to create for one Hazelcast instance.
    `int` | `getValidationTimeoutSeconds()` Returns configured validation timeout for hot-restart process.
    `int` | `hashCode()`
    `boolean` | `isAutoRemoveStaleData()` Returns whether or not automatically removal of stale Hot Restart data is enabled.
    `boolean` | `isEnabled()` Returns whether hot restart enabled on this member.
    `HotRestartPersistenceConfig` | `setAutoRemoveStaleData(boolean autoRemoveStaleData)` Sets whether or not automatically removal of stale Hot Restart data is enabled.
    `HotRestartPersistenceConfig` | `setBackupDir(File backupDir)` Sets base directory for all Hot Restart stores.
    `HotRestartPersistenceConfig` | `setBaseDir(File baseDir)` Sets base directory for all Hot Restart stores.
    `HotRestartPersistenceConfig` | `setClusterDataRecoveryPolicy(HotRestartClusterDataRecoveryPolicy clusterDataRecoveryPolicy)` Sets the policy to be used when the cluster is started
    `HotRestartPersistenceConfig` | `setDataLoadTimeoutSeconds(int dataLoadTimeoutSeconds)` Sets data load timeout for hot-restart process, all members in the cluster should complete restoring their local data before this timeout.
    `HotRestartPersistenceConfig` | `setEnabled(boolean enabled)` Sets whether hot restart is enabled on this member.
    `HotRestartPersistenceConfig` | `setParallelism(int parallelism)` Sets the number of Hot Restart store instances to create for one Hazelcast instance.
    `HotRestartPersistenceConfig` | `setValidationTimeoutSeconds(int validationTimeoutSeconds)` Sets validation timeout for hot-restart process, includes validating cluster members expected to join and partition table on all cluster.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### HOT_RESTART_BASE_DIR_DEFAULT

          public static final String HOT_RESTART_BASE_DIR_DEFAULT

      Default directory name for the Hot Restart store's home
      See Also:
        Constant Field Values

    - #### DEFAULT_VALIDATION_TIMEOUT

          public static final int DEFAULT_VALIDATION_TIMEOUT

      Default validation timeout
      See Also:
        Constant Field Values

    - #### DEFAULT_DATA_LOAD_TIMEOUT

          public static final int DEFAULT_DATA_LOAD_TIMEOUT

      Default load timeout
      See Also:
        Constant Field Values

    - #### DEFAULT_PARALLELISM

          public static final int DEFAULT_PARALLELISM

      Default level of parallelism in Hot Restart Persistence. Controls the number of Hot Restart Store instances, each operating with a single IO thread and a single GC thread.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HotRestartPersistenceConfig

          public HotRestartPersistenceConfig()

  - ### Method Detail

    - #### isEnabled

          public boolean isEnabled()

      Returns whether hot restart enabled on this member.
      Returns:
        true if hot restart enabled, false otherwise

    - #### setEnabled

          public HotRestartPersistenceConfig setEnabled(boolean enabled)

      Sets whether hot restart is enabled on this member.
      Returns:
        HotRestartPersistenceConfig

    - #### getClusterDataRecoveryPolicy

          public HotRestartClusterDataRecoveryPolicy getClusterDataRecoveryPolicy()

      Returns the policy to be used when the cluster is started
      Returns:
        the policy to be used when the cluster is started

    - #### setClusterDataRecoveryPolicy

          public HotRestartPersistenceConfig setClusterDataRecoveryPolicy(HotRestartClusterDataRecoveryPolicy clusterDataRecoveryPolicy)

      Sets the policy to be used when the cluster is started
      Parameters:
        `clusterDataRecoveryPolicy` - the policy to be used when the cluster is started
      Returns:
        HotRestartPersistenceConfig

    - #### getBaseDir

          public File getBaseDir()

      Base directory for all Hot Restart stores. Can be an absolute or relative path to the node startup directory.

    - #### setBaseDir

          public HotRestartPersistenceConfig setBaseDir(File baseDir)

      Sets base directory for all Hot Restart stores. Can be an absolute or relative path to the node startup directory.
      Parameters:
        `baseDir` - home directory
      Returns:
        HotRestartPersistenceConfig

    - #### getBackupDir

          public File getBackupDir()

      Base directory for hot backups. Each new backup will be created in a separate directory inside this one. Can be an absolute or relative path to the node startup directory.

    - #### setBackupDir

          public HotRestartPersistenceConfig setBackupDir(File backupDir)

      Sets base directory for all Hot Restart stores.
      Parameters:
        `backupDir` - home directory
      Returns:
        HotRestartPersistenceConfig

    - #### getParallelism

          public int getParallelism()

      Gets the configured number of Hot Restart store instance to create for one Hazelcast instance.

    - #### setParallelism

          public HotRestartPersistenceConfig setParallelism(int parallelism)

      Sets the number of Hot Restart store instances to create for one Hazelcast instance.

    - #### getValidationTimeoutSeconds

          public int getValidationTimeoutSeconds()

      Returns configured validation timeout for hot-restart process.
      Returns:
        validation timeout in seconds

    - #### setValidationTimeoutSeconds

          public HotRestartPersistenceConfig setValidationTimeoutSeconds(int validationTimeoutSeconds)

      Sets validation timeout for hot-restart process, includes validating cluster members expected to join and partition table on all cluster.
      Parameters:
        `validationTimeoutSeconds` - validation timeout in seconds
      Returns:
        HotRestartPersistenceConfig

    - #### getDataLoadTimeoutSeconds

          public int getDataLoadTimeoutSeconds()

      Returns configured data load timeout for hot-restart process.
      Returns:
        data load timeout in seconds

    - #### setDataLoadTimeoutSeconds

          public HotRestartPersistenceConfig setDataLoadTimeoutSeconds(int dataLoadTimeoutSeconds)

      Sets data load timeout for hot-restart process, all members in the cluster should complete restoring their local data before this timeout.
      Parameters:
        `dataLoadTimeoutSeconds` - data load timeout in seconds
      Returns:
        HotRestartPersistenceConfig

    - #### isAutoRemoveStaleData

          public boolean isAutoRemoveStaleData()

      Returns whether or not automatically removal of stale Hot Restart data is enabled.
      Returns:
        whether or not automatically removal of stale data is enabled

    - #### setAutoRemoveStaleData

          public HotRestartPersistenceConfig setAutoRemoveStaleData(boolean autoRemoveStaleData)

      Sets whether or not automatically removal of stale Hot Restart data is enabled.

      When a member terminates or crashes when cluster state is `ClusterState.ACTIVE`, remaining members redistributes data among themselves and data persisted on terminated member's storage becomes stale. That terminated member cannot rejoin the cluster without removing Hot Restart data. When auto-removal of stale Hot Restart data is enabled, while restarting that member, Hot Restart data is automatically removed and it joins the cluster as a completely new member. Otherwise, Hot Restart data should be removed manually.

      Parameters:
        `autoRemoveStaleData` - `true` to enable auto-removal of stale data, `false` otherwise
      Returns:
        HotRestartPersistenceConfig

    - #### equals

          public final boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public final int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2020. All rights reserved.