aboutsummaryrefslogtreecommitdiffstats
path: root/orchestrator
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@verizonmedia.com>2021-08-05 09:49:30 +0200
committerHåkon Hallingstad <hakon@verizonmedia.com>2021-08-05 09:49:30 +0200
commitbf61b5704afadd2b65af9b1756830f0686f64509 (patch)
tree771c6371025222caefa447b1695cc5218bc971eb /orchestrator
parent16277f3f494c1bcbe54e3f6d175bc536cf98f99e (diff)
Specify number of proxies, try 2 [run-systemtest]
Diffstat (limited to 'orchestrator')
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java43
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java6
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaOrchestration.java6
-rw-r--r--orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java4
4 files changed, 39 insertions, 20 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 6d50002669d..f54f6606000 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java
@@ -70,24 +70,45 @@ public class OrchestratorImpl implements Orchestrator {
private final ApplicationApiFactory applicationApiFactory;
@Inject
- public OrchestratorImpl(ClusterControllerClientFactory clusterControllerClientFactory,
+ public OrchestratorImpl(OrchestratorConfig orchestratorConfig,
+ ConfigserverConfig configServerConfig,
+ ClusterControllerClientFactory clusterControllerClientFactory,
StatusService statusService,
- OrchestratorConfig orchestratorConfig,
ServiceMonitor serviceMonitor,
- ConfigserverConfig configServerConfig,
FlagSource flagSource,
Zone zone)
{
+ this(clusterControllerClientFactory,
+ statusService,
+ serviceMonitor,
+ flagSource,
+ zone,
+ Clock.systemUTC(),
+ new ApplicationApiFactory(configServerConfig.zookeeperserver().size(),
+ orchestratorConfig.numProxies(),
+ Clock.systemUTC()),
+ orchestratorConfig.serviceMonitorConvergenceLatencySeconds());
+ }
+
+ private OrchestratorImpl(ClusterControllerClientFactory clusterControllerClientFactory,
+ StatusService statusService,
+ ServiceMonitor serviceMonitor,
+ FlagSource flagSource,
+ Zone zone,
+ Clock clock,
+ ApplicationApiFactory applicationApiFactory,
+ int serviceMonitorConvergenceLatencySeconds)
+ {
this(new HostedVespaPolicy(new HostedVespaClusterPolicy(flagSource, zone),
clusterControllerClientFactory,
- new ApplicationApiFactory(configServerConfig.zookeeperserver().size(), Clock.systemUTC())),
- clusterControllerClientFactory,
- statusService,
- serviceMonitor,
- orchestratorConfig.serviceMonitorConvergenceLatencySeconds(),
- Clock.systemUTC(),
- new ApplicationApiFactory(configServerConfig.zookeeperserver().size(), Clock.systemUTC()),
- flagSource);
+ applicationApiFactory),
+ clusterControllerClientFactory,
+ statusService,
+ serviceMonitor,
+ serviceMonitorConvergenceLatencySeconds,
+ clock,
+ applicationApiFactory,
+ flagSource);
}
public OrchestratorImpl(Policy policy,
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java
index a3f2fd6e235..82791d3b305 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiFactory.java
@@ -18,11 +18,17 @@ public class ApplicationApiFactory {
private final OrchestrationParams orchestrationParams;
private final Clock clock;
+ // TODO: REMOVE
public ApplicationApiFactory(int numberOfConfigServers, Clock clock) {
this.orchestrationParams = HostedVespaOrchestration.create(numberOfConfigServers, 0);
this.clock = clock;
}
+ public ApplicationApiFactory(int numberOfConfigServers, int numProxies, Clock clock) {
+ this.orchestrationParams = HostedVespaOrchestration.create(numberOfConfigServers, numProxies);
+ this.clock = clock;
+ }
+
public ApplicationApi create(NodeGroup nodeGroup,
ApplicationLock lock,
ClusterControllerClientFactory clusterControllerClientFactory) {
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaOrchestration.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaOrchestration.java
index e9a27cddaeb..e2c0c337dae 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaOrchestration.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaOrchestration.java
@@ -1,7 +1,6 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.orchestrator.policy;
-import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.vespa.applicationmodel.ClusterId;
import com.yahoo.vespa.applicationmodel.ServiceType;
@@ -12,11 +11,6 @@ import com.yahoo.vespa.applicationmodel.ServiceType;
* @author hakonhall
*/
public class HostedVespaOrchestration {
- public static OrchestrationParams create(ConfigserverConfig configserverConfig) {
- // todo: get the number of proxy nodes
- return create(configserverConfig.zookeeperserver().size(), 0);
- }
-
public static OrchestrationParams create(int numConfigServers, int numProxies) {
// We'll create parameters for both the controller and config server applications, even though
// only one of them is present, as (a) no harm is done by having the extra parameters, and
diff --git a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java
index 76d00943e07..20dfd03a86f 100644
--- a/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java
+++ b/orchestrator/src/test/java/com/yahoo/vespa/orchestrator/resources/ApplicationSuspensionRequestHandlerTest.java
@@ -44,11 +44,9 @@ class ApplicationSuspensionRequestHandlerTest {
void createHandler() {
DummyServiceMonitor serviceMonitor = new DummyServiceMonitor();
Orchestrator orchestrator = new OrchestratorImpl(
- new ClusterControllerClientFactoryMock(),
+ new OrchestratorConfig(new OrchestratorConfig.Builder()), new ConfigserverConfig(new ConfigserverConfig.Builder()), new ClusterControllerClientFactoryMock(),
new ZkStatusService(new MockCurator(), new MockMetric(), new SystemTimer(), serviceMonitor),
- new OrchestratorConfig(new OrchestratorConfig.Builder()),
serviceMonitor,
- new ConfigserverConfig(new ConfigserverConfig.Builder()),
new InMemoryFlagSource(),
Zone.defaultZone());
var handler = new ApplicationSuspensionRequestHandler(RestApiTestDriver.createHandlerTestContext(), orchestrator);