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 2015/07/20 12:18:08 UTC

[01/11] incubator-ignite git commit: # master fix tests

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-752 d9ddfb402 -> 05f69a6a6


# master fix tests


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

Branch: refs/heads/ignite-752
Commit: 192fefc2382d479a62504517cf3ddc8d5188657c
Parents: f557728
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jul 20 10:09:24 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jul 20 10:09:24 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheUtils.java        |  4 +-
 .../ignite/internal/util/IgniteUtils.java       |  4 +-
 .../IgniteClientReconnectFailoverTest.java      | 47 ++++++++++++--------
 .../cache/IgniteCacheNearLockValueSelfTest.java |  2 +
 4 files changed, 32 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index bd2623d..e16e30d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1561,9 +1561,7 @@ public class GridCacheUtils {
      */
     @NotNull public static RuntimeException convertToCacheException(IgniteCheckedException e) {
         IgniteClientDisconnectedCheckedException disconnectedErr =
-            e instanceof IgniteClientDisconnectedCheckedException ?
-            (IgniteClientDisconnectedCheckedException)e
-            : e.getCause(IgniteClientDisconnectedCheckedException.class);
+            e.getCause(IgniteClientDisconnectedCheckedException.class);
 
         if (disconnectedErr != null) {
             assert disconnectedErr.reconnectFuture() != null : disconnectedErr;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/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 66eb596..42982b9 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
@@ -691,9 +691,7 @@ public abstract class IgniteUtils {
         }
 
         IgniteClientDisconnectedCheckedException disconnectedErr =
-            e instanceof IgniteClientDisconnectedCheckedException ?
-            (IgniteClientDisconnectedCheckedException)e
-            : e.getCause(IgniteClientDisconnectedCheckedException.class);
+            e.getCause(IgniteClientDisconnectedCheckedException.class);
 
         if (disconnectedErr != null) {
             assert disconnectedErr.reconnectFuture() != null : disconnectedErr;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
index 7cfc329..b7de3eb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.transactions.*;
 
+import javax.cache.*;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -114,37 +115,45 @@ public class IgniteClientReconnectFailoverTest extends IgniteClientReconnectFail
 
         reconnectFailover(new Callable<Void>() {
             @Override public Void call() throws Exception {
-                TreeMap<Integer, Integer> map = new TreeMap<>();
+                try {
+                    TreeMap<Integer, Integer> map = new TreeMap<>();
 
-                ThreadLocalRandom rnd = ThreadLocalRandom.current();
+                    ThreadLocalRandom rnd = ThreadLocalRandom.current();
 
-                for (int i = 0; i < 5; i++) {
-                    Integer key = rnd.nextInt(0, 100_000);
+                    for (int i = 0; i < 5; i++) {
+                        Integer key = rnd.nextInt(0, 100_000);
 
-                    cache.put(key, key);
+                        cache.put(key, key);
 
-                    assertEquals(key, cache.get(key));
+                        assertEquals(key, cache.get(key));
 
-                    map.put(key, key);
-                }
+                        map.put(key, key);
+                    }
 
-                for (TransactionConcurrency txConcurrency : TransactionConcurrency.values()) {
-                    try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) {
-                        for (Map.Entry<Integer, Integer> e : map.entrySet()) {
-                            cache.put(e.getKey(), e.getValue());
+                    for (TransactionConcurrency txConcurrency : TransactionConcurrency.values()) {
+                        try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) {
+                            for (Map.Entry<Integer, Integer> e : map.entrySet()) {
+                                cache.put(e.getKey(), e.getValue());
 
-                            assertNotNull(cache.get(e.getKey()));
-                        }
+                                assertNotNull(cache.get(e.getKey()));
+                            }
 
-                        tx.commit();
+                            tx.commit();
+                        }
                     }
-                }
 
-                cache.putAll(map);
+                    cache.putAll(map);
 
-                Map<Integer, Integer> res = cache.getAll(map.keySet());
+                    Map<Integer, Integer> res = cache.getAll(map.keySet());
 
-                assertEquals(map, res);
+                    assertEquals(map, res);
+                }
+                catch (CacheException e) {
+                    if (e.getCause() instanceof IgniteClientDisconnectedException)
+                        throw e;
+                    else
+                        log.info("Ignore error: " + e);
+                }
 
                 return null;
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/192fefc2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
index cd04433..c500bbf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
@@ -49,6 +49,8 @@ public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest {
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         super.afterTestsStopped();
+
+        stopAllGrids();
     }
 
     /** {@inheritDoc} */


[08/11] incubator-ignite git commit: # master minor

Posted by sb...@apache.org.
# master minor


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

Branch: refs/heads/ignite-752
Commit: 7494a86b9ce166e547e7e5cad14f7202ab597b97
Parents: d8f86f1
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jul 20 12:31:01 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jul 20 12:36:02 2015 +0300

----------------------------------------------------------------------
 .../cache/distributed/dht/GridDhtTxPrepareFuture.java       | 9 ++++-----
 .../near/GridCachePartitionedMultiNodeFullApiSelfTest.java  | 4 +++-
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7494a86b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index af0fbdf..6efa4d8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -256,7 +256,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                 MiniFuture f = (MiniFuture)fut;
 
                 if (f.node().id().equals(nodeId)) {
-                    f.onResult(new ClusterTopologyCheckedException("Remote node left grid: " + nodeId));
+                    f.onNodeLeft(new ClusterTopologyCheckedException("Remote node left grid: " + nodeId));
 
                     return true;
                 }
@@ -873,12 +873,11 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
 
                     assert req.transactionNodes() != null;
 
-                    //noinspection TryWithIdenticalCatches
                     try {
                         cctx.io().send(n, req, tx.ioPolicy());
                     }
                     catch (ClusterTopologyCheckedException e) {
-                        fut.onResult(e);
+                        fut.onNodeLeft(e);
                     }
                     catch (IgniteCheckedException e) {
                         fut.onResult(e);
@@ -933,7 +932,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                             cctx.io().send(nearMapping.node(), req, tx.system() ? UTILITY_CACHE_POOL : SYSTEM_POOL);
                         }
                         catch (ClusterTopologyCheckedException e) {
-                            fut.onResult(e);
+                            fut.onNodeLeft(e);
                         }
                         catch (IgniteCheckedException e) {
                             fut.onResult(e);
@@ -1148,7 +1147,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
         /**
          * @param e Node failure.
          */
-        void onResult(ClusterTopologyCheckedException e) {
+        void onNodeLeft(ClusterTopologyCheckedException e) {
             if (log.isDebugEnabled())
                 log.debug("Remote node left grid while sending or waiting for reply (will ignore): " + this);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7494a86b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
index a5e7a31..7572aaf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
@@ -372,7 +372,9 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
         boolean nearEnabled = cache2.getConfiguration(CacheConfiguration.class).getNearConfiguration() != null;
 
         assertEquals(nearEnabled ? 2 : 0, cache2.localSize(NEAR));
-        assertEquals(0, cache2.localSize(CachePeekMode.ALL) - cache2.localSize(NEAR));
+
+        if (cacheMode() != REPLICATED)
+            assertEquals(0, cache2.localSize(CachePeekMode.ALL) - cache2.localSize(NEAR));
     }
 
     /**


[09/11] incubator-ignite git commit: Merge remote-tracking branch 'origin/master'

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/ignite-752
Commit: cf08181144e4a0394cedffd844988cf7fdc75093
Parents: 7494a86 7ae2b0a
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jul 20 12:37:32 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jul 20 12:37:32 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheAdapter.java       | 2 +-
 .../ignite/internal/processors/cache/IgniteCacheProxy.java       | 2 +-
 .../ignite/internal/processors/cache/IgniteInternalCache.java    | 1 +
 .../main/java/org/apache/ignite/internal/util/IgniteUtils.java   | 4 ++--
 4 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[03/11] incubator-ignite git commit: #ignite-1087: AffinityRun runs job on not primary nodes.

Posted by sb...@apache.org.
#ignite-1087: AffinityRun runs job on not primary nodes.


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

Branch: refs/heads/ignite-752
Commit: f9d2a2ef4424bf166912594791b6414b9a9e8457
Parents: ede9612
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jul 20 11:25:00 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jul 20 11:25:00 2015 +0300

----------------------------------------------------------------------
 .../ignite/compute/ComputeJobResultPolicy.java  |   3 +-
 .../failover/GridFailoverContextImpl.java       |  28 ++-
 .../managers/failover/GridFailoverManager.java  |  13 +-
 .../processors/closure/AffinityTask.java        |  35 ++++
 .../closure/GridClosureProcessor.java           |  63 ++++++-
 .../processors/task/GridTaskWorker.java         |  24 ++-
 .../ignite/spi/failover/FailoverContext.java    |  18 ++
 .../spi/failover/always/AlwaysFailoverSpi.java  |  25 +++
 .../cache/CacheAffinityCallSelfTest.java        | 172 +++++++++++++++++++
 .../cache/GridCacheAffinityRoutingSelfTest.java | 157 ++++++++++++++++-
 .../spi/failover/GridFailoverTestContext.java   |  10 ++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   1 +
 12 files changed, 533 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java b/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java
index 37aba91..26eb542 100644
--- a/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java
+++ b/modules/core/src/main/java/org/apache/ignite/compute/ComputeJobResultPolicy.java
@@ -50,8 +50,7 @@ public enum ComputeJobResultPolicy {
      * @param ord Ordinal value.
      * @return Enumerated value.
      */
-    @Nullable
-    public static ComputeJobResultPolicy fromOrdinal(byte ord) {
+    @Nullable public static ComputeJobResultPolicy fromOrdinal(byte ord) {
         return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java
index a3f8e44..c2b104e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverContextImpl.java
@@ -24,6 +24,7 @@ import org.apache.ignite.internal.managers.loadbalancer.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.spi.failover.*;
+import org.jetbrains.annotations.*;
 
 import java.util.*;
 
@@ -41,15 +42,26 @@ public class GridFailoverContextImpl implements FailoverContext {
     @GridToStringExclude
     private final GridLoadBalancerManager loadMgr;
 
+    /** Affinity key for affinityCall. */
+    private final Object affKey;
+
+    /** Affinity cache name for affinityCall. */
+    private final String affCacheName;
+
     /**
      * Initializes failover context.
      *
      * @param taskSes Grid task session.
      * @param jobRes Failed job result.
      * @param loadMgr Load manager.
+     * @param affKey Affinity key.
+     * @param affCacheName Affinity cache name.
      */
-    public GridFailoverContextImpl(GridTaskSessionImpl taskSes, ComputeJobResult jobRes,
-        GridLoadBalancerManager loadMgr) {
+    public GridFailoverContextImpl(GridTaskSessionImpl taskSes,
+        ComputeJobResult jobRes,
+        GridLoadBalancerManager loadMgr,
+        @Nullable Object affKey,
+        @Nullable String affCacheName) {
         assert taskSes != null;
         assert jobRes != null;
         assert loadMgr != null;
@@ -57,6 +69,8 @@ public class GridFailoverContextImpl implements FailoverContext {
         this.taskSes = taskSes;
         this.jobRes = jobRes;
         this.loadMgr = loadMgr;
+        this.affKey = affKey;
+        this.affCacheName = affCacheName;
     }
 
     /** {@inheritDoc} */
@@ -75,6 +89,16 @@ public class GridFailoverContextImpl implements FailoverContext {
     }
 
     /** {@inheritDoc} */
+    @Nullable @Override public Object affinityKey() {
+        return affKey;
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public String affinityCacheName() {
+        return affCacheName;
+    }
+
+    /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(GridFailoverContextImpl.class, this);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java
index 714cccb..dffc965 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/failover/GridFailoverManager.java
@@ -23,6 +23,7 @@ import org.apache.ignite.compute.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.*;
 import org.apache.ignite.spi.failover.*;
+import org.jetbrains.annotations.*;
 
 import java.util.*;
 
@@ -56,11 +57,17 @@ public class GridFailoverManager extends GridManagerAdapter<FailoverSpi> {
     /**
      * @param taskSes Task session.
      * @param jobRes Job result.
-     * @param top Collection of all top nodes that does not include the failed node.
+     * @param top Collection of all topology nodes.
+     * @param affKey Affinity key.
+     * @param affCacheName Affinity cache name.
      * @return New node to route this job to.
      */
-    public ClusterNode failover(GridTaskSessionImpl taskSes, ComputeJobResult jobRes, List<ClusterNode> top) {
+    public ClusterNode failover(GridTaskSessionImpl taskSes,
+        ComputeJobResult jobRes,
+        List<ClusterNode> top,
+        @Nullable Object affKey,
+        @Nullable String affCacheName) {
         return getSpi(taskSes.getFailoverSpi()).failover(new GridFailoverContextImpl(taskSes, jobRes,
-            ctx.loadBalancing()), top);
+            ctx.loadBalancing(), affKey, affCacheName), top);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/AffinityTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/AffinityTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/AffinityTask.java
new file mode 100644
index 0000000..1b32444
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/AffinityTask.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.closure;
+
+import org.jetbrains.annotations.*;
+
+/**
+ * Affinity mapped task.
+ */
+public interface AffinityTask {
+    /**
+     * @return Affinity key.
+     */
+    public Object affinityKey();
+
+    /**
+     * @return Affinity cache name.
+     */
+    @Nullable public String affinityCacheName();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
index 658557e..21bfc11 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
@@ -413,9 +413,12 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
             final ClusterNode node = ctx.affinity().mapKeyToNode(cacheName, affKey0);
 
+            if (node == null)
+                return ComputeTaskInternalFuture.finishedFuture(ctx, T5.class, U.emptyTopologyException());
+
             ctx.task().setThreadContext(TC_SUBGRID, nodes);
 
-            return ctx.task().execute(new T5(node, job), null, false);
+            return ctx.task().execute(new T5(node, job, affKey0, cacheName), null, false);
         }
         catch (IgniteCheckedException e) {
             return ComputeTaskInternalFuture.finishedFuture(ctx, T5.class, e);
@@ -445,9 +448,12 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
             final ClusterNode node = ctx.affinity().mapKeyToNode(cacheName, affKey0);
 
+            if (node == null)
+                return ComputeTaskInternalFuture.finishedFuture(ctx, T4.class, U.emptyTopologyException());
+
             ctx.task().setThreadContext(TC_SUBGRID, nodes);
 
-            return ctx.task().execute(new T4(node, job), null, false);
+            return ctx.task().execute(new T4(node, job, affKey0, cacheName), null, false);
         }
         catch (IgniteCheckedException e) {
             return ComputeTaskInternalFuture.finishedFuture(ctx, T4.class, e);
@@ -1223,7 +1229,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
     /**
      */
-    private static class T4 extends TaskNoReduceAdapter<Void> implements GridNoImplicitInjection {
+    private static class T4 extends TaskNoReduceAdapter<Void> implements GridNoImplicitInjection, AffinityTask {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -1233,15 +1239,27 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /** */
         private Runnable job;
 
+        /** */
+        private Object affKey;
+
+        /** */
+        private String affCacheName;
+
         /**
          * @param node Cluster node.
          * @param job Job.
+         * @param affKey Affinity key.
+         * @param affCacheName Affinity cache name.
          */
-        private T4(ClusterNode node, Runnable job) {
+        private T4(ClusterNode node, Runnable job, Object affKey, String affCacheName) {
             super(U.peerDeployAware0(job));
 
+            assert affKey != null;
+
             this.node = node;
             this.job = job;
+            this.affKey = affKey;
+            this.affCacheName = affCacheName;
         }
 
         /** {@inheritDoc} */
@@ -1250,11 +1268,22 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
             return Collections.singletonMap(job, node);
         }
+
+        /** {@inheritDoc} */
+        @Override public Object affinityKey() {
+            return affKey;
+        }
+
+        /** {@inheritDoc} */
+        @Nullable @Override public String affinityCacheName() {
+            return affCacheName;
+        }
     }
 
     /**
      */
-    private static class T5<R> extends GridPeerDeployAwareTaskAdapter<Void, R> implements GridNoImplicitInjection {
+    private static class T5<R> extends GridPeerDeployAwareTaskAdapter<Void, R> implements
+        GridNoImplicitInjection, AffinityTask {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -1264,15 +1293,27 @@ public class GridClosureProcessor extends GridProcessorAdapter {
         /** */
         private Callable<R> job;
 
+        /** */
+        private Object affKey;
+
+        /** */
+        private String affCacheName;
+
         /**
          * @param node Cluster node.
          * @param job Job.
+         * @param affKey Affinity key.
+         * @param affCacheName Affinity cache name.
          */
-        private T5(ClusterNode node, Callable<R> job) {
+        private T5(ClusterNode node, Callable<R> job, Object affKey, String affCacheName) {
             super(U.peerDeployAware0(job));
 
+            assert affKey != null;
+
             this.node = node;
             this.job = job;
+            this.affKey = affKey;
+            this.affCacheName = affCacheName;
         }
 
         /** {@inheritDoc} */
@@ -1291,6 +1332,16 @@ public class GridClosureProcessor extends GridProcessorAdapter {
 
             throw new IgniteException("Failed to find successful job result: " + res);
         }
+
+        /** {@inheritDoc} */
+        @Override public Object affinityKey() {
+            return affKey;
+        }
+
+        /** {@inheritDoc} */
+        @Nullable @Override public String affinityCacheName() {
+            return affCacheName;
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
index 133a31f..f241bcc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.compute.*;
 import org.apache.ignite.internal.managers.deployment.*;
+import org.apache.ignite.internal.processors.closure.*;
 import org.apache.ignite.internal.processors.timeout.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
@@ -136,6 +137,12 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
     private final boolean noFailover;
 
     /** */
+    private final Object affKey;
+
+    /** */
+    private final String affCache;
+
+    /** */
     private final UUID subjId;
 
     /** Continuous mapper. */
@@ -245,6 +252,17 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
         Boolean noFailover = getThreadContext(TC_NO_FAILOVER);
 
         this.noFailover = noFailover != null ? noFailover : false;
+
+        if (task instanceof AffinityTask) {
+            AffinityTask affTask = (AffinityTask)task;
+
+            affKey = affTask.affinityKey();
+            affCache = affTask.affinityCacheName();
+        }
+        else {
+            affKey = null;
+            affCache = null;
+        }
     }
 
     /**
@@ -397,7 +415,9 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
 
             ses.setClassLoader(dep.classLoader());
 
-            final List<ClusterNode> shuffledNodes = getTaskTopology();
+            // Nodes are ignored by affinity tasks.
+            final List<ClusterNode> shuffledNodes =
+                affKey == null ? getTaskTopology() : Collections.<ClusterNode>emptyList();
 
             // Load balancer.
             ComputeLoadBalancer balancer = ctx.loadBalancing().getLoadBalancer(ses, shuffledNodes);
@@ -968,7 +988,7 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
             ctx.resource().invokeAnnotated(dep, jobRes.getJob(), ComputeJobBeforeFailover.class);
 
             // Map to a new node.
-            ClusterNode node = ctx.failover().failover(ses, jobRes, new ArrayList<>(top));
+            ClusterNode node = ctx.failover().failover(ses, jobRes, new ArrayList<>(top), affKey, affCache);
 
             if (node == null) {
                 String msg = "Failed to failover a job to another node (failover SPI returned null) [job=" +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java b/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java
index b0cae92..865f1a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/failover/FailoverContext.java
@@ -20,6 +20,8 @@ package org.apache.ignite.spi.failover;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
 
 import java.util.*;
 
@@ -52,4 +54,20 @@ public interface FailoverContext {
      * @throws IgniteException If anything failed.
      */
     public ClusterNode getBalancedNode(List<ClusterNode> top) throws IgniteException;
+
+    /**
+     * Gets affinity key for {@link IgniteCompute#affinityRun(String, Object, IgniteRunnable)}
+     * and {@link IgniteCompute#affinityCall(String, Object, IgniteCallable)}.
+     *
+     * @return Affinity key.
+     */
+    @Nullable public Object affinityKey();
+
+    /**
+     * Returns affinity cache name {@link IgniteCompute#affinityRun(String, Object, IgniteRunnable)}
+     * and {@link IgniteCompute#affinityCall(String, Object, IgniteCallable)}.
+     *
+     * @return Cache name.
+     */
+    @Nullable public String affinityCacheName();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java
index e075d3e..e925995 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/failover/always/AlwaysFailoverSpi.java
@@ -92,6 +92,11 @@ public class AlwaysFailoverSpi extends IgniteSpiAdapter implements FailoverSpi,
      */
     public static final String FAILED_NODE_LIST_ATTR = "gg:failover:failednodelist";
 
+    /**
+     * Name of job context attribute containing number of affinity call attempts.
+     */
+    public static final String AFFINITY_CALL_ATTEMPT = "ignite:failover:affinitycallattempt";
+
     /** Maximum attempts attribute key should be the same on all nodes. */
     public static final String MAX_FAILOVER_ATTEMPT_ATTR = "gg:failover:maxattempts";
 
@@ -173,6 +178,26 @@ public class AlwaysFailoverSpi extends IgniteSpiAdapter implements FailoverSpi,
             return null;
         }
 
+        if (ctx.affinityKey() != null) {
+            Integer affCallAttempt = ctx.getJobResult().getJobContext().getAttribute(AFFINITY_CALL_ATTEMPT);
+
+            if (affCallAttempt == null)
+                affCallAttempt = 1;
+
+            if (maxFailoverAttempts <= affCallAttempt) {
+                U.warn(log, "Job failover failed because number of maximum failover attempts for affinity call" +
+                    " is exceeded [failedJob=" + ctx.getJobResult().getJob() + ", maxFailoverAttempts=" +
+                    maxFailoverAttempts + ']');
+
+                return null;
+            }
+            else {
+                ctx.getJobResult().getJobContext().setAttribute(AFFINITY_CALL_ATTEMPT, affCallAttempt + 1);
+
+                return ignite.affinity(ctx.affinityCacheName()).mapKeyToNode(ctx.affinityKey());
+            }
+        }
+
         Collection<UUID> failedNodes = ctx.getJobResult().getJobContext().getAttribute(FAILED_NODE_LIST_ATTR);
 
         if (failedNodes == null)

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheAffinityCallSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheAffinityCallSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheAffinityCallSelfTest.java
new file mode 100644
index 0000000..c4436ca
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheAffinityCallSelfTest.java
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.compute.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.spi.failover.always.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Test for {@link IgniteCompute#affinityCall(String, Object, IgniteCallable)} and
+ * {@link IgniteCompute#affinityRun(String, Object, IgniteRunnable)}.
+ */
+public class CacheAffinityCallSelfTest extends GridCommonAbstractTest {
+    /** */
+    private static final String CACHE_NAME = "myCache";
+
+    /** */
+    private static final int MAX_FAILOVER_ATTEMPTS = 5;
+
+    /** */
+    private static final int SERVERS_COUNT = 4;
+
+    /** */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        TcpDiscoverySpi spi = new TcpDiscoverySpi();
+
+        spi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(spi);
+
+        AlwaysFailoverSpi failSpi = new AlwaysFailoverSpi();
+        failSpi.setMaximumFailoverAttempts(MAX_FAILOVER_ATTEMPTS);
+        cfg.setFailoverSpi(failSpi);
+
+        CacheConfiguration ccfg = defaultCacheConfiguration();
+        ccfg.setName(CACHE_NAME);
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setBackups(1);
+
+        cfg.setCacheConfiguration(ccfg);
+
+        if (gridName.equals(getTestGridName(SERVERS_COUNT)))
+            cfg.setClientMode(true);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAffinityCallRestartNode() throws Exception {
+        startGrids(4);
+
+        Integer key = primaryKey(grid(0).cache(CACHE_NAME));
+
+        IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                U.sleep(500);
+                stopGrid(0);
+
+                return null;
+            }
+        });
+
+        while (!fut.isDone())
+            grid(1).compute().affinityCall(CACHE_NAME, key, new CheckCallable(key));
+
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAffinityCallNoServerNode() throws Exception {
+        startGrids(SERVERS_COUNT + 1);
+
+        final Integer key = 1;
+
+        final Ignite client = grid(SERVERS_COUNT);
+
+        final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                for (int i = 0; i < SERVERS_COUNT; ++i)
+                    stopGrid(i);
+
+                return null;
+            }
+        });
+
+        try {
+            while (!fut.isDone())
+                client.compute().affinityCall(CACHE_NAME, key, new CheckCallable(key));
+        }
+        catch (ComputeTaskCancelledException e) {
+            assertTrue(e.getMessage().contains("stopping"));
+        }
+        catch(ClusterGroupEmptyException e) {
+            assertTrue(e.getMessage().contains("Topology projection is empty"));
+        }
+        catch(IgniteException e) {
+            assertTrue(e.getMessage().contains("cache (or node) is stopping"));
+        }
+
+        stopGrid(SERVERS_COUNT);
+    }
+
+    /**
+     * Test callable.
+     */
+    public static class CheckCallable implements IgniteCallable<Object> {
+        /** Key. */
+        private final Object key;
+
+        /** */
+        @IgniteInstanceResource
+        private Ignite ignite;
+
+        /**
+         * @param key Key.
+         */
+        public CheckCallable(Object key) {
+            this.key = key;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object call() throws IgniteCheckedException {
+            assert ignite.cluster().localNode().id().equals(ignite.cluster().mapKeyToNode(CACHE_NAME, key).id());
+
+            return null;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
index 78ecf08..a56ab9f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityRoutingSelfTest.java
@@ -19,17 +19,21 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.spi.failover.always.*;
+import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.common.*;
 
+import java.util.concurrent.*;
+
 import static org.apache.ignite.cache.CacheMode.*;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
 
@@ -47,6 +51,9 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
     private static final int KEY_CNT = 50;
 
     /** */
+    private static final int MAX_FAILOVER_ATTEMPTS = 5;
+
+    /** */
     private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
 
     /**
@@ -66,6 +73,10 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
 
         cfg.setDiscoverySpi(spi);
 
+        AlwaysFailoverSpi failSpi = new AlwaysFailoverSpi();
+        failSpi.setMaximumFailoverAttempts(MAX_FAILOVER_ATTEMPTS);
+        cfg.setFailoverSpi(failSpi);
+
         if (!gridName.equals(getTestGridName(GRID_CNT))) {
             // Default cache configuration.
             CacheConfiguration dfltCacheCfg = defaultCacheConfiguration();
@@ -129,6 +140,48 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testAffinityCallRestartFails() throws Exception {
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                grid(0).compute().affinityCall(NON_DFLT_CACHE_NAME, "key",
+                    new FailedCallable("key", MAX_FAILOVER_ATTEMPTS + 1));
+                return null;
+            }
+        }, ClusterTopologyException.class, "Failed to failover a job to another node");
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAffinityCallRestart() throws Exception {
+        assertEquals(MAX_FAILOVER_ATTEMPTS,
+            grid(0).compute().affinityCall(NON_DFLT_CACHE_NAME, "key",
+                new FailedCallable("key", MAX_FAILOVER_ATTEMPTS)));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAffinityRunRestartFails() throws Exception {
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                grid(0).compute().affinityRun(NON_DFLT_CACHE_NAME, "key",
+                    new FailedRunnable("key", MAX_FAILOVER_ATTEMPTS + 1));
+                return null;
+            }
+        }, ClusterTopologyException.class, "Failed to failover a job to another node");
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAffinityRunRestart() throws Exception {
+        grid(0).compute().affinityRun(NON_DFLT_CACHE_NAME, "key", new FailedRunnable("key", MAX_FAILOVER_ATTEMPTS));
+    }
+
+    /**
      * JUnit.
      *
      * @throws Exception If failed.
@@ -224,6 +277,108 @@ public class GridCacheAffinityRoutingSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * Test runnable.
+     */
+    private static class FailedCallable implements IgniteCallable<Object> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        private static final String ATTR_ATTEMPT = "Attempt";
+
+        /** */
+        @IgniteInstanceResource
+        private Ignite ignite;
+
+        /** */
+        @JobContextResource
+        private ComputeJobContext jobCtx;
+
+        /** Key. */
+        private final Object key;
+
+        /** Call attempts. */
+        private final Integer callAttempt;
+
+        /**
+         * @param key Key.
+         * @param callAttempt Call attempts.
+         */
+        public FailedCallable(Object key, Integer callAttempt) {
+            this.key = key;
+            this.callAttempt = callAttempt;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object call() throws IgniteCheckedException {
+            Integer attempt = jobCtx.getAttribute(ATTR_ATTEMPT);
+
+            if (attempt == null)
+                attempt = 1;
+
+            assertEquals(ignite.affinity(NON_DFLT_CACHE_NAME).mapKeyToNode(key), ignite.cluster().localNode());
+
+            jobCtx.setAttribute(ATTR_ATTEMPT, attempt + 1);
+
+            if (attempt < callAttempt)
+                throw new ComputeJobFailoverException("Failover exception.");
+            else
+                return attempt;
+        }
+    }
+
+    /**
+     * Test runnable.
+     */
+    private static class FailedRunnable implements IgniteRunnable {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        private static final String ATTR_ATTEMPT = "Attempt";
+
+        /** */
+        @IgniteInstanceResource
+        private Ignite ignite;
+
+        /** */
+        @JobContextResource
+        private ComputeJobContext jobCtx;
+
+        /** Key. */
+        private final Object key;
+
+        /** Call attempts. */
+        private final Integer callAttempt;
+
+        /**
+         * @param key Key.
+         * @param callAttempt Call attempts.
+         */
+        public FailedRunnable(Object key, Integer callAttempt) {
+            this.key = key;
+            this.callAttempt = callAttempt;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void run() {
+            Integer attempt = jobCtx.getAttribute(ATTR_ATTEMPT);
+
+            if (attempt == null)
+                attempt = 1;
+
+            assertEquals(ignite.affinity(NON_DFLT_CACHE_NAME).mapKeyToNode(key), ignite.cluster().localNode());
+
+            jobCtx.setAttribute(ATTR_ATTEMPT, attempt + 1);
+
+            if (attempt < callAttempt)
+                throw new ComputeJobFailoverException("Failover exception.");
+            else
+                assertEquals(callAttempt, attempt);
+        }
+    }
+
+    /**
      * Test callable.
      */
     private static class CheckCallable implements IgniteCallable<Object> {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java b/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java
index db64475..bfca83d 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/failover/GridFailoverTestContext.java
@@ -66,4 +66,14 @@ public class GridFailoverTestContext implements FailoverContext {
     @Override public ClusterNode getBalancedNode(List<ClusterNode> grid) {
         return grid.get(RAND.nextInt(grid.size()));
     }
+
+    /** {@inheritDoc} */
+    @Override public Object affinityKey() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String affinityCacheName() {
+        return null;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f9d2a2ef/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 39702a3..bafdfef 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -109,6 +109,7 @@ public class IgniteCacheTestSuite extends TestSuite {
         // Common tests.
         suite.addTestSuite(GridCacheConcurrentMapSelfTest.class);
         suite.addTestSuite(GridCacheAffinityMapperSelfTest.class);
+        suite.addTestSuite(CacheAffinityCallSelfTest.class);
         GridTestUtils.addTestIfNeeded(suite, GridCacheAffinityRoutingSelfTest.class, ignoredTests);
         GridTestUtils.addTestIfNeeded(suite, GridCacheMvccSelfTest.class, ignoredTests);
         suite.addTestSuite(GridCacheMvccPartitionedSelfTest.class);



[04/11] incubator-ignite git commit: # master minor

Posted by sb...@apache.org.
# master minor


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

Branch: refs/heads/ignite-752
Commit: d8f86f18315da2c6882eae72117f5f2033e3b67a
Parents: f9d2a2e
Author: sboikov <sb...@gridgain.com>
Authored: Mon Jul 20 11:40:52 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Jul 20 11:40:52 2015 +0300

----------------------------------------------------------------------
 .../IgniteCachePutRetryAbstractSelfTest.java    | 52 +++++++++++++-------
 ...gniteCachePutRetryTransactionalSelfTest.java | 17 ++++---
 2 files changed, 44 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d8f86f18/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
index bfddbe7..7f2d173 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
@@ -71,6 +71,8 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
     public void testPut() throws Exception {
         final AtomicBoolean finished = new AtomicBoolean();
 
+        int keysCnt = keysCount();
+
         IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
             @Override public Object call() throws Exception {
                 while (!finished.get()) {
@@ -85,13 +87,18 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
             }
         });
 
-        int keysCnt = keysCount();
 
-        for (int i = 0; i < keysCnt; i++)
-            ignite(0).cache(null).put(i, i);
+        try {
+            for (int i = 0; i < keysCnt; i++)
+                ignite(0).cache(null).put(i, i);
 
-        finished.set(true);
-        fut.get();
+            finished.set(true);
+
+            fut.get();
+        }
+        finally {
+            finished.set(true);
+        }
 
         for (int i = 0; i < keysCnt; i++)
             assertEquals(i, ignite(0).cache(null).get(i));
@@ -117,27 +124,34 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
             }
         });
 
-        int keysCnt = keysCount();
+        try {
+            int keysCnt = keysCount();
 
-        boolean exceptionThrown = false;
+            boolean eThrown = false;
 
-        for (int i = 0; i < keysCnt; i++) {
-            try {
-                ignite(0).cache(null).withNoRetries().put(i, i);
-            }
-            catch (Exception e) {
-                assertTrue("Invalid exception: " + e, X.hasCause(e, ClusterTopologyCheckedException.class) || X.hasCause(e, CachePartialUpdateException.class));
+            for (int i = 0; i < keysCnt; i++) {
+                try {
+                    ignite(0).cache(null).withNoRetries().put(i, i);
+                }
+                catch (Exception e) {
+                    assertTrue("Invalid exception: " + e, X.hasCause(e, ClusterTopologyCheckedException.class) ||
+                        X.hasCause(e, CachePartialUpdateException.class));
 
-                exceptionThrown = true;
+                    eThrown = true;
 
-                break;
+                    break;
+                }
             }
-        }
 
-        assertTrue(exceptionThrown);
+            assertTrue(eThrown);
 
-        finished.set(true);
-        fut.get();
+            finished.set(true);
+
+            fut.get();
+        }
+        finally {
+            finished.set(true);
+        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d8f86f18/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
index 91c454a..1d14dec 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryTransactionalSelfTest.java
@@ -49,8 +49,7 @@ public class IgniteCachePutRetryTransactionalSelfTest extends IgniteCachePutRetr
         IgniteAtomicLong atomic = ignite(0).atomicLong("TestAtomic", 0, true);
 
         IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
-            @Override
-            public Object call() throws Exception {
+            @Override public Object call() throws Exception {
                 while (!finished.get()) {
                     stopGrid(3);
 
@@ -65,10 +64,16 @@ public class IgniteCachePutRetryTransactionalSelfTest extends IgniteCachePutRetr
 
         int keysCnt = keysCount();
 
-        for (int i = 0; i < keysCnt; i++)
-            atomic.incrementAndGet();
+        try {
+            for (int i = 0; i < keysCnt; i++)
+                atomic.incrementAndGet();
 
-        finished.set(true);
-        fut.get();
+            finished.set(true);
+
+            fut.get();
+        }
+        finally {
+            finished.set(true);
+        }
     }
 }


[02/11] incubator-ignite git commit: Fixed typo and minor fixes to javadocs.

Posted by sb...@apache.org.
Fixed typo and minor fixes to javadocs.


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

Branch: refs/heads/ignite-752
Commit: ede961215ce3a596f7dcb90e82f48aa723d892bf
Parents: 192fefc
Author: AKuznetsov <ak...@gridgain.com>
Authored: Mon Jul 20 15:06:04 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Mon Jul 20 15:06:04 2015 +0700

----------------------------------------------------------------------
 .../ignite/schema/ui/SchemaImportApp.java       | 36 ++++++++++++++++----
 1 file changed, 29 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ede96121/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
index 00d1bc8..7b9c220 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
@@ -109,7 +109,7 @@ public class SchemaImportApp extends Application {
             "jdbc:mysql://[host]:[port]/[database]", "root"),
         new Preset("mssql", "Microsoft SQL Server", "sqljdbc41.jar", "com.microsoft.sqlserver.jdbc.SQLServerDriver",
             "jdbc:sqlserver://[host]:[port][;databaseName=database]", "sa"),
-        new Preset("posgresql", "PostgreSQL", "postgresql-9.3.jdbc4.jar", "org.postgresql.Driver",
+        new Preset("postgresql", "PostgreSQL", "postgresql-9.3.jdbc4.jar", "org.postgresql.Driver",
             "jdbc:postgresql://[host]:[port]/[database]", "sa"),
         new Preset("custom", "Custom server...", "custom-jdbc.jar", "org.custom.Driver", "jdbc:custom", "sa")
     };
@@ -444,6 +444,11 @@ public class SchemaImportApp extends Application {
         final boolean singleXml = xmlSingleFileCh.isSelected();
 
         Runnable task = new Task<Void>() {
+            /**
+             * @param pojo POJO descriptor to check.
+             * @param selected Selected flag.
+             * @param msg Message to show in case of check failed.
+             */
             private void checkEmpty(final PojoDescriptor pojo, boolean selected, String msg) {
                 if (!selected) {
                     Platform.runLater(new Runnable() {
@@ -694,6 +699,8 @@ public class SchemaImportApp extends Application {
 
     /**
      * Create connection pane with controls.
+     *
+     * @return Pane with connection controls.
      */
     private Pane createConnectionPane() {
         connPnl = paneEx(10, 10, 0, 10);
@@ -1110,10 +1117,10 @@ public class SchemaImportApp extends Application {
                 if (curPojo != null) {
                     TableView.TableViewSelectionModel<PojoDescriptor> selMdl = pojosTbl.getSelectionModel();
 
-                    List<Integer> idxs = new ArrayList<>(selMdl.getSelectedIndices());
+                    List<Integer> selIndices = new ArrayList<>(selMdl.getSelectedIndices());
 
-                    if (idxs.size() > 1) {
-                        for (Integer idx : idxs) {
+                    if (selIndices.size() > 1) {
+                        for (Integer idx : selIndices) {
                             if (pojos.get(idx) != curPojo)
                                 selMdl.clearSelection(idx);
                         }
@@ -1242,6 +1249,7 @@ public class SchemaImportApp extends Application {
      *
      * @param key Property key.
      * @param dflt Default value.
+     * @return Property value as string.
      */
     private String getStringProp(String key, String dflt) {
         String val = prefs.getProperty(key);
@@ -1267,6 +1275,7 @@ public class SchemaImportApp extends Application {
      *
      * @param key Property key.
      * @param dflt Default value.
+     * @return Property value as int.
      */
     private int getIntProp(String key, int dflt) {
         String val = prefs.getProperty(key);
@@ -1297,6 +1306,7 @@ public class SchemaImportApp extends Application {
      *
      * @param key Property key.
      * @param dflt Default value.
+     * @return Property value as boolean.
      */
     private boolean getBoolProp(String key, boolean dflt) {
         String val = prefs.getProperty(key);
@@ -1563,7 +1573,11 @@ public class SchemaImportApp extends Application {
         /** Combo box. */
         private final ComboBox<String> comboBox;
 
-        /** Creates a ComboBox cell factory for use in TableColumn controls. */
+        /**
+         * Creates a ComboBox cell factory for use in TableColumn controls.
+         *
+         * @return Cell factory for cell with java types combobox.
+         */
         public static Callback<TableColumn<PojoField, String>, TableCell<PojoField, String>> cellFactory() {
             return new Callback<TableColumn<PojoField, String>, TableCell<PojoField, String>>() {
                 @Override public TableCell<PojoField, String> call(TableColumn<PojoField, String> col) {
@@ -1637,7 +1651,11 @@ public class SchemaImportApp extends Application {
      * Special table cell to select schema or table.
      */
     private static class PojoDescriptorCell extends TableCell<PojoDescriptor, Boolean> {
-        /** Creates a ComboBox cell factory for use in TableColumn controls. */
+        /**
+         * Creates a ComboBox cell factory for use in TableColumn controls.
+         *
+         * @return Cell factory for schema / table selection.
+         */
         public static Callback<TableColumn<PojoDescriptor, Boolean>, TableCell<PojoDescriptor, Boolean>> cellFactory() {
             return new Callback<TableColumn<PojoDescriptor, Boolean>, TableCell<PojoDescriptor, Boolean>>() {
                 @Override public TableCell<PojoDescriptor, Boolean> call(TableColumn<PojoDescriptor, Boolean> col) {
@@ -1694,7 +1712,11 @@ public class SchemaImportApp extends Application {
      * Special table cell to select &quot;used&quot; fields for code generation.
      */
     private static class PojoFieldUseCell extends TableCell<PojoField, Boolean> {
-        /** Creates a ComboBox cell factory for use in TableColumn controls. */
+        /**
+         * Creates a ComboBox cell factory for use in TableColumn controls.
+         *
+         * @return Cell factory for used fields selection.
+         */
         public static Callback<TableColumn<PojoField, Boolean>, TableCell<PojoField, Boolean>> cellFactory() {
             return new Callback<TableColumn<PojoField, Boolean>, TableCell<PojoField, Boolean>>() {
                 @Override public TableCell<PojoField, Boolean> call(TableColumn<PojoField, Boolean> col) {


[07/11] incubator-ignite git commit: minor

Posted by sb...@apache.org.
minor


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

Branch: refs/heads/ignite-752
Commit: 7ae2b0af43f914f7af4975da76db3ea6acc0e43d
Parents: d24c2da
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jul 20 12:24:39 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jul 20 12:24:39 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/IgniteInternalCache.java    | 1 +
 .../main/java/org/apache/ignite/internal/util/IgniteUtils.java   | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ae2b0af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index 9972f92..7396c84 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -1473,6 +1473,7 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
      * @return Internal projection.
      */
     IgniteInternalCache<K, V> forSubjectId(UUID subjId);
+
     /**
      * Store DR data.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7ae2b0af/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 42982b9..c4f6712 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
@@ -984,7 +984,7 @@ public abstract class IgniteUtils {
     }
 
     /**
-     * Returns current JVM maxMemory in the same format as {@link #heapSize(org.apache.ignite.cluster.ClusterNode, int)}.
+     * Returns current JVM maxMemory in the same format as {@link #heapSize(ClusterNode, int)}.
      *
      * @param precision Precision.
      * @return Maximum memory size in GB.
@@ -8069,7 +8069,7 @@ public abstract class IgniteUtils {
     /**
      * @param addrs Node's addresses.
      * @param port Port discovery number.
-     * @return A string compatible with {@link org.apache.ignite.cluster.ClusterNode#consistentId()} requirements.
+     * @return A string compatible with {@link ClusterNode#consistentId()} requirements.
      */
     public static String consistentId(Collection<String> addrs, int port) {
         assert !F.isEmpty(addrs);


[06/11] incubator-ignite git commit: minor

Posted by sb...@apache.org.
minor


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

Branch: refs/heads/ignite-752
Commit: d24c2da35ac300484566bf2fe40d2664e4942686
Parents: 05672fe
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jul 20 11:53:41 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jul 20 11:53:41 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/processors/cache/IgniteCacheProxy.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d24c2da3/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 0b2eba0..e532778 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
@@ -556,7 +556,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
                 if (isReplicatedDataNode() || ctx.isLocal() || qry.isLocal())
                     return (QueryCursor<R>)new QueryCursorImpl<>(new Iterable<Cache.Entry<K, V>>() {
                         @Override public Iterator<Cache.Entry<K, V>> iterator() {
-                            return ctx.kernalContext().query().<K, V>queryLocal(ctx, p);
+                            return ctx.kernalContext().query().queryLocal(ctx, p);
                         }
                     });
 


[11/11] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-752

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-752


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

Branch: refs/heads/ignite-752
Commit: 05f69a6a6beec9fdc9f9ea5f08eaee91a523edcf
Parents: ac4c9f7 cf08181
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jul 20 13:17:41 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jul 20 13:17:41 2015 +0300

----------------------------------------------------------------------
 .../ignite/compute/ComputeJobResultPolicy.java  |   3 +-
 .../failover/GridFailoverContextImpl.java       |  28 ++-
 .../managers/failover/GridFailoverManager.java  |  13 +-
 .../processors/cache/GridCacheAdapter.java      |   2 +-
 .../processors/cache/GridCacheUtils.java        |   4 +-
 .../processors/cache/IgniteCacheProxy.java      |   2 +-
 .../processors/cache/IgniteInternalCache.java   |   1 +
 .../distributed/dht/GridDhtTxPrepareFuture.java |   9 +-
 .../processors/closure/AffinityTask.java        |  35 ++++
 .../closure/GridClosureProcessor.java           |  63 ++++++-
 .../processors/task/GridTaskWorker.java         |  24 ++-
 .../ignite/internal/util/IgniteUtils.java       |   8 +-
 .../ignite/spi/failover/FailoverContext.java    |  18 ++
 .../spi/failover/always/AlwaysFailoverSpi.java  |  25 +++
 .../IgniteClientReconnectFailoverTest.java      |  47 +++--
 .../cache/CacheAffinityCallSelfTest.java        | 172 +++++++++++++++++++
 .../cache/GridCacheAffinityRoutingSelfTest.java | 157 ++++++++++++++++-
 .../cache/IgniteCacheNearLockValueSelfTest.java |   2 +
 .../IgniteCachePutRetryAbstractSelfTest.java    |  52 ++++--
 ...gniteCachePutRetryTransactionalSelfTest.java |  17 +-
 ...achePartitionedMultiNodeFullApiSelfTest.java |   4 +-
 .../spi/failover/GridFailoverTestContext.java   |  10 ++
 .../ignite/testsuites/IgniteCacheTestSuite.java |   1 +
 .../ignite/schema/ui/SchemaImportApp.java       |  36 +++-
 24 files changed, 650 insertions(+), 83 deletions(-)
----------------------------------------------------------------------



[05/11] incubator-ignite git commit: minor

Posted by sb...@apache.org.
minor


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

Branch: refs/heads/ignite-752
Commit: 05672fedcf2ddd2adba764d7cb2ae75e8d607a3a
Parents: d8f86f1
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jul 20 11:51:49 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jul 20 11:51:49 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/processors/cache/GridCacheAdapter.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/05672fed/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index d2a730a..7a5a0aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -1627,7 +1627,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
     ) {
         ctx.checkSecurity(SecurityPermission.CACHE_READ);
 
-       if (keyCheck)
+        if (keyCheck)
             validateCacheKeys(keys);
 
         return getAllAsync0(ctx.cacheKeysView(keys),


[10/11] incubator-ignite git commit: ignite-752: fixing tests

Posted by sb...@apache.org.
ignite-752: fixing tests


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

Branch: refs/heads/ignite-752
Commit: ac4c9f772d7566ad2d6f89c440426e526c6501fa
Parents: d9ddfb4
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Jul 20 13:07:32 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Jul 20 13:07:32 2015 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/TcpDiscoverySpiFailureThresholdSelfTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac4c9f77/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureThresholdSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureThresholdSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureThresholdSelfTest.java
index 347ced3..d6b4cdf 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureThresholdSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureThresholdSelfTest.java
@@ -323,7 +323,7 @@ public class TcpDiscoverySpiFailureThresholdSelfTest extends AbstractDiscoverySe
                 long timeout = timeoutCtrl.nextTimeoutChunk(0);
 
                 try {
-                    Thread.sleep(timeout);
+                    Thread.sleep(timeout + 1000);
                 }
                 catch (InterruptedException e) {
                     // Ignore