summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java
index cb8abb919ac..a52b4d915c9 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainer.java
@@ -1,6 +1,7 @@
-// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.container;
+import com.yahoo.cloud.config.ZookeeperServerConfig;
import com.yahoo.config.model.api.container.ContainerServiceType;
import com.yahoo.config.model.producer.AbstractConfigProducer;
import com.yahoo.config.provision.NodeResources;
@@ -15,17 +16,19 @@ import com.yahoo.vespa.model.container.component.Component;
*
* @author gjoranv
*/
-public final class ApplicationContainer extends Container implements QrStartConfig.Producer {
+public final class ApplicationContainer extends Container implements
+ QrStartConfig.Producer,
+ ZookeeperServerConfig.Producer {
private static final String defaultHostedJVMArgs = "-XX:+UseOSErrorReporting -XX:+SuppressFatalErrorMessage";
private final boolean isHostedVespa;
- public ApplicationContainer(AbstractConfigProducer parent, String name, int index, boolean isHostedVespa) {
+ public ApplicationContainer(AbstractConfigProducer<?> parent, String name, int index, boolean isHostedVespa) {
this(parent, name, false, index, isHostedVespa);
}
- public ApplicationContainer(AbstractConfigProducer parent, String name, boolean retired, int index, boolean isHostedVespa) {
+ public ApplicationContainer(AbstractConfigProducer<?> parent, String name, boolean retired, int index, boolean isHostedVespa) {
super(parent, name, retired, index, isHostedVespa);
this.isHostedVespa = isHostedVespa;
@@ -51,7 +54,7 @@ public final class ApplicationContainer extends Container implements QrStartConf
@Override
protected ContainerServiceType myServiceType() {
if (parent instanceof ContainerCluster) {
- ContainerCluster cluster = (ContainerCluster)parent;
+ ContainerCluster<?> cluster = (ContainerCluster<?>)parent;
// TODO: The 'qrserver' name is retained for legacy reasons (e.g. system tests and log parsing).
if (cluster.getSearch() != null && cluster.getDocproc() == null && cluster.getDocumentApi() == null) {
return ContainerServiceType.QRSERVER;
@@ -70,6 +73,17 @@ public final class ApplicationContainer extends Container implements QrStartConf
}
private boolean hasDocproc() {
- return (parent instanceof ContainerCluster) && (((ContainerCluster)parent).getDocproc() != null);
+ return (parent instanceof ContainerCluster) && (((ContainerCluster<?>)parent).getDocproc() != null);
}
+
+ @Override
+ public void getConfig(ZookeeperServerConfig.Builder builder) {
+ AbstractConfigProducer<?> parent = getParent();
+ if (parent == null) return;
+
+ if (parent instanceof ApplicationContainerCluster)
+ ((ApplicationContainerCluster) this.parent).getConfig(builder);
+ builder.myid(index());
+ }
+
}