aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateMapping.java
blob: 7ef1fce4f605817888cac52b73309950dc90b0cc (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
// 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;

import com.yahoo.vdslib.state.ClusterState;

/**
 * Tuple representing a mapping from a named bucket space to the derived ClusterState
 * for that space.
 */
public class StateMapping {

    final String bucketSpace;
    final ClusterState state;

    private StateMapping(String bucketSpace, ClusterState state) {
        this.bucketSpace = bucketSpace;
        this.state = state;
    }

    public static StateMapping of(String bucketSpace, String state) {
        return new StateMapping(bucketSpace, ClusterState.stateFromString(state));
    }

}