Class NodeAndClusterIdStateListener

java.lang.Object
org.elasticsearch.common.logging.NodeAndClusterIdStateListener
All Implemented Interfaces:
ClusterStateObserver.Listener

public class NodeAndClusterIdStateListener
extends java.lang.Object
implements ClusterStateObserver.Listener
The NodeAndClusterIdStateListener listens to cluster state changes and ONLY when receives the first update it sets the clusterUUID and nodeID in log4j pattern converter NodeAndClusterIdConverter. Once the first update is received, it will automatically be de-registered from subsequent updates.
  • Method Summary

    Modifier and Type Method Description
    static void getAndSetNodeIdAndClusterId​(ClusterService clusterService, ThreadContext threadContext)
    Subscribes for the first cluster state update where nodeId and clusterId is present and sets these values in NodeAndClusterIdConverter.
    void onClusterServiceClose()
    called when the cluster service is closed
    void onNewClusterState​(ClusterState state)
    called when a new state is observed
    void onTimeout​(org.elasticsearch.common.unit.TimeValue timeout)  

    Methods inherited from class java.lang.Object

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