blob: 97da679d2e87a9401fc7159a91093a02d540d084 (
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
27
28
29
30
31
32
33
34
35
36
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.utils.staterestapi;
import java.util.LinkedHashMap;
import java.util.Map;
public class DummyBackend {
public static class Cluster {
public String id;
public Map<String, Node> nodes = new LinkedHashMap<>();
public Cluster(String id) { this.id = id; }
public Cluster addNode(Node n) { nodes.put(n.id, n); n.clusterId = id; return this; }
}
public static class Node {
public String clusterId;
public String id;
public int docCount = 0;
public String state = "up";
public String reason = "";
public String group = "mygroup";
public Node(String id) { this.id = id; }
public Node setDocCount(int count) { docCount = count; return this; }
public Node setState(String state) { this.state = state; return this; }
}
private Map<String, Cluster> clusters = new LinkedHashMap<>();
public Map<String, Cluster> getClusters() { return clusters; }
public DummyBackend addCluster(Cluster c) {
clusters.put(c.id, c);
return this;
}
}
|