From notifications-return-7272-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Wed Oct 9 08:31:19 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8772A180670 for ; Wed, 9 Oct 2019 10:31:18 +0200 (CEST) Received: (qmail 37240 invoked by uid 500); 9 Oct 2019 08:31:17 -0000 Mailing-List: contact notifications-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list notifications@ignite.apache.org Received: (qmail 37117 invoked by uid 99); 9 Oct 2019 08:31:17 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2019 08:31:17 +0000 From: GitBox To: notifications@ignite.apache.org Subject: [GitHub] [ignite] dgarus commented on a change in pull request #6927: IGNITE-12212: Cluster nodes system view. Message-ID: <157060987759.26935.84784456807319941.gitbox@gitbox.apache.org> Date: Wed, 09 Oct 2019 08:31:17 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 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 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