blob: e23475ca57e609b407b973692574c17b96f10a47 (
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
|
// 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.core;
import java.util.HashMap;
import java.util.Map;
/**
* Contains stats for a set of storage nodes. This is used to store the stats returned
* by Distributors from their getnodestate RPCs. The stats for a single storage node
* is represented by the StorageNodeStats class.
*
* @author hakonhall
*/
public class StorageNodeStatsContainer {
final private Map<Integer, StorageNodeStats> storageNodesByIndex = new HashMap<>();
public void put(int nodeIndex, StorageNodeStats nodeStats) {
storageNodesByIndex.put(nodeIndex, nodeStats);
}
public StorageNodeStats get(int nodeIndex) {
return storageNodesByIndex.get(nodeIndex);
}
public int size() { return storageNodesByIndex.size(); }
}
|