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 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(ConcurrentMap<String,String> nodeIdToInstanceId)
          Constructor
 
Method Summary
 boolean matches(EhcacheConstraint constraint)
          Evaluates the constraint against local node.
 List<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(ConcurrentMap<String,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 List<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-2013, Terracotta, Inc.