abstract class AbstractRoundRobinRule extends java.lang.Object implements PlacementRule
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Optional<java.lang.Integer> |
distinctKeyCount |
protected StringMatcher |
taskFilter |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRoundRobinRule(StringMatcher taskFilter,
java.util.Optional<java.lang.Integer> distinctKeyCount) |
| Modifier and Type | Method and Description |
|---|---|
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. |
protected abstract java.lang.String |
getKey(Offer offer)
Returns a key to round robin against from the provided
Offer, or null if
none was found. |
protected abstract java.lang.String |
getKey(TaskInfo task)
Returns a key to round robin against from the provided
TaskInfo, or null if
none was found. |
int |
hashCode() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetPlacementFieldsprotected final StringMatcher taskFilter
protected final java.util.Optional<java.lang.Integer> distinctKeyCount
protected AbstractRoundRobinRule(StringMatcher taskFilter, java.util.Optional<java.lang.Integer> distinctKeyCount)
protected abstract java.lang.String getKey(Offer offer)
Offer, or null if
none was found.protected abstract java.lang.String getKey(TaskInfo task)
TaskInfo, or null if
none was found.public 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 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