You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/02/14 13:11:21 UTC
[02/34] ignite git commit: IGNITE-613: particular solved problem,
check all node for result
IGNITE-613: particular solved problem, check all node for result
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bb899bdb
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bb899bdb
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bb899bdb
Branch: refs/heads/ignite-3727-2
Commit: bb899bdbb253ac51c2ee3cc89e51ec4ab6e88157
Parents: 4e6605f
Author: DmitriyGovorukhin <dg...@gridgain.com>
Authored: Wed Aug 31 16:43:34 2016 +0300
Committer: DmitriyGovorukhin <dg...@gridgain.com>
Committed: Wed Aug 31 16:43:34 2016 +0300
----------------------------------------------------------------------
.../IgniteCacheReplicatedQuerySelfTest.java | 25 ++++++++++++--------
1 file changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/bb899bdb/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java
index e462cce..85a70f3 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheReplicatedQuerySelfTest.java
@@ -30,9 +30,8 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch;
import javax.cache.Cache;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteException;
+
+import org.apache.ignite.*;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.cache.query.SqlQuery;
@@ -285,7 +284,7 @@ public class IgniteCacheReplicatedQuerySelfTest extends IgniteCacheAbstractQuery
*/
private ConcurrentMap<UUID,
Map<Long, GridFutureAdapter<GridCloseableIterator<IgniteBiTuple<CacheKey, CacheValue>>>>>
- distributedQueryManagerQueryItersMap(Ignite g) {
+ distributedQueryManagerQueryItersMap(Ignite g) {
GridCacheContext ctx = ((IgniteKernal)g).internalCache().context();
Field qryItersField = ReflectionUtils.findField(ctx.queries().getClass(), "qryIters");
@@ -355,8 +354,6 @@ public class IgniteCacheReplicatedQuerySelfTest extends IgniteCacheAbstractQuery
* @throws Exception If failed.
*/
public void testNodeLeft() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-613");
-
Ignite g = startGrid("client");
try {
@@ -375,10 +372,12 @@ public class IgniteCacheReplicatedQuerySelfTest extends IgniteCacheAbstractQuery
assertEquals(0, (int)q.iterator().next().getKey());
- ConcurrentMap<UUID, ConcurrentMap<Long, ?>> map = U.field(((IgniteH2Indexing)U.field(U.field(
- grid(0).context(), "qryProc"), "idx")).mapQueryExecutor(), "qryRess");
+ //need to check all node, where was query execution
+ ConcurrentMap<UUID, ConcurrentMap<Long, ?>> mapNode1 = qryResultMap(0);
+ ConcurrentMap<UUID, ConcurrentMap<Long, ?>> mapNode2 = qryResultMap(1);
+ ConcurrentMap<UUID, ConcurrentMap<Long, ?>> mapNode3 = qryResultMap(2);
- assertEquals(1, map.size());
+ assertEquals(1, mapNode1.size() + mapNode2.size() + mapNode3.size());
final UUID nodeId = g.cluster().localNode().id();
@@ -397,13 +396,19 @@ public class IgniteCacheReplicatedQuerySelfTest extends IgniteCacheAbstractQuery
latch.await();
- assertEquals(0, map.size());
+ assertEquals(0, mapNode1.size());
+ assertEquals(0, mapNode2.size());
+ assertEquals(0, mapNode3.size());
}
finally {
stopGrid("client");
}
}
+ private ConcurrentMap<UUID, ConcurrentMap<Long, ?>> qryResultMap(int node) {
+ return U.field(((IgniteH2Indexing)U.field((Object)U.field(grid(node).context(), "qryProc"), "idx")).mapQueryExecutor(), "qryRess");
+ }
+
/**
* @param cache Cache.
* @throws Exception If check failed.