org.quartz.locality.constraint.evaluator
Class MemoryEvaluator
java.lang.Object
java.util.TimerTask
org.quartz.locality.constraint.evaluator.EvaluatorTimerTask
org.quartz.locality.constraint.evaluator.MemoryEvaluator
- All Implemented Interfaces:
- Runnable, Evaluator<MemoryConstraint>, PersistentEvaluator<MemoryConstraint,Long>
public class MemoryEvaluator
- extends EvaluatorTimerTask
- implements PersistentEvaluator<MemoryConstraint,Long>
Evaluates memory constraints
- Author:
- Alex Snaps
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MemoryEvaluator
public MemoryEvaluator()
matches
public boolean matches(MemoryConstraint constraint)
- Evaluates the constraint against local node.
- Specified by:
matches
in interface Evaluator<MemoryConstraint>
- Parameters:
constraint
- The constraint to evaluate
- Returns:
- true if local node is a match
- See Also:
Constraint#matches(Object)
matches
public boolean matches(MemoryConstraint constraint,
String node)
- Verifies whether the constraint passed is validating on the node
- Parameters:
constraint
- The constraint to evaluatenode
- The node to evaluate against
- Returns:
- true if node is a match
suitedNodes
public List<String> suitedNodes(MemoryConstraint constraint)
- Returns a list of best suited node (instanceId) based on the constraint
- Specified by:
suitedNodes
in interface Evaluator<MemoryConstraint>
- Parameters:
constraint
- To find best suited nodes for
- Returns:
- List of best suited Quartz instanceId
verify
public void verify(MemoryConstraint constraint)
- Always true
- Specified by:
verify
in interface Evaluator<MemoryConstraint>
- Parameters:
constraint
- The constraint to validate
monitor
public void monitor()
- Performs the monitoring of the free memory on the local node
- Specified by:
monitor
in class EvaluatorTimerTask
initialize
public void initialize(String nodeName,
ConcurrentMap<String,Long> map)
- Will start the monitoring, to store available memory on the local node in the shared map.
- Specified by:
initialize
in interface PersistentEvaluator<MemoryConstraint,Long>
- Parameters:
nodeName
- Local instanceIdmap
- the shared persistent storage for the Evaluator
Copyright 2001-2011,
Terracotta, Inc.