summaryrefslogtreecommitdiffstats
path: root/node-admin/src/main
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@oath.com>2017-09-19 12:36:21 +0200
committerValerij Fredriksen <valerijf@oath.com>2017-09-22 09:13:01 +0200
commit57e34c696f3a38b65da4b66bc47ebfbb8e30d018 (patch)
tree5d5ac479ab335ed583d66611073eac79bcc46f31 /node-admin/src/main
parent055759d50e49b23114e305dcce9e15d1036f8ecc (diff)
Make Orchestrator constructor same as NodeRepository
Diffstat (limited to 'node-admin/src/main')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/orchestrator/OrchestratorImpl.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/orchestrator/OrchestratorImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/orchestrator/OrchestratorImpl.java
index 5117a1bb079..bd9df486e7b 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/orchestrator/OrchestratorImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/orchestrator/OrchestratorImpl.java
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.node.admin.orchestrator;
-import com.yahoo.vespa.defaults.Defaults;
-
import com.yahoo.vespa.hosted.node.admin.util.ConfigServerHttpRequestExecutor;
import com.yahoo.vespa.orchestrator.restapi.HostApi;
@@ -19,7 +17,6 @@ import java.util.Optional;
* @author dybis
*/
public class OrchestratorImpl implements Orchestrator {
- static final int WEB_SERVICE_PORT = Defaults.getDefaults().vespaWebServicePort();
// TODO: Find a way to avoid duplicating this (present in orchestrator's services.xml also).
private static final String ORCHESTRATOR_PATH_PREFIX = "/orchestrator";
static final String ORCHESTRATOR_PATH_PREFIX_HOST_API
@@ -28,9 +25,11 @@ public class OrchestratorImpl implements Orchestrator {
= ORCHESTRATOR_PATH_PREFIX + HostSuspensionApi.PATH_PREFIX;
private final ConfigServerHttpRequestExecutor requestExecutor;
+ private final int port;
- public OrchestratorImpl(ConfigServerHttpRequestExecutor requestExecutor) {
+ public OrchestratorImpl(ConfigServerHttpRequestExecutor requestExecutor, int port) {
this.requestExecutor = requestExecutor;
+ this.port = port;
}
@Override
@@ -38,7 +37,7 @@ public class OrchestratorImpl implements Orchestrator {
UpdateHostResponse response;
try {
response = requestExecutor.put(getSuspendPath(hostName),
- WEB_SERVICE_PORT,
+ port,
Optional.empty(), /* body */
UpdateHostResponse.class);
} catch (ConfigServerHttpRequestExecutor.NotFoundException n) {
@@ -58,7 +57,7 @@ public class OrchestratorImpl implements Orchestrator {
try {
batchOperationResult = requestExecutor.put(
ORCHESTRATOR_PATH_PREFIX_HOST_SUSPENSION_API,
- WEB_SERVICE_PORT,
+ port,
Optional.of(new BatchHostSuspendRequest(parentHostName, hostNames)),
BatchOperationResult.class);
} catch (Exception e) {
@@ -75,7 +74,7 @@ public class OrchestratorImpl implements Orchestrator {
UpdateHostResponse response;
try {
String path = getSuspendPath(hostName);
- response = requestExecutor.delete(path, WEB_SERVICE_PORT, UpdateHostResponse.class);
+ response = requestExecutor.delete(path, port, UpdateHostResponse.class);
} catch (ConfigServerHttpRequestExecutor.NotFoundException n) {
throw new OrchestratorNotFoundException("Failed to resume " + hostName + ", host not found");
} catch (Exception e) {