Package com.yahoo.search.cluster
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
-
-
Field Summary
-
Fields inherited from class com.yahoo.search.cluster.BaseNodeMonitor
configuration, failedAt, isQuarantined, isWorking, log, node, respondedAt, succeededAt
-
-
Constructor Summary
Constructors Constructor Description TrafficNodeMonitor(T node, MonitorConfiguration configuration, boolean internal)
Creates a new node monitor for a node
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
failed(ErrorMessage error)
Called when this node fails.T
getNode()
Boolean
isKnownWorking()
Returns whether this node is currently is a state suitable for receiving traffic, or null if not knownvoid
responded()
Called when a response is received from this node.protected void
setWorking(boolean working, String explanation)
Thread-safely changes the state of this node if required-
Methods inherited from class com.yahoo.search.cluster.BaseNodeMonitor
isIdle, isInternal, isQuarantined, isWorking, now
-
-
-
-
Constructor Detail
-
TrafficNodeMonitor
public TrafficNodeMonitor(T node, MonitorConfiguration configuration, boolean internal)
Creates a new node monitor for a node
-
-
Method Detail
-
getNode
public T getNode()
- Overrides:
getNode
in classBaseNodeMonitor<T>
-
failed
public void failed(ErrorMessage error)
Called when this node fails.- Specified by:
failed
in classBaseNodeMonitor<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 classBaseNodeMonitor<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 classBaseNodeMonitor<T>
-
-