diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-02-19 21:02:59 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-02-19 21:02:59 +0100 |
commit | b4b323749c7f1ea6aa64190bcf61c13baebfa3dd (patch) | |
tree | 32246277759a8681449382581d974aa6a3696ebd /orchestrator | |
parent | eaa8348f763045387ae231be51da1782ffe434ec (diff) |
Remove unused code, and fix doc
Diffstat (limited to 'orchestrator')
5 files changed, 2 insertions, 25 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/ApplicationStateChangeDeniedException.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/ApplicationStateChangeDeniedException.java index 4b5333d2ff2..0668f5ea164 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/ApplicationStateChangeDeniedException.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/ApplicationStateChangeDeniedException.java @@ -11,10 +11,6 @@ public class ApplicationStateChangeDeniedException extends Exception { final String reason; - public ApplicationStateChangeDeniedException() { - this("Unknown"); - } - public ApplicationStateChangeDeniedException(String reason) { super(); this.reason = reason; diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorUtil.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorUtil.java index 40a45627f4d..5e4491d854e 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorUtil.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorUtil.java @@ -46,23 +46,6 @@ public class OrchestratorUtil { .collect(toSet()); } - public static Set<ServiceCluster> getServiceClustersUsingHost(Collection<ServiceCluster> serviceClusters, - HostName hostName) { - return serviceClusters.stream() - .filter(serviceCluster -> hasServiceInstanceOnHost(serviceCluster, hostName)) - .collect(toSet()); - } - - private static boolean hasServiceInstanceOnHost(ServiceCluster serviceCluster, HostName hostName) { - return serviceInstancesOnHost(serviceCluster, hostName).count() > 0; - } - - public static Stream<ServiceInstance> serviceInstancesOnHost(ServiceCluster serviceCluster, - HostName hostName) { - return serviceCluster.serviceInstances().stream() - .filter(instance -> instance.hostName().equals(hostName)); - } - private static final Pattern APPLICATION_INSTANCE_REFERENCE_REST_FORMAT_PATTERN = Pattern.compile("^([^:]+):(.+)$"); /** Returns an ApplicationInstanceReference constructed from the serialized format used in the REST API. */ diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerStateRequest.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerStateRequest.java index b07a9e2bfa1..696c01689f9 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerStateRequest.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/ClusterControllerStateRequest.java @@ -92,7 +92,7 @@ public class ClusterControllerStateRequest { @Override public String toString() { - return "reason: " + reason.toString() + ", state: " + state.toString(); + return "reason: " + reason + ", state: " + state; } } 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 7ee1395b7e7..29307b36f4b 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 @@ -46,7 +46,6 @@ public class ApplicationApiImpl implements ApplicationApi { this.nodeGroup = nodeGroup; this.lock = lock; this.clock = clock; - Collection<HostName> hosts = getHostsUsedByApplicationInstance(applicationInstance); this.hostInfos = lock.getHostInfos(); this.clusterInOrder = makeClustersInOrder(nodeGroup, hostInfos, clusterControllerClientFactory, numberOfConfigServers); } diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java index 3ee72769cf3..f3bfb30aa5a 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/VespaModelUtil.java @@ -117,8 +117,7 @@ public class VespaModelUtil { } /** - * @return Host name for a Cluster Controller that is likely to be the master, is !isPresent() if - * no cluster controller was found. + * @return Host name for a Cluster Controller that is likely to be the master. * @throws java.lang.IllegalArgumentException if there are no cluster controller instances. */ public static HostName getControllerHostName(ApplicationInstance application, ClusterId contentClusterId) { |