ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [17/17] ignite git commit: IGNITE-3216
Date Mon, 06 Jun 2016 16:03:21 GMT
IGNITE-3216


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

Branch: refs/heads/ignite-3216
Commit: efdd7b346349e71083edcfc547d4fd5a5aef5d9b
Parents: 5254957
Author: Anton Vinogradov <av@apache.org>
Authored: Mon Jun 6 19:02:43 2016 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Mon Jun 6 19:02:43 2016 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/util/IgniteUtils.java  |  8 ++++----
 .../apache/ignite/internal/util/lang/GridFunc.java    | 14 +++++---------
 2 files changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/efdd7b34/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index c898909..012d001 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -8550,7 +8550,7 @@ public abstract class IgniteUtils {
      */
     public static Collection<InetAddress> toInetAddresses(Collection<String>
addrs,
         Collection<String> hostNames) throws IgniteCheckedException {
-        List<InetAddress> res = new ArrayList<>(addrs.size());
+        Set<InetAddress> res = new HashSet<>(addrs.size());
 
         Iterator<String> hostNamesIt = hostNames.iterator();
 
@@ -8583,7 +8583,7 @@ public abstract class IgniteUtils {
             throw new IgniteCheckedException("Addresses can not be resolved [addr=" + addrs
+
                 ", hostNames=" + hostNames + ']');
 
-        return F.viewListReadOnly(res, F.<InetAddress>identity());
+        return F.viewSetReadOnly(res, F.<InetAddress>identity());
     }
 
     /**
@@ -8609,7 +8609,7 @@ public abstract class IgniteUtils {
      */
     public static Collection<InetSocketAddress> toSocketAddresses(Collection<String>
addrs,
         Collection<String> hostNames, int port) {
-        List<InetSocketAddress> res = new ArrayList<>(addrs.size());
+        Set<InetSocketAddress> res = new HashSet<>(addrs.size());
 
         Iterator<String> hostNamesIt = hostNames.iterator();
 
@@ -8630,7 +8630,7 @@ public abstract class IgniteUtils {
             res.add(new InetSocketAddress(addr, port));
         }
 
-        return F.viewListReadOnly(res, F.<InetSocketAddress>identity());
+        return F.viewSetReadOnly(res, F.<InetSocketAddress>identity());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/efdd7b34/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index 8eeca6b..39052dd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -1695,33 +1695,29 @@ public class GridFunc {
     }
 
     /**
-     * Creates read-only light-weight view on given list with provided transformation.
+     * Creates read-only light-weight view on given set with provided transformation.
      * Resulting list will only "have" {@code transformed} elements. Note that only wrapping
      * list will be created and no duplication of data will occur.
      *
      * @param c Input list that serves as a base for the view.
      * @param trans Transformation closure.
      * @param <T1> Type of the list.
-     * @return Light-weight view on given list with provided transformation.
+     * @return Light-weight view on given set with provided transformation.
      */
     @SuppressWarnings("RedundantTypeArguments")
-    public static <T1, T2> List<T2> viewListReadOnly(@Nullable final List<?
extends T1> c,
+    public static <T1, T2> Set<T2> viewSetReadOnly(@Nullable final Set<? extends
T1> c,
         final IgniteClosure<? super T1, T2> trans) {
         A.notNull(trans, "trans");
 
         if (isEmpty(c))
-            return Collections.emptyList();
+            return Collections.emptySet();
 
         assert c != null;
 
-        return new GridSerializableList<T2>() {
+        return new GridSerializableSet<T2>() {
             /** */
             private static final long serialVersionUID = 3126625219739967068L;
 
-            @Override public T2 get(int idx) {
-                return trans.apply(c.get(idx));
-            }
-
             @NotNull
             @Override public Iterator<T2> iterator() {
                 return F.<T1, T2>iterator(c, trans, true);


Mime
View raw message