diff options
author | Geir Storli <geirst@oath.com> | 2018-02-16 13:36:49 +0100 |
---|---|---|
committer | Geir Storli <geirst@oath.com> | 2018-02-19 16:43:17 +0100 |
commit | 077656a019587ea4951a0f4ec156b8bee04e7385 (patch) | |
tree | 5bfb49ec22e8fc3db7c3c9f59bc555cc69b7dc1e /clustercontroller-core/src/main/java/com/yahoo | |
parent | 6744f7bcf76882700c6aebb25dccf17859399eb4 (diff) |
Rename NodeMergeStats -> ContentNodeStats.
Diffstat (limited to 'clustercontroller-core/src/main/java/com/yahoo')
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregator.java | 20 | ||||
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentClusterStats.java | 12 | ||||
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentNodeStats.java (renamed from clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeMergeStats.java) | 20 | ||||
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MetricUpdater.java | 2 | ||||
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java | 4 |
5 files changed, 29 insertions, 29 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregator.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregator.java index 19f9b865444..e1e626a7a71 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregator.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregator.java @@ -71,7 +71,7 @@ public class ClusterStatsAggregator { return; } - Map<String, NodeMergeStats> hostToStatsMap = getHostToStatsMap(hostnames); + Map<String, ContentNodeStats> hostToStatsMap = getHostToStatsMap(hostnames); if (hostToStatsMap == null) { return; } @@ -82,9 +82,9 @@ public class ClusterStatsAggregator { } } - private Map<String, NodeMergeStats> getHostToStatsMap(Map<Integer, String> hostnames) { - Map<String, NodeMergeStats> hostToStatsMap = new HashMap<>(aggregatedStats.size()); - for (NodeMergeStats nodeStats : aggregatedStats) { + private Map<String, ContentNodeStats> getHostToStatsMap(Map<Integer, String> hostnames) { + Map<String, ContentNodeStats> hostToStatsMap = new HashMap<>(aggregatedStats.size()); + for (ContentNodeStats nodeStats : aggregatedStats) { // The hosts names are kept up-to-date from Slobrok, and MAY therefore be arbitrarily // different from the node set used by aggregatedStats (and typically tied to a cluster state). // If so, we will not pretend the returned map is complete, and will return null. @@ -104,18 +104,18 @@ public class ClusterStatsAggregator { private void addStatsFromDistributor(int distributorIndex, ContentClusterStats clusterStats) { ContentClusterStats previousStorageStats = distributorToStats.put(distributorIndex, clusterStats); - for (NodeMergeStats storageNode : aggregatedStats) { - Integer storageNodeIndex = storageNode.getNodeIndex(); + for (ContentNodeStats contentNode : aggregatedStats) { + Integer nodeIndex = contentNode.getNodeIndex(); - NodeMergeStats statsToAdd = clusterStats.getStorageNode(storageNodeIndex); + ContentNodeStats statsToAdd = clusterStats.getStorageNode(nodeIndex); if (statsToAdd != null) { - storageNode.add(statsToAdd); + contentNode.add(statsToAdd); } if (previousStorageStats != null) { - NodeMergeStats statsToSubtract = clusterStats.getStorageNode(storageNodeIndex); + ContentNodeStats statsToSubtract = clusterStats.getStorageNode(nodeIndex); if (statsToSubtract != null) { - storageNode.subtract(statsToSubtract); + contentNode.subtract(statsToSubtract); } } } diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentClusterStats.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentClusterStats.java index 33ba51a0aba..154113b95c0 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentClusterStats.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentClusterStats.java @@ -11,28 +11,28 @@ import java.util.Set; * * @author hakonhall */ -public class ContentClusterStats implements Iterable<NodeMergeStats> { +public class ContentClusterStats implements Iterable<ContentNodeStats> { // Maps a storage node index to the storage node's pending merges stats. - private final Map<Integer, NodeMergeStats> mapToNodeStats; + private final Map<Integer, ContentNodeStats> mapToNodeStats; public ContentClusterStats(Set<Integer> storageNodes) { mapToNodeStats = new HashMap<>(storageNodes.size()); for (Integer index : storageNodes) { - mapToNodeStats.put(index, new NodeMergeStats(index)); + mapToNodeStats.put(index, new ContentNodeStats(index)); } } - public ContentClusterStats(Map<Integer, NodeMergeStats> mapToNodeStats) { + public ContentClusterStats(Map<Integer, ContentNodeStats> mapToNodeStats) { this.mapToNodeStats = mapToNodeStats; } @Override - public Iterator<NodeMergeStats> iterator() { + public Iterator<ContentNodeStats> iterator() { return mapToNodeStats.values().iterator(); } - NodeMergeStats getStorageNode(Integer index) { + ContentNodeStats getStorageNode(Integer index) { return mapToNodeStats.get(index); } diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeMergeStats.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentNodeStats.java index 97112e01aed..11e05a74cf7 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeMergeStats.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentNodeStats.java @@ -6,12 +6,12 @@ import com.yahoo.vespa.clustercontroller.core.hostinfo.StorageNode; /** * @author hakonhall */ -public class NodeMergeStats { +public class ContentNodeStats { /** * Constructor that sets values to zero if not present. */ - public NodeMergeStats(StorageNode storageNodePojo) { + public ContentNodeStats(StorageNode storageNodePojo) { this.nodeIndex = storageNodePojo.getIndex(); StorageNode.OutstandingMergeOps mergeOps = storageNodePojo.getOutstandingMergeOpsOrNull(); @@ -78,11 +78,11 @@ public class NodeMergeStats { /** * An instance with all 0 amounts. */ - public NodeMergeStats(int index) { + public ContentNodeStats(int index) { this(index, new Amount(), new Amount(), new Amount(), new Amount()); } - NodeMergeStats(int index, Amount syncing, Amount copyingIn, Amount movingOut, Amount copyingOut) { + ContentNodeStats(int index, Amount syncing, Amount copyingIn, Amount movingOut, Amount copyingOut) { this.nodeIndex = index; this.syncing = syncing; this.copyingIn = copyingIn; @@ -90,7 +90,7 @@ public class NodeMergeStats { this.copyingOut = copyingOut; } - public void set(NodeMergeStats stats) { + public void set(ContentNodeStats stats) { nodeIndex = stats.nodeIndex; syncing.set(stats.syncing); copyingIn.set(stats.copyingIn); @@ -104,18 +104,18 @@ public class NodeMergeStats { public Amount getMovingOut() { return movingOut; } public Amount getCopyingOut() { return copyingOut; } - void add(NodeMergeStats stats) { + void add(ContentNodeStats stats) { scaledAdd(1, stats); } - void subtract(NodeMergeStats stats) { + void subtract(ContentNodeStats stats) { scaledAdd(-1, stats); } /** * Logically, adds (factor * stats) to this object. factor of 1 is normal add, -1 is subtraction. */ - private void scaledAdd(int factor, NodeMergeStats stats) { + private void scaledAdd(int factor, ContentNodeStats stats) { syncing.scaledAdd(factor, stats.syncing); copyingIn.scaledAdd(factor, stats.copyingIn); movingOut.scaledAdd(factor, stats.movingOut); @@ -132,11 +132,11 @@ public class NodeMergeStats { @Override public boolean equals(Object other) { - if (!(other instanceof NodeMergeStats)) { + if (!(other instanceof ContentNodeStats)) { return false; } - NodeMergeStats otherStats = (NodeMergeStats) other; + ContentNodeStats otherStats = (ContentNodeStats) other; return nodeIndex == otherStats.nodeIndex && syncing.equals(otherStats.syncing) && copyingIn.equals(otherStats.copyingIn) && diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MetricUpdater.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MetricUpdater.java index b3b10e1d0d8..7c921be958b 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MetricUpdater.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MetricUpdater.java @@ -85,7 +85,7 @@ public class MetricUpdater { metricReporter.add("node-event", 1); } - public void updateMergeOpMetrics(Map<String, NodeMergeStats> storageNodeStats) { + public void updateMergeOpMetrics(Map<String, ContentNodeStats> contentNodeStats) { // TODO(hakonhall): Remove this method once we figure out how to propagate metrics to state HTTP API. } } diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java index eda5c41c410..1e595839fa2 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java @@ -43,9 +43,9 @@ public class StorageNodeStatsBridge { } public static ContentClusterStats generate(Distributor distributor) { - Map<Integer, NodeMergeStats> mapToNodeStats = new HashMap<>(); + Map<Integer, ContentNodeStats> mapToNodeStats = new HashMap<>(); for (StorageNode storageNode : distributor.getStorageNodes()) { - mapToNodeStats.put(storageNode.getIndex(), new NodeMergeStats(storageNode)); + mapToNodeStats.put(storageNode.getIndex(), new ContentNodeStats(storageNode)); } return new ContentClusterStats(mapToNodeStats); } |