Package com.yahoo.search.cluster
Class TrafficNodeMonitor<T>
java.lang.Object
com.yahoo.search.cluster.BaseNodeMonitor<T>
com.yahoo.search.cluster.TrafficNodeMonitor<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
ConstructorDescriptionTrafficNodeMonitor
(T node, MonitorConfiguration configuration, boolean internal) Creates a new node monitor for a node -
Method Summary
Modifier and TypeMethodDescriptionvoid
failed
(ErrorMessage error) Called when this node fails.getNode()
Returns whether this node is currently is a state suitable for receiving traffic, or null if not knownvoid
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 requiredMethods inherited from class com.yahoo.search.cluster.BaseNodeMonitor
isInternal, isWorking, now
-
Constructor Details
-
TrafficNodeMonitor
Creates a new node monitor for a node
-
-
Method Details
-
getNode
- Overrides:
getNode
in classBaseNodeMonitor<T>
-
failed
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
Returns whether this node is currently is a state suitable for receiving traffic, or null if not known -
setWorking
Thread-safely changes the state of this node if required- Specified by:
setWorking
in classBaseNodeMonitor<T>
-