ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [26/51] [abbrv] incubator-ignite git commit: ignite-53 review
Date Sat, 24 Jan 2015 11:34:03 GMT
ignite-53 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/e8de0fce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e8de0fce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e8de0fce

Branch: refs/heads/ignite-65
Commit: e8de0fce2a4cb35eb9f82ee22de18053bb3e6ae5
Parents: 1b6e8e6
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Wed Jan 21 20:30:15 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Wed Jan 21 20:30:15 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/IgniteCacheProxy.java  |  3 ---
 .../cache/query/GridCacheQueryFutureAdapter.java     | 15 ++++++++-------
 .../cache/query/GridCacheQueryManager.java           |  2 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java      |  1 -
 4 files changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e8de0fce/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 7a1dd8f..fadb7be 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -878,12 +878,9 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter
implements
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
 
         try {
-            ctx.itHolder().checkWeakQueue();
-
             GridCacheQuery<Map.Entry<K, V>> query =  delegate.queries().createScanQuery(null);
 
             query.includeBackups(false);
-            query.enableDedup(true);
             query.keepAll(false);
 
             GridCacheQueryFuture<Map.Entry<K, V>> fut = query.execute();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e8de0fce/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java
index 82a9a66..9c5c0ad 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryFutureAdapter.java
@@ -23,6 +23,7 @@ import org.gridgain.grid.*;
 import org.gridgain.grid.cache.query.*;
 import org.gridgain.grid.kernal.processors.cache.*;
 import org.gridgain.grid.kernal.processors.timeout.*;
+import org.gridgain.grid.util.*;
 import org.gridgain.grid.util.future.*;
 import org.gridgain.grid.util.typedef.*;
 import org.gridgain.grid.util.typedef.internal.*;
@@ -59,7 +60,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends
GridFutureAda
     protected final GridCacheQueryBean qry;
 
     /** Set of received keys used to deduplicate query result set. */
-    private final Collection<K> keys = new HashSet<>();
+    private Collection<K> keys;
 
     /** */
     private final Queue<Collection<R>> queue = new LinkedList<>();
@@ -122,6 +123,8 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends
GridFutureAda
 
             cctx.time().addTimeoutObject(this);
         }
+
+        keys = qry.query().enableDedup() ? new GridConcurrentHashSet<K>() : null;
     }
 
     /**
@@ -336,13 +339,11 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends
GridFutureAda
         if (!qry.query().enableDedup())
             return col;
 
-        Collection<Object> dedupCol = new LinkedList<>();
+        Collection<Object> dedupCol = new ArrayList<>(col.size());
 
-        synchronized (mux) {
-            for (Object o : col)
-                if (!(o instanceof Map.Entry) || keys.add(((Map.Entry<K, V>)o).getKey()))
-                    dedupCol.add(o);
-        }
+        for (Object o : col)
+            if (!(o instanceof Map.Entry) || keys.add(((Map.Entry<K, V>)o).getKey()))
+                dedupCol.add(o);
 
         return dedupCol;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e8de0fce/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java
index acdc6ec..b65c566 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryManager.java
@@ -757,7 +757,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
         GridIterator<IgniteBiTuple<K, V>> heapIt = new GridIteratorAdapter<IgniteBiTuple<K,
V>>() {
             private IgniteBiTuple<K, V> next;
 
-            private Iterator<K> iter = prj.keySet().iterator();
+            private Iterator<K> iter = qry.includeBackups() ? prj.keySet().iterator()
: prj.primaryKeySet().iterator();
 
             {
                 advance();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e8de0fce/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 6b4f5aa..b29fe67 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -5105,7 +5105,6 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         checkIteratorRemove(cache, entries);
 
         checkIteratorEmpty(cache);
-
     }
 
     /**


Mime
View raw message