Search in sources :

Example 16 with StorDistributionConfig

use of com.yahoo.vespa.config.content.StorDistributionConfig in project vespa by vespa-engine.

the class DistributionTestFactory method serialize.

public String serialize() throws Exception {
    JSONObject test = new JSONObject().put("cluster-state", state.toString()).put("distribution", new StorDistributionConfig(distributionConfig).toString()).put("node-type", nodeType.toString()).put("redundancy", redundancy).put("node-count", nodeCount).put("up-states", upStates);
    JSONArray results = new JSONArray();
    for (Test t : this.results) {
        JSONArray nodes = new JSONArray();
        for (int i : t.nodes) {
            nodes.put(i);
        }
        JSONArray disks = new JSONArray();
        for (int i : t.disks) {
            nodes.put(i);
        }
        JSONObject testResult = new JSONObject().put("bucket", Long.toHexString(t.bucket.getId())).put("nodes", nodes).put("failure", t.failure.toString());
        if (nodeType == NodeType.STORAGE) {
            testResult.put("disks", disks);
        }
        results.put(testResult);
    }
    test.put("result", results);
    return test.toString(2);
}
Also used : StorDistributionConfig(com.yahoo.vespa.config.content.StorDistributionConfig) JSONObject(org.codehaus.jettison.json.JSONObject) JSONArray(org.codehaus.jettison.json.JSONArray)

Aggregations

StorDistributionConfig (com.yahoo.vespa.config.content.StorDistributionConfig)16 Test (org.junit.Test)11 ContentClusterBuilder (com.yahoo.vespa.model.content.utils.ContentClusterBuilder)5 SearchDefinitionBuilder (com.yahoo.vespa.model.content.utils.SearchDefinitionBuilder)5 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)4 BucketId (com.yahoo.document.BucketId)2 ConfiguredNode (com.yahoo.vdslib.distribution.ConfiguredNode)2 Distribution (com.yahoo.vdslib.distribution.Distribution)2 ProtonConfig (com.yahoo.vespa.config.search.core.ProtonConfig)2 SlobroksConfig (com.yahoo.cloud.config.SlobroksConfig)1 ZookeepersConfig (com.yahoo.cloud.config.ZookeepersConfig)1 Metric (com.yahoo.jdisc.Metric)1 ClusterState (com.yahoo.vdslib.state.ClusterState)1 Node (com.yahoo.vdslib.state.Node)1 NodeState (com.yahoo.vdslib.state.NodeState)1 FleetcontrollerConfig (com.yahoo.vespa.config.content.FleetcontrollerConfig)1 Map (java.util.Map)1 JSONArray (org.codehaus.jettison.json.JSONArray)1 JSONObject (org.codehaus.jettison.json.JSONObject)1