summaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-03-21 11:21:34 +0100
committerJon Bratseth <bratseth@oath.com>2018-03-21 11:21:34 +0100
commit6c6b48539d34b4e6189d6f6e7468ee782d823386 (patch)
treed53f16bb08b6af66c432adb01bca96d520f867d7 /node-repository
parent5366643befc4f8920af2d66499d5a8d7654721a5 (diff)
Improve method names
Diffstat (limited to 'node-repository')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java
index 9f24d25ed81..e459436756a 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeAllocation.java
@@ -100,7 +100,7 @@ class NodeAllocation {
if ( offered.flavor().isRetired()) wantToRetireNode = true;
if ( offered.status().wantToRetire()) wantToRetireNode = true;
if ( requestedNodes.isExclusive() &&
- ! hostHasOnly(application.tenant(), offered.parentHostname())) wantToRetireNode = true;
+ ! hostsOnly(application.tenant(), offered.parentHostname())) wantToRetireNode = true;
if (( ! saturated() && hasCompatibleFlavor(offered)) || acceptToRetire(offered) ) {
accepted.add(acceptNode(offeredPriority, wantToRetireNode));
@@ -111,11 +111,11 @@ class NodeAllocation {
++rejectedWithClashingParentHost;
continue;
}
- if ( ! hostCanHost(application.tenant(), offered.parentHostname())) {
+ if ( ! exclusiveTo(application.tenant(), offered.parentHostname())) {
++rejectedDueToExclusivity;
continue;
}
- if ( requestedNodes.isExclusive() && ! hostHasOnly(application.tenant(), offered.parentHostname())) {
+ if ( requestedNodes.isExclusive() && ! hostsOnly(application.tenant(), offered.parentHostname())) {
++rejectedDueToExclusivity;
continue;
}
@@ -149,7 +149,7 @@ class NodeAllocation {
* If a parent host is given, and it hosts another tenant with an application which requires exclusive access
* to the physical host, then we cannot host this application on it.
*/
- private boolean hostCanHost(TenantName tenant, Optional<String> parentHostname) {
+ private boolean exclusiveTo(TenantName tenant, Optional<String> parentHostname) {
if ( ! parentHostname.isPresent()) return true;
for (Node nodeOnHost : nodeRepository.getChildNodes(parentHostname.get())) {
if ( ! nodeOnHost.allocation().isPresent()) continue;
@@ -161,12 +161,12 @@ class NodeAllocation {
return true;
}
- private boolean hostHasOnly(TenantName tenant, Optional<String> parentHostname) {
+ private boolean hostsOnly(TenantName tenant, Optional<String> parentHostname) {
if ( ! parentHostname.isPresent()) return true; // yes, as host is exclusive
for (Node nodeOnHost : nodeRepository.getChildNodes(parentHostname.get())) {
if ( ! nodeOnHost.allocation().isPresent()) continue;
- if ( ! nodeOnHost.allocation().get().owner().tenant().equals(application.tenant()))
+ if ( ! nodeOnHost.allocation().get().owner().tenant().equals(tenant))
return false;
}
return true;