public class AgentRule extends java.lang.Object implements PlacementRule
| Modifier and Type | Method and Description |
|---|---|
static PlacementRule |
avoid(java.util.Collection<java.lang.String> agentIds)
Requires that a task NOT be placed on any of the provided agents.
|
static PlacementRule |
avoid(java.lang.String... agentIds)
Requires that a task NOT be placed on any of the provided agents.
|
static PlacementRule |
avoid(java.lang.String agentId)
Requires that a task NOT be placed on the provided agent.
|
boolean |
equals(java.lang.Object o)
Must be explicitly implemented by all PlacementRules.
|
EvaluationOutcome |
filter(Offer offer,
PodInstance podInstance,
java.util.Collection<TaskInfo> tasks)
Returns whether the provided
Offer, combined with the accompanying
TaskInfos, passes or fails this placement constraint. |
java.util.Collection<PlacementField> |
getPlacementFields()
Returns the
PlacementFields to which this rule applies. |
int |
hashCode() |
static PlacementRule |
require(java.util.Collection<java.lang.String> agentIds)
Requires that a task be placed on one of the provided agents.
|
static PlacementRule |
require(java.lang.String... agentIds)
Requires that a task be placed on one of the provided agents.
|
static PlacementRule |
require(java.lang.String agentId)
Requires that a task be placed on the provided agent.
|
java.lang.String |
toString() |
public static PlacementRule require(java.lang.String agentId)
agentId - mesos ID of the agent to requirepublic static PlacementRule require(java.util.Collection<java.lang.String> agentIds)
agentIds - mesos ID of the agents to requirepublic static PlacementRule require(java.lang.String... agentIds)
agentIds - mesos ID of the agents to requirepublic static PlacementRule avoid(java.lang.String agentId)
agentId - mesos ID of the agent to avoidpublic static PlacementRule avoid(java.util.Collection<java.lang.String> agentIds)
agentIds - mesos ID of the agents to avoidpublic static PlacementRule avoid(java.lang.String... agentIds)
agentIds - mesos ID of the agents to avoidpublic EvaluationOutcome filter(Offer offer, PodInstance podInstance, java.util.Collection<TaskInfo> tasks)
PlacementRuleOffer, combined with the accompanying
TaskInfos, passes or fails this placement constraint.filter in interface PlacementRuleoffer - the offer to be examinedtasks - the currently deployed tasks in the system, possibly including a duplicate
of the task being launched as represented in the offerRequirement. Use
PlacementUtils.areEquivalent(TaskInfo, PodInstance) to detect
duplicatesEvaluationOutcome object describing whether the placement succeeded or failed and whypublic java.util.Collection<PlacementField> getPlacementFields()
PlacementRulePlacementFields to which this rule applies.getPlacementFields in interface PlacementRulepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
PlacementRuleequals in interface PlacementRuleequals in class java.lang.ObjectTaskUtils.areDifferent(
com.mesosphere.sdk.specification.TaskSpec,
com.mesosphere.sdk.specification.TaskSpec)public int hashCode()
hashCode in class java.lang.Object