com.hazelcast.hotrestart

## Interface InternalHotRestartService

- All Known Implementing Classes:
    NoopInternalHotRestartService

      public interface InternalHotRestartService

  Internal service for interacting with hot restart related functionalities (e.g. force and partial start)

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `forceStartBeforeJoin()` Executes force-start process, resets local hot restart data and member gets a new UUID.
    `com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO` | `getCurrentClusterHotRestartStatus()` Returns latest Hot Restart status as Management Center DTO.
    `Set<String>` | `getExcludedMemberUuids()` Returns UUIDs of the members that have been excluded during the cluster start.
    `void` | `handleExcludedMemberUuids(Address sender, Set<String> excludedMemberUuids)` Handles the UUID set of excluded members only if this member is also excluded, and triggers the member force start process.
    `boolean` | `isEnabled()` Returns whether hot-restart is enabled or not.
    `boolean` | `isMemberExcluded(Address memberAddress, String memberUuid)` Checks if the given member has been excluded during the cluster start or not.
    `void` | `notifyExcludedMember(Address memberAddress)` Notifies the excluded member and triggers the member force start process.
    `void` | `resetService(boolean isAfterJoin)` Resets local service data, removes hot restart directories and recreates them.
    `boolean` | `triggerForceStart()` Forces node to start by skipping hot-restart completely and removing all hot-restart data even if node is still on validation phase or loading hot-restart data.
    `boolean` | `triggerPartialStart()` Triggers partial start if the cluster cannot be started with full recovery and `HotRestartPersistenceConfig.clusterDataRecoveryPolicy` is set accordingly.
    `void` | `waitPartitionReplicaSyncOnCluster(long timeout, TimeUnit unit)` Waits until partition replicas (primaries and backups) get in sync.

- - ### Method Detail

    - #### isEnabled

          boolean isEnabled()

      Returns whether hot-restart is enabled or not.

    - #### triggerForceStart

          boolean triggerForceStart()

      Forces node to start by skipping hot-restart completely and removing all hot-restart data even if node is still on validation phase or loading hot-restart data.
      Returns:
        true if force start is triggered successfully. force start cannot be triggered if hot restart is disabled or the master is not known yet

    - #### triggerPartialStart

          boolean triggerPartialStart()

      Triggers partial start if the cluster cannot be started with full recovery and `HotRestartPersistenceConfig.clusterDataRecoveryPolicy` is set accordingly.
      Returns:
        true if partial start is triggered.

    - #### isMemberExcluded

          boolean isMemberExcluded(Address memberAddress,
                                   String memberUuid)

      Checks if the given member has been excluded during the cluster start or not. If returns true, it means that the given member is not allowed to join to the cluster.
      Parameters:
        `memberAddress` - address of the member to check
        `memberUuid` - UUID of the member to check
      Returns:
        true if the member has been excluded on cluster start.

    - #### getExcludedMemberUuids

          Set<String> getExcludedMemberUuids()

      Returns UUIDs of the members that have been excluded during the cluster start.
      Returns:
        UUIDs of the members that have been excluded during the cluster start

    - #### notifyExcludedMember

          void notifyExcludedMember(Address memberAddress)

      Notifies the excluded member and triggers the member force start process.
      Parameters:
        `memberAddress` - address of the member to notify

    - #### handleExcludedMemberUuids

          void handleExcludedMemberUuids(Address sender,
                                         Set<String> excludedMemberUuids)

      Handles the UUID set of excluded members only if this member is also excluded, and triggers the member force start process.
      Parameters:
        `sender` - the member that has sent the excluded members set
        `excludedMemberUuids` - UUIDs of the members that have been excluded during the cluster start

    - #### getCurrentClusterHotRestartStatus

          com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO getCurrentClusterHotRestartStatus()

      Returns latest Hot Restart status as Management Center DTO. An empty status object will be returned if Hot Restart is not available (not EE) or not enabled.

    - #### resetService

          void resetService(boolean isAfterJoin)

      Resets local service data, removes hot restart directories and recreates them.
      Parameters:
        `isAfterJoin` - true if this is called after node joins the cluster, false otherwise

    - #### forceStartBeforeJoin

          void forceStartBeforeJoin()

      Executes force-start process, resets local hot restart data and member gets a new UUID.

      If the local node has already completed the start process or it isn't excluded in cluster start, this method fails with an exception.

    - #### waitPartitionReplicaSyncOnCluster

          void waitPartitionReplicaSyncOnCluster(long timeout,
                                                 TimeUnit unit)

      Waits until partition replicas (primaries and backups) get in sync.
      Parameters:
        `timeout` - timeout
        `unit` - time unit
      Throws:
        `IllegalStateException` - when timeout happens or a member leaves the cluster while waiting

Copyright © 2019. All rights reserved.