public class HostAttrValueConstraint extends java.lang.Object implements ConstraintEvaluator
ConstraintEvaluator.Result
Constructor and Description |
---|
HostAttrValueConstraint(java.lang.String hostAttributeName,
Func1<java.lang.String,java.lang.String> hostAttributeValueGetter) |
Modifier and Type | Method and Description |
---|---|
ConstraintEvaluator.Result |
evaluate(TaskRequest taskRequest,
VirtualMachineCurrentState targetVM,
TaskTrackerState taskTrackerState)
Tests a host to determine whether it has an attribute of the required value for this task request.
|
java.lang.String |
getName()
Returns the name of this constraint as a String, in the form of the class name followed by a dash
followed by the value of
hostAttributeName as it was set when this object was constructed. |
public HostAttrValueConstraint(java.lang.String hostAttributeName, Func1<java.lang.String,java.lang.String> hostAttributeValueGetter)
public java.lang.String getName()
hostAttributeName
as it was set when this object was constructed.getName
in interface ConstraintEvaluator
public ConstraintEvaluator.Result evaluate(TaskRequest taskRequest, VirtualMachineCurrentState targetVM, TaskTrackerState taskTrackerState)
evaluate
in interface ConstraintEvaluator
taskRequest
- describes the task being evaluated for assignment to the hosttargetVM
- describes the host being evaluated as a target for the tasktaskTrackerState
- describes the state of tasks already assigned or running on hosts throughout the
system