Package org.btrplace.model.constraint
Class Split
java.lang.Object
org.btrplace.model.constraint.SimpleConstraint
org.btrplace.model.constraint.Split
- All Implemented Interfaces:
Constraint
,SatConstraint
@SideConstraint(args="part <<: vms", inv="{ {host(v). v : p , vmState(v) = running}. p : part} <<: nodes") public class Split extends SimpleConstraint
A constraint to force several sets of VMs to not share any node when they are
running.
When the restriction is discrete, the constraint ensures there is no co-location on only on a given model.
When the restriction is continuous, the constraint ensures a VM can not be set running on a node that is hosting VMs from another group, even temporary.
- Author:
- Fabien Hermenier
-
Constructor Summary
Constructors Constructor Description Split(Collection<Collection<VM>> parts)
Make a new constraint having a discrete restriction.Split(Collection<Collection<VM>> parts, boolean continuous)
Make a new constraint. -
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
Collection<VM>
getAssociatedVGroup(VM u)
Get the group of VMs that contains the given VM.SplitChecker
getChecker()
Get the validator used to check if a plan satisfies the constraint.Set<VM>
getInvolvedVMs()
Get the VMs involved in the constraint.Collection<Collection<VM>>
getSets()
Get the groups of VMs identifier.int
hashCode()
String
toString()
Methods inherited from class org.btrplace.model.constraint.SimpleConstraint
isContinuous, setContinuous
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.btrplace.model.constraint.SatConstraint
getInvolvedNodes, isSatisfied, isSatisfied
-
Constructor Details
-
Method Details
-
getInvolvedVMs
Description copied from interface:SatConstraint
Get the VMs involved in the constraint.- Returns:
- a set of VM identifiers that may be empty
-
getSets
Get the groups of VMs identifier.- Returns:
- the groups
-
getAssociatedVGroup
Get the group of VMs that contains the given VM.- Parameters:
u
- the VM identifier- Returns:
- the group of VM if exists, an empty collection otherwise
-
equals
-
hashCode
public int hashCode() -
toString
-
getChecker
Description copied from interface:SatConstraint
Get the validator used to check if a plan satisfies the constraint.- Returns:
- a non-null
SatConstraintChecker
-