summaryrefslogtreecommitdiffstats
path: root/vdslib/src/test
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2021-03-11 17:41:14 +0100
committerTor Brede Vekterli <vekterli@verizonmedia.com>2021-03-12 14:40:35 +0100
commit0a78220415f590da91e4710d38c52c42a0f7572c (patch)
treec9e1a0aa1806c3fb62d2cbbf14a2a9fdcfec1056 /vdslib/src/test
parentcdf52990f001826004b52b39acf99647c7f7b0f7 (diff)
Don't store full bundle objects in cluster state history
Bundles have a lot of sub-objects per state, so in systems with a high amount of node entries, this adds unnecessary pressure on the heap. Instead, store the string representations of the bundle and the string representation of the diff to the previous state version (if any). This is also inherently faster than computing the diffs on-demand on every status page render. Also remove mutable `official` field from `ClusterState`. Not worth violating immutability of an object just to get some prettier (but with high likelihood actually more confusing) status page rendering.
Diffstat (limited to 'vdslib/src/test')
-rw-r--r--vdslib/src/test/java/com/yahoo/vdslib/state/ClusterStateTestCase.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/vdslib/src/test/java/com/yahoo/vdslib/state/ClusterStateTestCase.java b/vdslib/src/test/java/com/yahoo/vdslib/state/ClusterStateTestCase.java
index 258a79f5362..dbc8888cfda 100644
--- a/vdslib/src/test/java/com/yahoo/vdslib/state/ClusterStateTestCase.java
+++ b/vdslib/src/test/java/com/yahoo/vdslib/state/ClusterStateTestCase.java
@@ -188,9 +188,8 @@ public class ClusterStateTestCase{
state2.setDistributionBits(21);
state1.setVersion(123);
state1.setNodeState(new Node(NodeType.STORAGE, 2), new NodeState(NodeType.STORAGE, State.INITIALIZING).setInitProgress(0.2f).setDescription("Booting"));
- state2.setOfficial(true);
- assertEquals("version: 123 => 0, bits: 16 => 21, official: false => true, storage: [2: [Initializing => Up, description: Booting => ], 4: Down => Up, 5: Down => Up], distributor: [7: Up => Down, 8: Up => Down]", state1.getTextualDifference(state2));
+ assertEquals("version: 123 => 0, bits: 16 => 21, storage: [2: [Initializing => Up, description: Booting => ], 4: Down => Up, 5: Down => Up], distributor: [7: Up => Down, 8: Up => Down]", state1.getTextualDifference(state2));
}
@Test
@@ -221,9 +220,8 @@ public class ClusterStateTestCase{
state1.setVersion(123);
state1.setNodeState(new Node(NodeType.STORAGE, 2), new NodeState(NodeType.STORAGE, State.INITIALIZING).setInitProgress(0.2f).setDescription("Booting"));
state2.setDistributionBits(21);
- state2.setOfficial(true);
- assertEquals("version: 123 => 0, bits: 16 => 21, official: false => true, storage: [2: [Initializing => Up, description: Booting => ], 4: Down => Up, 5: Down => Up], distributor: [7: Up => Down, 8: Up => Down]", state1.getTextualDifference(state2));
- assertEquals("version: 123 =&gt; 0, bits: 16 =&gt; 21, official: false =&gt; true, storage: [<br>\n" +
+ assertEquals("version: 123 => 0, bits: 16 => 21, storage: [2: [Initializing => Up, description: Booting => ], 4: Down => Up, 5: Down => Up], distributor: [7: Up => Down, 8: Up => Down]", state1.getTextualDifference(state2));
+ assertEquals("version: 123 =&gt; 0, bits: 16 =&gt; 21, storage: [<br>\n" +
"&nbsp;2: [<b>Initializing</b> =&gt; <b>Up</b>, description: Booting =&gt; ], <br>\n" +
"&nbsp;4: <b>Down</b> =&gt; <b>Up</b>, <br>\n" +
"&nbsp;5: <b>Down</b> =&gt; <b>Up</b><br>\n" +