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-286: wip.
Date Wed, 29 Apr 2015 11:54:00 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-286 cf6ef6c76 -> 0331221b7


#ignite-286: wip.


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

Branch: refs/heads/ignite-286
Commit: 0331221b7abf8a4f58c9b03034c851d9d44afe1c
Parents: cf6ef6c
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Apr 29 14:53:52 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Apr 29 14:53:52 2015 +0300

----------------------------------------------------------------------
 .../cache/query/GridCacheQueryManager.java      | 63 +++++++++++++++++++-
 .../ignite/internal/util/IgniteUtils.java       | 52 ----------------
 2 files changed, 62 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0331221b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index fe6b29a..90fd85e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -882,7 +882,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
             if (cctx.swap().swapEnabled())
                 iters.add(swapIterator(qry, backups));
 
-            it = U.compoudIterator(iters);
+            it = new CompoundIterator<>(iters);
         }
         else
             it = heapIt;
@@ -2513,6 +2513,67 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
     /**
      *
      */
+    private static class CompoundIterator<T> extends GridIteratorAdapter<T> {
+        /** */
+        private static final long serialVersionUID = 4585888051556166304L;
+
+        /** */
+        private final List<GridIterator<T>> iters;
+
+        /** */
+        private int idx;
+
+        /** */
+        private GridIterator<T> iter;
+
+        /**
+         * @param iters Iterators.
+         */
+        private CompoundIterator(List<GridIterator<T>> iters) {
+            if (iters.isEmpty())
+                throw new IllegalArgumentException();
+
+            this.iters = iters;
+
+            iter = F.first(iters);
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean hasNextX() throws IgniteCheckedException {
+            if (iter.hasNextX())
+                return true;
+
+            idx++;
+
+            while(idx < iters.size()) {
+                iter = iters.get(idx);
+
+                if (iter.hasNextX())
+                    return true;
+
+                idx++;
+            }
+
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override public T nextX() throws IgniteCheckedException {
+            if (!hasNextX())
+                throw new NoSuchElementException();
+
+            return iter.nextX();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void removeX() throws IgniteCheckedException {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    /**
+     *
+     */
     private class GridCacheScanSwapEntry implements Cache.Entry<K, V> {
         /** */
         private final AbstractLazySwapEntry e;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0331221b/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 c9e2298..cb56650 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
@@ -9017,56 +9017,4 @@ public abstract class IgniteUtils {
 
         return hasShmem;
     }
-
-    public static <T> GridCloseableIteratorAdapter<T> compoudIterator(final List<GridIterator<T>>
allIters) {
-        return  new GridCloseableIteratorAdapter<T> () {
-            /** */
-            private static final long serialVersionUID = 0L;
-
-            /** */
-            private final List<GridIterator<T>> iters;
-
-            /** */
-            private int idx;
-
-            /** */
-            private GridIterator<T> iter;
-
-            {
-                if (allIters.isEmpty())
-                    throw new IllegalArgumentException();
-
-                iters = allIters;
-
-                iter = F.first(allIters);
-            }
-
-            /** {@inheritDoc} */
-            @Override public boolean onHasNext() throws IgniteCheckedException {
-                if (iter.hasNextX())
-                    return true;
-
-                idx++;
-
-                while(idx < iters.size()) {
-                    iter = iters.get(idx);
-
-                    if (iter.hasNextX())
-                        return true;
-
-                    idx++;
-                }
-
-                return false;
-            }
-
-            /** {@inheritDoc} */
-            @Override public T onNext() throws IgniteCheckedException {
-                if (!hasNextX())
-                    throw new NoSuchElementException();
-
-                return iter.nextX();
-            }
-        };
-    }
 }


Mime
View raw message