summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/Container.java11
-rw-r--r--configdefinitions/src/vespa/cluster-member-info.def9
2 files changed, 18 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java b/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java
index fd3fe4e3740..f9ab17b359e 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/Container.java
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. 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.ClusterMemberInfoConfig;
import com.yahoo.component.ComponentId;
import com.yahoo.component.ComponentSpecification;
import com.yahoo.config.model.producer.AbstractConfigProducer;
@@ -48,7 +49,8 @@ public class Container extends AbstractService implements
ComponentsConfig.Producer,
JdiscBindingsConfig.Producer,
ContainerHttpConfig.Producer,
- ContainerMbusConfig.Producer {
+ ContainerMbusConfig.Producer,
+ ClusterMemberInfoConfig.Producer {
public static final int BASEPORT = Defaults.getDefaults().vespaWebServicePort();
public static final String SINGLENODE_CONTAINER_SERVICESPEC = "default_singlenode_container";
@@ -65,7 +67,7 @@ public class Container extends AbstractService implements
/** Whether this node has been marked as retired (e.g, will be removed) */
private final boolean retired;
- /** The index of this node. Non-critical: This is persisted on hosted, just a counter otherwise. */
+ /** The unique index of this node */
private final int index;
private final ComponentGroup<Handler<?>> handlers = new ComponentGroup<>(this, "handler");
@@ -378,6 +380,11 @@ public class Container extends AbstractService implements
}
@Override
+ public void getConfig(ClusterMemberInfoConfig.Builder builder) {
+ builder.index(index);
+ }
+
+ @Override
public HashMap<String,String> getDefaultMetricDimensions(){
HashMap<String, String> dimensions = new HashMap<>();
if (clusterName != null)
diff --git a/configdefinitions/src/vespa/cluster-member-info.def b/configdefinitions/src/vespa/cluster-member-info.def
new file mode 100644
index 00000000000..15781772ee5
--- /dev/null
+++ b/configdefinitions/src/vespa/cluster-member-info.def
@@ -0,0 +1,9 @@
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+# Information about a given node's (the node receiving the config) membership in a cluster. See also cluster-info
+namespace=cloud.config
+
+# The unique index of this node in the cluster.
+# Node indexes are not necessarily continuous and starting at zero.
+index int
+
+