org.quartz.locality.constraint
Class CpuConstraint

java.lang.Object
  extended by 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

Nested Class Summary
static class CpuConstraint.Operator
           
 
Constructor Summary
CpuConstraint(CpuConstraint.Operator op, int value)
           
 
Method Summary
static CpuConstraint coresAtLeast(int amount)
          Creates a constraint that requires the node to have a least an amount of core
 boolean equals(Object obj)
           
 CpuConstraint.Operator getOp()
           
 int getValue()
           
 int hashCode()
           
static CpuConstraint loadAtMost(double amount)
          Creates a constraint that requires the node to have at most a certain load
 boolean matches(Integer actual)
           
static CpuConstraint threadsAvailableAtLeast(int amount)
          Creates a constraint that requires the node to have a least an amount of threads available
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CpuConstraint

public CpuConstraint(CpuConstraint.Operator op,
                     int value)
Parameters:
op -
value -
Method Detail

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-2013, Terracotta, Inc.