org.terracotta.modules.ehcache.store
Class EhcacheEvaluator

java.lang.Object
  extended by org.terracotta.modules.ehcache.store.EhcacheEvaluator
All Implemented Interfaces:
Evaluator<EhcacheConstraint>

public class EhcacheEvaluator
extends java.lang.Object
implements Evaluator<EhcacheConstraint>

Ehcache evaluator, which lets Jobs be executed on certain node, depending of the locality of the data in a Ehcache

Author:
Alex Snaps

Constructor Summary
EhcacheEvaluator(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> nodeIdToInstanceId)
          Constructor
 
Method Summary
 boolean matches(EhcacheConstraint constraint)
          Evaluates the constraint against local node.
 java.util.List<java.lang.String> suitedNodes(EhcacheConstraint constraint)
          Returns a list of best suited node (instanceId) based on the constraint
 void verify(EhcacheConstraint constraint)
          Doesn't do anything
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EhcacheEvaluator

public EhcacheEvaluator(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.String> nodeIdToInstanceId)
Constructor

Parameters:
nodeIdToInstanceId - the Map of nodeId (Terracotta) to instanceId (Quartz) mapping file (read only)
Method Detail

matches

public boolean matches(EhcacheConstraint constraint)
Evaluates the constraint against local node.

Specified by:
matches in interface Evaluator<EhcacheConstraint>
Parameters:
constraint - The constraint to evaluate
Returns:
true if local node is a match
See Also:
Constraint#matches(Object)

suitedNodes

public java.util.List<java.lang.String> suitedNodes(EhcacheConstraint constraint)
Returns a list of best suited node (instanceId) based on the constraint

Specified by:
suitedNodes in interface Evaluator<EhcacheConstraint>
Parameters:
constraint - To find best suited nodes for
Returns:
List of best suited Quartz instanceId

verify

public void verify(EhcacheConstraint constraint)
Doesn't do anything

Specified by:
verify in interface Evaluator<EhcacheConstraint>
Parameters:
constraint - The constraint to validate


Copyright 2001-2011, Terracotta, Inc.