Class TrafficNodeMonitor<T>

java.lang.Object
com.yahoo.search.cluster.BaseNodeMonitor<T>
com.yahoo.search.cluster.TrafficNodeMonitor<T>

public class TrafficNodeMonitor<T> extends BaseNodeMonitor<T>
This node monitor is responsible for maintaining the state of a monitored node. It has the following properties:
  • A node is taken out of operation if it gives no response in 10 s
  • A node is put back in operation when it responds correctly again
Author:
Steinar Knutsen
  • Constructor Details

    • TrafficNodeMonitor

      public TrafficNodeMonitor(T node, MonitorConfiguration configuration, boolean internal)
      Creates a new node monitor for a node
  • Method Details

    • getNode

      public T getNode()
      Overrides:
      getNode in class BaseNodeMonitor<T>
    • failed

      public void failed(ErrorMessage error)
      Called when this node fails.
      Specified by:
      failed in class BaseNodeMonitor<T>
      Parameters:
      error - a container which should contain a short description
    • responded

      public void responded()
      Called when a response is received from this node.
      Specified by:
      responded in class BaseNodeMonitor<T>
    • isKnownWorking

      public Boolean isKnownWorking()
      Returns whether this node is currently is a state suitable for receiving traffic, or null if not known
    • setWorking

      protected void setWorking(boolean working, String explanation)
      Thread-safely changes the state of this node if required
      Specified by:
      setWorking in class BaseNodeMonitor<T>