aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/database/ZooKeeperPaths.java
blob: 643b1e262facac1b103cba27046f37459dfaef42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright Vespa.ai. 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 myIndex;

    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 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"; }
    public String startTimestamps() { return root + "/starttimestamps"; }
}