Class ClusterMonitor<T>

java.lang.Object
com.yahoo.search.cluster.ClusterMonitor<T>

public class ClusterMonitor<T> extends Object
Monitors of a cluster of remote nodes. The monitor uses an internal thread for node monitoring. All public methods of this class are multithread safe.
Author:
bratseth
  • Constructor Details

    • ClusterMonitor

      public ClusterMonitor(NodeManager<T> manager, boolean startPingThread)
  • Method Details

    • start

      public void start()
    • getConfiguration

      public MonitorConfiguration getConfiguration()
      Returns the configuration of this cluster monitor
    • isClosed

      public boolean isClosed()
    • add

      public void add(T node, boolean internal)
      Adds a new node for monitoring. The object representing the node must
      • Have a sensible toString
      • Have a sensible identity (equals and hashCode)
      Parameters:
      node - the object representing the node
      internal - whether or not this node is internal to this cluster
    • failed

      public void failed(T node, ErrorMessage error)
      Called from ClusterSearcher/NodeManager when a node failed
    • responded

      public void responded(T node)
      Called when a node responded
    • ping

      public void ping(Executor executor)
      Ping all nodes which needs pinging to discover state changes
    • nodeMonitorIterator

      public Iterator<BaseNodeMonitor<T>> nodeMonitorIterator()
      Returns a thread-safe snapshot of the NodeMonitors of all added nodes
    • nodeMonitors

      public List<BaseNodeMonitor<T>> nodeMonitors()
      Returns a thread-safe snapshot of the NodeMonitors of all added nodes
    • shutdown

      public void shutdown()
      Must be called when this goes out of use