IEndpointStateChangeSubscriber (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.gms

## Interface IEndpointStateChangeSubscriber

- All Known Implementing Classes:
    ActiveRepairService, AnticompactionTask, LoadBroadcaster, ReconnectableSnitchHelper, RepairSession, StorageService, StreamSession

      public interface IEndpointStateChangeSubscriber

  This is called by an instance of the IEndpointStateChangePublisher to notify interested parties about changes in the the state associated with any endpoint. For instance if node A figures there is a changes in state for an endpoint B it notifies all interested parties of this change. It is upto to the registered instance to decide what he does with this change. Not all modules maybe interested in all state changes.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beforeChange(java.net.InetAddress endpoint, EndpointState currentState, ApplicationState newStateKey, VersionedValue newValue)`
    `void` | `onAlive(java.net.InetAddress endpoint, EndpointState state)`
    `void` | `onChange(java.net.InetAddress endpoint, ApplicationState state, VersionedValue value)`
    `void` | `onDead(java.net.InetAddress endpoint, EndpointState state)`
    `void` | `onJoin(java.net.InetAddress endpoint, EndpointState epState)` Use to inform interested parties about the change in the state for specified endpoint
    `void` | `onRemove(java.net.InetAddress endpoint)`
    `void` | `onRestart(java.net.InetAddress endpoint, EndpointState state)` Called whenever a node is restarted.

- - ### Method Detail

    - #### onJoin

          void onJoin(java.net.InetAddress endpoint,
                      EndpointState epState)

      Use to inform interested parties about the change in the state for specified endpoint
      Parameters:
        `endpoint` - endpoint for which the state change occurred.
        `epState` - state that actually changed for the above endpoint.

    - #### beforeChange

          void beforeChange(java.net.InetAddress endpoint,
                            EndpointState currentState,
                            ApplicationState newStateKey,
                            VersionedValue newValue)

    - #### onChange

          void onChange(java.net.InetAddress endpoint,
                        ApplicationState state,
                        VersionedValue value)

    - #### onAlive

          void onAlive(java.net.InetAddress endpoint,
                       EndpointState state)

    - #### onDead

          void onDead(java.net.InetAddress endpoint,
                      EndpointState state)

    - #### onRemove

          void onRemove(java.net.InetAddress endpoint)

    - #### onRestart

          void onRestart(java.net.InetAddress endpoint,
                         EndpointState state)

      Called whenever a node is restarted. Note that there is no guarantee when that happens that the node was previously marked down. It will have only if `state.isAlive() == false` as `state` is from before the restarted node is marked up.

Copyright © 2018 The Apache Software Foundation