aboutsummaryrefslogtreecommitdiffstats
path: root/orchestrator
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@verizonmedia.com>2020-01-30 11:37:54 +0100
committerHåkon Hallingstad <hakon@verizonmedia.com>2020-01-30 11:37:54 +0100
commitc1985cf796f265ffb929b49f944e63158558e8da (patch)
tree98369b96677da6f8b7d6415f92a5cf94ae9e41b6 /orchestrator
parenta2777855122b34b49b4b98633eb131a67e74b2f7 (diff)
Remove unused suspendedHostnames
Diffstat (limited to 'orchestrator')
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java2
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java4
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/HostInfos.java8
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/MutableStatusRegistry.java19
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusService.java7
5 files changed, 7 insertions, 33 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java
index d5a797ac665..3232d2e5d9d 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java
@@ -335,7 +335,7 @@ public class OrchestratorImpl implements Orchestrator {
if (status == ApplicationInstanceStatus.ALLOWED_TO_BE_DOWN) {
ApplicationInstance application = getApplicationInstance(appRef);
- HostInfos hostInfosSnapshot = statusRegistry.getHostInfosSnapshot();
+ HostInfos hostInfosSnapshot = statusRegistry.getHostInfos();
// Mark it allowed to be down before we manipulate the clustercontroller
OrchestratorUtil.getHostsUsedByApplicationInstance(application)
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java
index 3e43e3e4f73..def5edd0a97 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java
@@ -18,10 +18,8 @@ import java.util.Collection;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import java.util.Optional;
import java.util.Set;
-import java.util.function.Function;
import java.util.stream.Collectors;
import static com.yahoo.vespa.orchestrator.OrchestratorUtil.getHostsUsedByApplicationInstance;
@@ -45,7 +43,7 @@ public class ApplicationApiImpl implements ApplicationApi {
this.nodeGroup = nodeGroup;
this.hostStatusService = hostStatusService;
Collection<HostName> hosts = getHostsUsedByApplicationInstance(applicationInstance);
- this.hostInfos = hostStatusService.getHostInfosSnapshot();
+ this.hostInfos = hostStatusService.getHostInfos();
this.clusterInOrder = makeClustersInOrder(nodeGroup, hostInfos, clusterControllerClientFactory, numberOfConfigServers);
}
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/HostInfos.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/HostInfos.java
index e644ef4c103..1acd82662a4 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/HostInfos.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/HostInfos.java
@@ -24,14 +24,6 @@ public class HostInfos {
this.hostInfos = Map.of();
}
- /** Get all suspended hostnames. */
- public Set<HostName> suspendedHostnames() {
- return hostInfos.entrySet().stream()
- .filter(entry -> entry.getValue().status().isSuspended())
- .map(entry -> entry.getKey())
- .collect(Collectors.toSet());
- }
-
/** Get host info for hostname, returning a NO_REMARKS HostInfo if unknown. */
public HostInfo getOrNoRemarks(HostName hostname) {
return hostInfos.getOrDefault(hostname, HostInfo.createNoRemarks());
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/MutableStatusRegistry.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/MutableStatusRegistry.java
index 7703b50b8f3..d2042dc9fd2 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/MutableStatusRegistry.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/MutableStatusRegistry.java
@@ -14,27 +14,16 @@ import java.util.Set;
*/
public interface MutableStatusRegistry extends AutoCloseable {
- /**
- * Returns the status of this application.
- */
+ /** Returns the status of this application. */
ApplicationInstanceStatus getStatus();
/** Returns the host info of the given host. */
HostInfo getHostInfo(HostName hostName);
- /**
- * Returns the set of all suspended hosts for this application.
- */
- Set<HostName> getSuspendedHosts();
+ /** Returns a snapshot of all host infos for this application. */
+ HostInfos getHostInfos();
- /**
- * Returns a snapshot of all host infos for this application.
- */
- HostInfos getHostInfosSnapshot();
-
- /**
- * Sets the state for the given host.
- */
+ /** Sets the state for the given host. */
void setHostState(HostName hostName, HostStatus status);
/**
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusService.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusService.java
index d791c76ba6b..e192f25d68c 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusService.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusService.java
@@ -363,12 +363,7 @@ public class ZookeeperStatusService implements StatusService {
}
@Override
- public Set<HostName> getSuspendedHosts() {
- return hostInfosCache.getHostInfos(applicationInstanceReference).suspendedHostnames();
- }
-
- @Override
- public HostInfos getHostInfosSnapshot() {
+ public HostInfos getHostInfos() {
return hostInfosCache.getHostInfos(applicationInstanceReference);
}