[ 
https://issues.apache.org/jira/browse/IGNITE-917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14573185#comment-14573185
 ] 

Artem Shutak commented on IGNITE-917:
-------------------------------------

Atri, 

1. Code style.
We are really careful with our code formatting, so double check that you have 
good code formatting.
For example, instead of 
{code}
        /** {@inheritDoc} */
    @Override public final ClusterGroup forHost(String... hosts) {
{code}

should be

{code}
    /** {@inheritDoc} */
    @Override public final ClusterGroup forHost(String... hosts) {
{code}

We use spaces for indention, not tabulation. See around {code}return 
forPredicate(new HostsFilter(hosts));{code}

It has extra space {code}List<String> inputHostNames =  new ArrayList<String> 
(Arrays.asList(names));{code}

And etc.

2. Look at the JIRA title: "...forHost(String host, String... hosts) ...". You 
have forHost(String... hosts). It have to be fixed.

3. HostsFilter#apply has really bad performance. 
You create to many objects. Some objects can be created in constructor. Also, 
actually you don't need to do retainAll, you need to know about there is or not 
only one element in intersection of sets.


> 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-917.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)

Reply via email to