diff options
Diffstat (limited to 'clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/database/ZooKeeperPaths.java')
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/database/ZooKeeperPaths.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/database/ZooKeeperPaths.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/database/ZooKeeperPaths.java index b3b6718a7bc..06a9b240175 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/database/ZooKeeperPaths.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/database/ZooKeeperPaths.java @@ -1,22 +1,24 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.clustercontroller.core.database; +import com.yahoo.vespa.clustercontroller.core.FleetControllerId; + /** * @author hakonhall */ public class ZooKeeperPaths { private final String root; - private final int nodeIndex; + private final int myIndex; - public ZooKeeperPaths(String clusterName, int nodeIndex) { - this.root = "/vespa/fleetcontroller/" + clusterName; - this.nodeIndex = nodeIndex; + public ZooKeeperPaths(FleetControllerId id) { + this.root = "/vespa/fleetcontroller/" + id.clusterName(); + this.myIndex = id.index(); } public String root() { return root; } public String indexesRoot() { return root + "/indexes"; } - public String indexesOf(int index) { return indexesRoot() + "/" + index; } - public String indexesOfMe() { return indexesOf(nodeIndex); } + public String indexOf(int index) { return indexesRoot() + "/" + index; } + public String indexOfMe() { return indexOf(myIndex); } public String wantedStates() { return root + "/wantedstates"; } public String publishedStateBundle() { return root + "/published_state_bundle"; } public String latestVersion() { return root + "/latestversion"; } |