diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-11-17 14:12:02 +0100 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-11-17 14:12:02 +0100 |
commit | a749740a9ae84e78c597acf9361be945a28a68a7 (patch) | |
tree | 3a037e028b0926844b631404be8894dc9a4f52be /config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerCluster.java | |
parent | e4c14623ad4ecbe6337a49d2176621c528bf7c22 (diff) |
Add curator config and populate it for config servers and cluster controllers
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerCluster.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerCluster.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerCluster.java index 675ec22dc2b..a44f14e858c 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/clustercontroller/ClusterControllerCluster.java @@ -1,7 +1,8 @@ -// Copyright 2017 Yahoo Holdings. 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.admin.clustercontroller; import com.google.common.base.Joiner; +import com.yahoo.cloud.config.CuratorConfig; import com.yahoo.cloud.config.ZookeeperServerConfig; import com.yahoo.cloud.config.ZookeepersConfig; import com.yahoo.config.model.producer.AbstractConfigProducer; @@ -19,13 +20,14 @@ import java.util.Collection; * @author Ulf Lilleengen */ public class ClusterControllerCluster extends AbstractConfigProducer<ClusterControllerContainerCluster> implements + CuratorConfig.Producer, ZookeeperServerConfig.Producer, ZookeepersConfig.Producer { private static final int ZK_CLIENT_PORT = 2181; private ClusterControllerContainerCluster containerCluster = null; - public ClusterControllerCluster(AbstractConfigProducer parent, String subId) { + public ClusterControllerCluster(AbstractConfigProducer<?> parent, String subId) { super(parent, subId); } @@ -73,5 +75,15 @@ public class ClusterControllerCluster extends AbstractConfigProducer<ClusterCont } } + @Override + public void getConfig(CuratorConfig.Builder builder) { + for (ClusterControllerContainer container : containerCluster.getContainers()) { + CuratorConfig.Server.Builder serverBuilder = new CuratorConfig.Server.Builder(); + serverBuilder.hostname(container.getHostName()).port(ZK_CLIENT_PORT); + builder.server(serverBuilder); + builder.zookeeperLocalhostAffinity(false); + } + } + } |