You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2019/10/09 08:31:17 UTC
[GitHub] [ignite] dgarus commented on a change in pull request #6927:
IGNITE-12212: Cluster nodes system view.
dgarus commented on a change in pull request #6927: IGNITE-12212: Cluster nodes system view.
URL: https://github.com/apache/ignite/pull/6927#discussion_r332875281
##########
File path: modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
##########
@@ -461,6 +464,63 @@ public void testClientsConnections() throws Exception {
}
}
+ /** */
+ @Test
+ public void testNodes() throws Exception {
+ try(IgniteEx g1 = startGrid(0)) {
+ SystemView<ClusterNodeView> nodes = g1.context().systemView().view(NODES_SYS_VIEW);
+
+ assertEquals(1, nodes.size());
+
+ checkNodeView(nodes.iterator().next(), g1.localNode(), true);
+
+ try(IgniteEx g2 = startGrid(1)) {
+ awaitPartitionMapExchange();
+
+ assertEquals(2, nodes.size());
+
+ boolean found = false;
+
+ for (ClusterNodeView node : nodes) {
+ if (!node.nodeId().equals(g2.localNode().id()))
+ continue;
+
+ checkNodeView(node, g2.localNode(), false);
+
+ found = true;
+
+ break;
+ }
+
+ assertTrue(found);
+
+ SystemView<ClusterNodeView> nodes2 = g2.context().systemView().view(NODES_SYS_VIEW);
+
+ assertEquals(2, nodes2.size());
+
+ for (ClusterNodeView node : nodes2) {
+ if(node.nodeId().equals(g2.localNode().id()))
+ checkNodeView(node, g2.localNode(), true);
+ else
+ checkNodeView(node, g1.localNode(), false);
+ }
+ }
+ }
+ }
+
+ /** */
+ private void checkNodeView(ClusterNodeView n, ClusterNode loc, boolean isLocal) {
Review comment:
rename:
n -> view
loc -> node
isLocal -> isLoc
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services