org.quartz.locality.constraint
Class CpuConstraint
java.lang.Object
org.quartz.locality.constraint.CpuConstraint
- All Implemented Interfaces:
- Serializable, Constraint<CpuConstraint.Operator,Integer>
public class CpuConstraint
- extends Object
- implements Constraint<CpuConstraint.Operator,Integer>
Cpu based constraint for best node evaluation
- Author:
- Alex Snaps
- See Also:
CpuEvaluator
,
Serialized Form
CpuConstraint
public CpuConstraint(CpuConstraint.Operator op,
int value)
- Parameters:
op
- value
-
getOp
public CpuConstraint.Operator getOp()
getValue
public int getValue()
matches
public boolean matches(Integer actual)
threadsAvailableAtLeast
public static CpuConstraint threadsAvailableAtLeast(int amount)
- Creates a constraint that requires the node to have a least an
amount
of threads available
- Parameters:
amount
- Number of threads to be available
- Returns:
- The
CpuConstraint
coresAtLeast
public static CpuConstraint coresAtLeast(int amount)
- Creates a constraint that requires the node to have a least an
amount
of core
- Parameters:
amount
- Number of cores
- Returns:
- The
CpuConstraint
loadAtMost
public static CpuConstraint loadAtMost(double amount)
- Creates a constraint that requires the node to have at most a certain load
- Parameters:
amount
- The maximum load the node can currently have
- Returns:
- The
CpuConstraint
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright 2001-2011,
Terracotta, Inc.