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);
}
Aggregations