ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: ignite-917: review
Date Mon, 15 Jun 2015 14:11:08 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-917-review [created] 6a7754335


ignite-917: review


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6a775433
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6a775433
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6a775433

Branch: refs/heads/ignite-917-review
Commit: 6a7754335fe3809353d81052d48325f604e21d3c
Parents: cb52ab3
Author: ashutak <ashutak@gridgain.com>
Authored: Mon Jun 15 17:11:52 2015 +0300
Committer: ashutak <ashutak@gridgain.com>
Committed: Mon Jun 15 17:11:52 2015 +0300

----------------------------------------------------------------------
 .../internal/cluster/ClusterGroupAdapter.java   | 27 ++++++++------------
 .../cluster/IgniteClusterAsyncImpl.java         |  2 +-
 2 files changed, 12 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a775433/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
index 1831321..f2145d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
@@ -578,7 +578,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable
{
 
     /** {@inheritDoc} */
     @Override public final ClusterGroup forHost(String host, String... hosts) {
-	return forPredicate(new HostsFilter(host, hosts));
+        return forPredicate(new HostsFilter(host, hosts));
     }
 
     /** {@inheritDoc} */
@@ -772,30 +772,25 @@ public class ClusterGroupAdapter implements ClusterGroupEx, Externalizable
{
         private static final long serialVersionUID = 0L;
 
         /** Hosts Names. */
-        private final HashSet hashInputHostNames;
+        private final Collection<String> validHostNames = new HashSet<>();
 
         /**
-         * @param name  First host name.
-	  * @param names Host names
+         * @param name First host name.
+         * @param names Host names
          */
-        private HostsFilter(String name, String[] names) {
-            hashInputHostNames = new HashSet();
-
+        private HostsFilter(String name, String... names) {
             if (name != null)
-                hashInputHostNames.add(name);
+                validHostNames.add(name);
 
-            if (names != null && (names.length > 0)) {
-                for (String currentInputHostName : names)
-                    hashInputHostNames.add(currentInputHostName);
-	    }
+            if (names != null && (names.length > 0))
+                Collections.addAll(validHostNames, names);
         }
 
         /** {@inheritDoc} */
         @Override public boolean apply(ClusterNode n) {
-	    for (String currentHostName : n.hostNames()) {
-                if (hashInputHostNames.contains(currentHostName)) {
-		    return true;
-		}
+            for (String hostName : n.hostNames()) {
+                if (validHostNames.contains(hostName))
+                    return true;
             }
 
             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a775433/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
index ca6cf32..6e68527 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
@@ -233,7 +233,7 @@ public class IgniteClusterAsyncImpl extends AsyncSupportAdapter<IgniteCluster>
 
     /** {@inheritDoc} */
     @Override public ClusterGroup forHost(String host, String... hosts) {
-	return cluster.forHost(host, hosts);
+        return cluster.forHost(host, hosts);
     }
 
     /** {@inheritDoc} */


Mime
View raw message