diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2020-02-24 09:20:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 09:20:24 +0100 |
commit | 0816207eafbd4a3dc51b41c13df9fccd9c8e54ee (patch) | |
tree | 096be9950b916a8770b548fe655315835c93314b | |
parent | 712f2f21dd852661348c4cd50d21a753e393e015 (diff) | |
parent | 0576b2e7677ecb8e6d12ab32735c6438b68dbb7e (diff) |
Merge pull request #12275 from vespa-engine/hakonhall/remove-unnecessary-gethostinfo
Remove unnecessary getHostInfo
4 files changed, 3 insertions, 11 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 f860370faf9..d0062966a6d 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java @@ -165,7 +165,7 @@ public class OrchestratorImpl implements Orchestrator { OrchestratorContext context = OrchestratorContext.createContextForSingleAppOp(clock); try (MutableStatusRegistry statusRegistry = statusService .lockApplicationInstance_forCurrentThreadOnly(context, appInstance.reference())) { - HostStatus currentHostState = statusRegistry.getHostInfo(hostName).status(); + HostStatus currentHostState = statusRegistry.getHostInfos().getOrNoRemarks(hostName).status(); if (currentHostState == HostStatus.NO_REMARKS) { return; } 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 d2042dc9fd2..24da83364aa 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 @@ -17,9 +17,6 @@ public interface MutableStatusRegistry extends AutoCloseable { /** Returns the status of this application. */ ApplicationInstanceStatus getStatus(); - /** Returns the host info of the given host. */ - HostInfo getHostInfo(HostName hostName); - /** Returns a snapshot of all host infos for this application. */ HostInfos getHostInfos(); 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 b4025167187..2cdce350377 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 @@ -371,11 +371,6 @@ public class ZookeeperStatusService implements StatusService { } @Override - public HostInfo getHostInfo(HostName hostName) { - return ZookeeperStatusService.this.getHostInfo(applicationInstanceReference, hostName); - } - - @Override public HostInfos getHostInfos() { return hostInfosCache.getHostInfos(applicationInstanceReference); } diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusServiceTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusServiceTest.java index 12622f22837..687ea951f88 100644 --- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusServiceTest.java +++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusServiceTest.java @@ -117,7 +117,7 @@ public class ZookeeperStatusServiceTest { TestIds.HOST_NAME1, hostStatus); - assertThat(statusRegistry.getHostInfo(TestIds.HOST_NAME1).status(), + assertThat(statusRegistry.getHostInfos().getOrNoRemarks(TestIds.HOST_NAME1).status(), is(hostStatus)); } } @@ -182,7 +182,7 @@ public class ZookeeperStatusServiceTest { killSession(curator.framework(), testingServer); //Throws SessionFailedException if the SessionFailRetryLoop has not been closed. - statusRegistry.getHostInfo(TestIds.HOST_NAME1); + statusRegistry.getHostInfos().getOrNoRemarks(TestIds.HOST_NAME1); }); assertThat(resultOfZkOperationAfterLockFailure, notHoldsException()); |