summaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/test/java/com
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-02-16 13:25:07 +0100
committerGeir Storli <geirst@oath.com>2018-02-19 16:43:17 +0100
commit6744f7bcf76882700c6aebb25dccf17859399eb4 (patch)
tree4fe497eefcfe7add362c1b46bcb6425eb5ae411d /clustercontroller-core/src/test/java/com
parentc2f334c0ad1e15035465f87b90c94f5dbdf295f2 (diff)
Rename StorageMergeStats -> ContentClusterStats.
Diffstat (limited to 'clustercontroller-core/src/test/java/com')
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateViewTest.java1
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregatorTest.java26
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridgeTest.java4
3 files changed, 15 insertions, 16 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateViewTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateViewTest.java
index 3b04fec3e79..6487a55b554 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateViewTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateViewTest.java
@@ -22,7 +22,6 @@ public class ClusterStateViewTest {
final NodeInfo nodeInfo = mock(NodeInfo.class);
final Node node = mock(Node.class);
final ClusterStatsAggregator statsAggregator = mock(ClusterStatsAggregator.class);
- final StorageMergeStats storageStats = mock(StorageMergeStats.class);
final ClusterState clusterState = mock(ClusterState.class);
final MetricUpdater metricUpdater = mock(MetricUpdater.class);
final ClusterStateView clusterStateView = new ClusterStateView(clusterState, statsAggregator, metricUpdater);
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregatorTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregatorTest.java
index eb4455b9492..9b8ac3c389d 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregatorTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregatorTest.java
@@ -24,7 +24,7 @@ public class ClusterStatsAggregatorTest {
final Set<Integer> storageNodes = new HashSet<>();
final Map<Integer, String> hostnames = new HashMap<>();
final MetricUpdater updater = mock(MetricUpdater.class);
- StorageMergeStats storageStats;
+ ContentClusterStats clusterStats;
private void addDistributors(Integer... indices) {
for (Integer i : indices) {
@@ -46,11 +46,11 @@ public class ClusterStatsAggregatorTest {
storageNodes.add(spec.index);
hostnames.put(spec.index, spec.hostname);
}
- storageStats = new StorageMergeStats(storageNodes);
+ clusterStats = new ContentClusterStats(storageNodes);
}
private void putStorageStats(int index, int syncing, int copyingIn, int movingOut, int copyingOut) {
- storageStats.getStorageNode(index).set(createStats(index, syncing, copyingIn, movingOut, copyingOut));
+ clusterStats.getStorageNode(index).set(createStats(index, syncing, copyingIn, movingOut, copyingOut));
}
private static NodeMergeStats createStats(int index, int syncing, int copyingIn, int movingOut, int copyingOut) {
@@ -73,7 +73,7 @@ public class ClusterStatsAggregatorTest {
putStorageStats(storageNodeIndex, 5, 6, 7, 8);
ClusterStatsAggregator aggregator = new ClusterStatsAggregator(distributors, storageNodes, updater);
- aggregator.updateForDistributor(hostnames, distributorIndex, storageStats);
+ aggregator.updateForDistributor(hostnames, distributorIndex, clusterStats);
Map<String, NodeMergeStats> expectedStorageNodeStats = new HashMap<>();
expectedStorageNodeStats.put("storage-node", createStats(storageNodeIndex, 5, 6, 7, 8));
@@ -98,12 +98,12 @@ public class ClusterStatsAggregatorTest {
// Distributor 1.
putStorageStats(storageNode1, 0, 1, 2, 3);
putStorageStats(storageNode2, 20, 21, 22, 23);
- aggregator.updateForDistributor(hostnames, distributor1, storageStats);
+ aggregator.updateForDistributor(hostnames, distributor1, clusterStats);
// Distributor 2.
putStorageStats(storageNode1, 10, 11, 12, 13);
putStorageStats(storageNode2, 30, 31, 32, 33);
- aggregator.updateForDistributor(hostnames, distributor2, storageStats);
+ aggregator.updateForDistributor(hostnames, distributor2, clusterStats);
Map<String, NodeMergeStats> expectedStorageNodeStats = new HashMap<>();
expectedStorageNodeStats.put("storage-node-1", createStats(storageNode1, 0 + 10, 1 + 11, 2 + 12, 3 + 13));
@@ -129,16 +129,16 @@ public class ClusterStatsAggregatorTest {
// Distributor 1.
putStorageStats(storageNode1, 0, 1, 2, 3);
putStorageStats(storageNode2, 20, 21, 22, 23);
- aggregator.updateForDistributor(hostnames, distributor1, storageStats);
+ aggregator.updateForDistributor(hostnames, distributor1, clusterStats);
// Distributor 2.
putStorageStats(storageNode1, 10, 11, 12, 13);
putStorageStats(storageNode2, 30, 31, 32, 33);
- aggregator.updateForDistributor(hostnames, distributor2, storageStats);
+ aggregator.updateForDistributor(hostnames, distributor2, clusterStats);
// If we add call another updateForDistributor with the same arguments, updateMergeOpMetrics() should not be called.
// See times(1) below.
- aggregator.updateForDistributor(hostnames, distributor2, storageStats);
+ aggregator.updateForDistributor(hostnames, distributor2, clusterStats);
Map<String, NodeMergeStats> expectedStorageNodeStats = new HashMap<>();
expectedStorageNodeStats.put("storage-node-1", createStats(storageNode1, 0 + 10, 1 + 11, 2 + 12, 3 + 13));
@@ -160,7 +160,7 @@ public class ClusterStatsAggregatorTest {
putStorageStats(storageNodeIndex, 5, 6, 7, 8);
ClusterStatsAggregator aggregator = new ClusterStatsAggregator(distributors, storageNodes, updater);
- aggregator.updateForDistributor(hostnames, DownDistributorIndex, storageStats);
+ aggregator.updateForDistributor(hostnames, DownDistributorIndex, clusterStats);
verify(updater, never()).updateMergeOpMetrics(any());
}
@@ -181,7 +181,7 @@ public class ClusterStatsAggregatorTest {
// Distributor 1.
putStorageStats(storageNode1, 0, 1, 2, 3);
putStorageStats(storageNode2, 20, 21, 22, 23);
- aggregator.updateForDistributor(hostnames, distributor1, storageStats);
+ aggregator.updateForDistributor(hostnames, distributor1, clusterStats);
Map<String, NodeMergeStats> expectedStorageNodeStats = new HashMap<>();
expectedStorageNodeStats.put("storage-node-1", createStats(storageNode1, 0, 1, 2, 3));
@@ -203,11 +203,11 @@ public class ClusterStatsAggregatorTest {
// Distributor 1.
putStorageStats(storageNode1, 0, 1, 2, 3);
- aggregator.updateForDistributor(hostnames, distributor1, storageStats);
+ aggregator.updateForDistributor(hostnames, distributor1, clusterStats);
// Distributor 2.
putStorageStats(storageNode1, 10, 11, 12, 13);
- aggregator.updateForDistributor(hostnames, distributor2, storageStats);
+ aggregator.updateForDistributor(hostnames, distributor2, clusterStats);
Map<String, NodeMergeStats> expectedStorageNodeStats = new HashMap<>();
expectedStorageNodeStats.put("storage-node-1", createStats(storageNode1, 0 + 10, 1 + 11, 2 + 12, 3 + 13));
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridgeTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridgeTest.java
index 8a17fedee86..e335026a764 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridgeTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridgeTest.java
@@ -2,7 +2,7 @@
package com.yahoo.vespa.clustercontroller.core.hostinfo;
import com.yahoo.vespa.clustercontroller.core.NodeMergeStats;
-import com.yahoo.vespa.clustercontroller.core.StorageMergeStats;
+import com.yahoo.vespa.clustercontroller.core.ContentClusterStats;
import com.yahoo.vespa.clustercontroller.core.StorageNodeStats;
import com.yahoo.vespa.clustercontroller.core.StorageNodeStatsContainer;
import org.junit.Test;
@@ -53,7 +53,7 @@ public class StorageNodeStatsBridgeTest {
String data = getJsonString();
HostInfo hostInfo = HostInfo.createHostInfo(data);
- StorageMergeStats storageMergeStats = StorageNodeStatsBridge.generate(hostInfo.getDistributor());
+ ContentClusterStats storageMergeStats = StorageNodeStatsBridge.generate(hostInfo.getDistributor());
int size = 0;
for (NodeMergeStats mergeStats : storageMergeStats) {
assertThat(mergeStats.getCopyingIn().getBuckets(), is(2L));