aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java
diff options
context:
space:
mode:
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java
index 76c8445eb8c..8c29b40bc26 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java
@@ -594,8 +594,9 @@ public abstract class NodeCandidate implements Nodelike, Comparable<NodeCandidat
PARENT_HOST_NOT_EXCLUSIVE
}
- public ExclusivityViolation violatesExclusivity(AllocationParams params, NodeList allNodes) {
- boolean hostSharing = params.nodeRepository().zone().getCloud().allowHostSharing();
+ public ExclusivityViolation violatesExclusivity(ClusterSpec cluster, ApplicationId application,
+ boolean exclusiveClusterType, boolean exclusiveAllocation, boolean exclusiveProvisioning,
+ boolean hostSharing, NodeList allNodes, boolean makeExclusive) {
if (parentHostname().isEmpty()) return ExclusivityViolation.NONE;
if (type() != NodeType.tenant) return ExclusivityViolation.NONE;
@@ -604,34 +605,34 @@ public abstract class NodeCandidate implements Nodelike, Comparable<NodeCandidat
// then all the nodes on the host must have the same owner.
for (Node nodeOnHost : allNodes.childrenOf(parentHostname().get())) {
if (nodeOnHost.allocation().isEmpty()) continue;
- if (params.exclusiveAllocation() || nodeOnHost.allocation().get().membership().cluster().isExclusive()) {
- if ( ! nodeOnHost.allocation().get().owner().equals(params.application())) return ExclusivityViolation.YES;
+ if (exclusiveAllocation || nodeOnHost.allocation().get().membership().cluster().isExclusive()) {
+ if ( ! nodeOnHost.allocation().get().owner().equals(application)) return ExclusivityViolation.YES;
}
}
} else {
// the parent is exclusive to another cluster type
- if ( ! emptyOrEqual(parent.flatMap(Node::exclusiveToClusterType), params.cluster().type()))
+ if ( ! emptyOrEqual(parent.flatMap(Node::exclusiveToClusterType), cluster.type()))
return ExclusivityViolation.YES;
// this cluster requires a parent that was provisioned exclusively for this cluster type
- if (params.exclusiveClusterType() && parent.flatMap(Node::exclusiveToClusterType).isEmpty() && params.makeExclusive())
+ if (exclusiveClusterType && parent.flatMap(Node::exclusiveToClusterType).isEmpty() && makeExclusive)
return ExclusivityViolation.YES;
// the parent is provisioned for another application
- if ( ! emptyOrEqual(parent.flatMap(Node::provisionedForApplicationId), params.application()))
+ if ( ! emptyOrEqual(parent.flatMap(Node::provisionedForApplicationId), application))
return ExclusivityViolation.YES;
// this cluster requires a parent that was provisioned for this application
- if (params.exclusiveProvisioning() && parent.flatMap(Node::provisionedForApplicationId).isEmpty())
+ if (exclusiveProvisioning && parent.flatMap(Node::provisionedForApplicationId).isEmpty())
return ExclusivityViolation.YES;
// the parent is exclusive to another application
- if ( ! emptyOrEqual(parent.flatMap(Node::exclusiveToApplicationId), params.application()))
+ if ( ! emptyOrEqual(parent.flatMap(Node::exclusiveToApplicationId), application))
return ExclusivityViolation.YES;
// this cluster requires exclusivity, but the parent is not exclusive
- if (params.exclusiveAllocation() && parent.flatMap(Node::exclusiveToApplicationId).isEmpty())
- return canMakeHostExclusive(params.makeExclusive(), type(), hostSharing) ?
+ if (exclusiveAllocation && parent.flatMap(Node::exclusiveToApplicationId).isEmpty())
+ return canMakeHostExclusive(makeExclusive, type(), hostSharing) ?
ExclusivityViolation.PARENT_HOST_NOT_EXCLUSIVE :
ExclusivityViolation.YES;
}