org.apache.storm.nimbus

## Class TimeOutWorkerHeartbeatsRecoveryStrategy

- java.lang.Object
- - org.apache.storm.nimbus.TimeOutWorkerHeartbeatsRecoveryStrategy

- All Implemented Interfaces:
    IWorkerHeartbeatsRecoveryStrategy

      public class TimeOutWorkerHeartbeatsRecoveryStrategy
      extends Object
      implements IWorkerHeartbeatsRecoveryStrategy

  Wait for a node to report worker heartbeats until a configured timeout. For cases below we have strategies:

  1: When nimbus gains leader ship, it will decide if the heartbeats are ready based on the reported node ids, supervisors/nodes will take care of the worker heartbeats recovery, a reported node id means all the workers heartbeats on the node are reported.

  2: If several supervisor also crush and will never recover[or all crush for some unknown reason], workers will report their heartbeats directly to master, so it has not any effect.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimeOutWorkerHeartbeatsRecoveryStrategy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isReady(Set<String> nodeIds)` Function to decide if the heartbeats is ready.
    `void` | `prepare(Map conf)` Function to prepare the strategy.
    `void` | `reportNodeId(String nodeId)` report the node id to this strategy to help to decide `isReady`.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TimeOutWorkerHeartbeatsRecoveryStrategy

          public TimeOutWorkerHeartbeatsRecoveryStrategy()

  - ### Method Detail

    - #### prepare

          public void prepare(Map conf)

      Description copied from interface: `IWorkerHeartbeatsRecoveryStrategy`

      Function to prepare the strategy.

      Specified by:
        `prepare` in interface `IWorkerHeartbeatsRecoveryStrategy`
      Parameters:
        `conf` - config

    - #### isReady

          public boolean isReady(Set<String> nodeIds)

      Description copied from interface: `IWorkerHeartbeatsRecoveryStrategy`

      Function to decide if the heartbeats is ready.

      Specified by:
        `isReady` in interface `IWorkerHeartbeatsRecoveryStrategy`
      Parameters:
        `nodeIds` - all the node ids from current physical plan[assignments], read from `ClusterState`
      Returns:
        true if all node worker heartbeats reported

    - #### reportNodeId

          public void reportNodeId(String nodeId)

      Description copied from interface: `IWorkerHeartbeatsRecoveryStrategy`

      report the node id to this strategy to help to decide `isReady`.

      Specified by:
        `reportNodeId` in interface `IWorkerHeartbeatsRecoveryStrategy`
      Parameters:
        `nodeId` - the node id from reported SupervisorWorkerHeartbeats

Copyright © 2021 The Apache Software Foundation. All rights reserved.