|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.locality.constraint.evaluator.NodeGroupEvaluator
public class NodeGroupEvaluator
Evaluator that matches job execution to particular nodes
based on the Trigger
and JobDetail
groups they are in.
The rules for matching is loaded from quartzLocality.properties
where:
# Example of node groups org.quartz.locality.nodeGroup.group0 = node0 org.quartz.locality.nodeGroup.group1 = node1,node2 # Automagic dispatching based on trigger group org.quartz.locality.nodeGroup.group0.triggerGroups = blueTriggers org.quartz.locality.nodeGroup.group1.jobGroups = redJobsWhich, in this example, defines two groups:
group0
and group1
. Automatically
dispatching jobs being executed by Trigger
s of group blueTriggers
to group0
(and hence node0). While JobDetail
s of
group redJobs
will be dispatched to group1
(either node1 or node2)
Constructor Summary | |
---|---|
NodeGroupEvaluator()
Constructor initializing all the local data structures |
Method Summary | |
---|---|
String |
getNodeGroupForJobGroup(String jobGroup)
Retrieves the node group for a particular trigger group |
String |
getNodeGroupForTriggerGroup(String triggerGroup)
Retrieves the node group for a particular trigger group |
boolean |
isNodeInGroup(String nodeName,
String group)
Checks whether a node is part of a group |
boolean |
matches(NodeGroupConstraint constraint)
Evaluates the constraint against local node. |
List<String> |
suitedNodes(NodeGroupConstraint constraint)
Returns a list of best suited node (instanceId) based on the constraint |
void |
verify(NodeGroupConstraint constraint)
Verifies that the node group actually exists in the current configuration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeGroupEvaluator()
Method Detail |
---|
public boolean matches(NodeGroupConstraint constraint)
matches
in interface Evaluator<NodeGroupConstraint>
constraint
- The constraint to evaluate
Constraint#matches(Object)
public List<String> suitedNodes(NodeGroupConstraint constraint)
suitedNodes
in interface Evaluator<NodeGroupConstraint>
constraint
- To find best suited nodes for
public void verify(NodeGroupConstraint constraint) throws LocalityException
verify
in interface Evaluator<NodeGroupConstraint>
constraint
- The constraint to validate
LocalityException
- if node group is unknownpublic String getNodeGroupForTriggerGroup(String triggerGroup)
triggerGroup
- the TriggerKey
's group
null
if nullpublic String getNodeGroupForJobGroup(String jobGroup)
jobGroup
- the JobKey
's group
null
if nullpublic boolean isNodeInGroup(String nodeName, String group)
nodeName
- the instanceId of the nodegroup
- the group of the node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |