Return-Path: X-Original-To: apmail-ignite-issues-archive@minotaur.apache.org Delivered-To: apmail-ignite-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4928710923 for ; Fri, 5 Jun 2015 11:14:11 +0000 (UTC) Received: (qmail 99570 invoked by uid 500); 5 Jun 2015 11:14:05 -0000 Delivered-To: apmail-ignite-issues-archive@ignite.apache.org Received: (qmail 99543 invoked by uid 500); 5 Jun 2015 11:14:05 -0000 Mailing-List: contact issues-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list issues@ignite.incubator.apache.org Received: (qmail 99534 invoked by uid 99); 5 Jun 2015 11:14:04 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Jun 2015 11:14:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 826F61A460D for ; Fri, 5 Jun 2015 11:14:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.77 X-Spam-Level: * X-Spam-Status: No, score=1.77 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id mhsO8qsfTFhU for ; Fri, 5 Jun 2015 11:14:02 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id D65AE20C4B for ; Fri, 5 Jun 2015 11:14:01 +0000 (UTC) Received: (qmail 99090 invoked by uid 99); 5 Jun 2015 11:14:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Jun 2015 11:14:00 +0000 Date: Fri, 5 Jun 2015 11:14:00 +0000 (UTC) From: "Artem Shutak (JIRA)" To: issues@ignite.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (IGNITE-917) Add org.apache.ignite.cluster.ClusterGroup.forHost(String host, String... hosts) overload MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14574327#comment-14574327 ] Artem Shutak edited comment on IGNITE-917 at 6/5/15 11:13 AM: -------------------------------------------------------------- Hi Atri, 1. I can understand, why you have problems with indention (change tabulation indention with 4 spaces is not so easy). Can you, please, at lease remove redundant empty line. Like here (see another places too) {code} private static class HostsFilter implements IgnitePredicate { /** */ private static final long serialVersionUID = 0L; {code} and here {code} private HostsFilter(String name, String[] names) { this.inputHostNames = new ArrayList (Arrays.asList(names)); {code} About bracing see https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines#CodingGuidelines-BracketsandIdentation. It's a wrong javadoc (1 @param instead of 2) {code} /** * @param names Names. */ private HostsFilter(String name, String[] names) { {code} {code} CurrentHostName{code} - bad variable naming. Please, be really careful with Coding Guidelines. I think we will not be able to finish review before there are issues here. 2. Small points - Redundant "this" here {code}this.inputHostNames{code} - Here {code}new ArrayList{code} "String" is redundant and can be removed (Ignite supports only java 7 and higher). 3. Why do you wrap all objects in ArrayList? For example, {code}Arrays.asList(names){code} already returns ArrayList. Are you really need to have n.hostNames() as List? I think no. Actually, only this place is really important: {code}inputHostNames.contains(CurrentHostName){code} Implementation of ArrayList.contains() is not too fast. I suggest to use HashSet here. 4. It was my mistake, but I forget to point you about new test for new public method. I think you should add it at GridProjectionSelfTest. was (Author: ashutak): Hi Atri, 1. I can understand, why you have problems with indention (change tabulation indention with 4 spaces is not so easy). Can you, please, at lease remove redundant empty line. Like here (see another places too) {code} private static class HostsFilter implements IgnitePredicate { /** */ private static final long serialVersionUID = 0L; {code} and here {code} private HostsFilter(String name, String[] names) { this.inputHostNames = new ArrayList (Arrays.asList(names)); {code} About bracing see https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines#CodingGuidelines-BracketsandIdentation. It's a wrong javadoc (1 @param instead of 2) {code} /** * @param names Names. */ private HostsFilter(String name, String[] names) { {code} {code} CurrentHostName - bad variable naming. Please, be really careful with Coding Guidelines. I think we will not be able to finish review before there are issues here. 2. Small points - Redundant "this" here {code}this.inputHostNames{code} - Here {code}new ArrayList{code} "String" is redundant and can be removed (Ignite supports only java 7 and higher). 3. Why do you wrap all objects in ArrayList? For example, {code}Arrays.asList(names){code} already returns ArrayList. Are you really need to have n.hostNames() as List? I think no. Actually, only this place is really important: {code}inputHostNames.contains(CurrentHostName){code} Implementation of ArrayList.contains() is not too fast. I suggest to use HashSet here. 4. It was my mistake, but I forget to point you about new test for new public method. I think you should add it at GridProjectionSelfTest. > Add org.apache.ignite.cluster.ClusterGroup.forHost(String host, String... hosts) overload > ----------------------------------------------------------------------------------------- > > Key: IGNITE-917 > URL: https://issues.apache.org/jira/browse/IGNITE-917 > Project: Ignite > Issue Type: Task > Components: newbie > Reporter: Yakov Zhdanov > Assignee: Yakov Zhdanov > Attachments: ignite-sprint-5_ignite-917ver2.patch > > > Method should build a cluster group from all nodes running on the hosts specified. > This should be dynamic group. I think method implementation should build up a predicate to check that passed in node's host names contain one of the host names from parameters. > See IgnitePredicate, ClusterGroup, ClusterNode, ClusterNode#hostNames -- This message was sent by Atlassian JIRA (v6.3.4#6332)