ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [49/50] [abbrv] incubator-ignite git commit: futures: api cleanup
Date Thu, 05 Mar 2015 09:03:34 GMT
futures: api cleanup


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

Branch: refs/heads/ignite-313
Commit: c1b46951fcb01de43a3df71b287cb69d89ab065b
Parents: 680b0ba
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Wed Mar 4 21:15:46 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Wed Mar 4 21:15:46 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/IgniteSystemProperties.java   |  20 -
 .../internal/ComputeTaskInternalFuture.java     |  41 +-
 .../ignite/internal/GridJobSessionImpl.java     |   2 +-
 .../ignite/internal/GridTaskSessionImpl.java    |   2 +-
 .../ignite/internal/IgniteInternalFuture.java   |  58 ---
 .../internal/cluster/IgniteClusterImpl.java     |   6 +-
 .../discovery/GridDiscoveryManager.java         |  10 +-
 .../eventstorage/GridEventStorageManager.java   |   6 +-
 .../affinity/GridAffinityAssignmentCache.java   |   2 +-
 .../affinity/GridAffinityProcessor.java         |   2 +-
 .../processors/cache/GridCacheAdapter.java      |  55 +-
 .../cache/GridCacheAffinityManager.java         |   2 +-
 .../cache/GridCacheEvictionManager.java         |   2 +-
 .../cache/GridCacheMultiTxFuture.java           |   7 +-
 .../processors/cache/GridCacheMvccManager.java  |   4 +-
 .../GridCachePartitionExchangeManager.java      |   2 +-
 .../cache/GridCachePreloaderAdapter.java        |   4 +-
 .../cache/GridCacheProjectionImpl.java          |  12 +-
 ...ridCacheOptimisticCheckPreparedTxFuture.java |   4 +-
 .../distributed/GridCacheTxFinishSync.java      |   2 +-
 .../GridDistributedCacheAdapter.java            |   2 +-
 .../GridDistributedTxRemoteAdapter.java         |   6 +-
 .../dht/GridDhtAssignmentFetchFuture.java       |  18 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |   2 +-
 .../distributed/dht/GridDhtCacheEntry.java      |  12 +-
 .../distributed/dht/GridDhtEmbeddedFuture.java  |  24 +-
 .../distributed/dht/GridDhtFinishedFuture.java  |   4 +-
 .../cache/distributed/dht/GridDhtGetFuture.java |  25 +-
 .../distributed/dht/GridDhtLocalPartition.java  |   4 +-
 .../distributed/dht/GridDhtLockFuture.java      |   6 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |  17 +-
 .../distributed/dht/GridDhtTxFinishFuture.java  |  10 +-
 .../distributed/dht/GridDhtTxLocalAdapter.java  |  14 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java |  13 +-
 .../dht/GridPartitionedGetFuture.java           |  12 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  13 +-
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   |  17 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  38 +-
 .../dht/colocated/GridDhtColocatedCache.java    |  22 +-
 .../colocated/GridDhtColocatedLockFuture.java   |   8 +-
 .../dht/preloader/GridDhtForceKeysFuture.java   |  20 +-
 .../preloader/GridDhtPartitionDemandPool.java   |   2 +-
 .../GridDhtPartitionsExchangeFuture.java        |  24 +-
 .../dht/preloader/GridDhtPreloader.java         |   9 +-
 .../distributed/near/GridNearAtomicCache.java   |   2 +-
 .../distributed/near/GridNearCacheAdapter.java  |   2 +-
 .../distributed/near/GridNearGetFuture.java     |  21 +-
 .../distributed/near/GridNearLockFuture.java    |   8 +-
 .../near/GridNearTransactionalCache.java        |   2 +-
 .../near/GridNearTxFinishFuture.java            |   4 +-
 .../cache/distributed/near/GridNearTxLocal.java |  16 +-
 .../near/GridNearTxPrepareFuture.java           |  12 +-
 .../processors/cache/local/GridLocalCache.java  |   2 +-
 .../cache/local/GridLocalLockFuture.java        |   4 +-
 .../processors/cache/local/GridLocalTx.java     |  10 +-
 .../cache/local/GridLocalTxFuture.java          |   4 +-
 .../local/atomic/GridLocalAtomicCache.java      |   6 +-
 .../GridCacheDistributedFieldsQueryFuture.java  |   2 +-
 .../query/GridCacheFieldsQueryErrorFuture.java  |   2 +-
 .../query/GridCacheLocalFieldsQueryFuture.java  |   2 +-
 .../cache/query/GridCacheLocalQueryFuture.java  |   4 +-
 .../cache/query/GridCacheQueryErrorFuture.java  |   2 +-
 .../query/GridCacheQueryFutureAdapter.java      |   4 +-
 .../cache/query/GridCacheQueryManager.java      |   4 +-
 .../cache/transactions/IgniteTxAdapter.java     |   2 +-
 .../cache/transactions/IgniteTxHandler.java     |  13 +-
 .../transactions/IgniteTxLocalAdapter.java      |  91 ++--
 .../transactions/TransactionProxyImpl.java      |   2 +-
 .../closure/GridClosureProcessor.java           |  28 +-
 .../continuous/GridContinuousProcessor.java     |  24 +-
 .../dataload/GridDataLoaderFuture.java          |   4 +-
 .../dataload/IgniteDataLoaderImpl.java          |  10 +-
 .../GridCacheAtomicSequenceImpl.java            |   4 +-
 .../hadoop/IgniteHadoopNoopProcessor.java       |   2 +-
 .../processors/igfs/IgfsDataManager.java        |  14 +-
 .../internal/processors/igfs/IgfsImpl.java      |  10 +-
 .../processors/igfs/IgfsIpcHandler.java         |   4 +-
 .../processors/query/GridQueryProcessor.java    |   4 +-
 .../processors/rest/GridRestProcessor.java      |  10 +-
 .../handlers/cache/GridCacheCommandHandler.java |   6 +-
 .../cache/GridCacheQueryCommandHandler.java     |   4 +-
 .../DataStructuresCommandHandler.java           |   4 +-
 .../handlers/task/GridTaskCommandHandler.java   |   4 +-
 .../top/GridTopologyCommandHandler.java         |   4 +-
 .../version/GridVersionCommandHandler.java      |   2 +-
 .../tcp/GridTcpMemcachedNioListener.java        |   4 +-
 .../service/GridServiceDeploymentFuture.java    |   2 +-
 .../service/GridServiceProcessor.java           |   8 +-
 .../GridStreamerStageExecutionFuture.java       |   4 +-
 .../util/future/GridCompoundFuture.java         |  34 +-
 .../util/future/GridEmbeddedFuture.java         |  48 +-
 .../util/future/GridFinishedFuture.java         | 118 +----
 .../util/future/GridFinishedFutureEx.java       | 192 -------
 .../internal/util/future/GridFutureAdapter.java | 219 +-------
 .../util/future/GridFutureAdapterEx.java        | 500 -------------------
 .../util/future/GridFutureChainListener.java    |  18 +-
 .../util/future/IgniteFinishedFutureImpl.java   |  27 +-
 .../util/future/IgniteFinishedFutureImplEx.java |  30 --
 .../internal/util/future/IgniteFutureImpl.java  |  20 -
 .../ignite/internal/util/lang/GridFunc.java     |   6 +-
 .../internal/util/worker/GridWorkerFuture.java  |   2 +-
 .../org/apache/ignite/lang/IgniteFuture.java    |  58 ---
 .../communication/tcp/TcpCommunicationSpi.java  |  16 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   2 +-
 .../distributed/GridCacheEventAbstractTest.java |   2 +-
 .../cache/GridCacheCommandHandlerSelfTest.java  |  42 +-
 .../util/future/GridCompoundFutureSelfTest.java |  14 +-
 .../util/future/GridEmbeddedFutureSelfTest.java |  13 +-
 .../util/future/GridFinishedFutureSelfTest.java | 103 ----
 .../util/future/GridFutureAdapterSelfTest.java  |  10 +-
 .../util/future/IgniteFutureImplTest.java       |  41 +-
 .../testsuites/IgniteLangSelfTestSuite.java     |   1 -
 .../hadoop/jobtracker/GridHadoopJobTracker.java |  12 +-
 .../hadoop/shuffle/GridHadoopShuffle.java       |   4 +-
 .../hadoop/shuffle/GridHadoopShuffleJob.java    |  14 +-
 .../GridHadoopExternalTaskExecutor.java         |   2 +-
 .../child/GridHadoopChildProcessRunner.java     |   2 +-
 .../processors/query/h2/IgniteH2Indexing.java   |   2 +-
 .../h2/twostep/GridReduceQueryExecutor.java     |   8 +-
 .../processors/schedule/ScheduleFutureImpl.java |   3 +-
 120 files changed, 548 insertions(+), 1957 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 547cbc6..d454e76 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -150,26 +150,6 @@ public final class IgniteSystemProperties {
     public static final String IGNITE_LOCAL_HOST = "IGNITE_LOCAL_HOST";
 
     /**
-     * Name of the system property or environment variable to activate synchronous
-     * listener notification for future objects implemented in Ignite. I.e.
-     * closure passed into method {@link org.apache.ignite.internal.IgniteInternalFuture#listenAsync(org.apache.ignite.lang.IgniteInClosure)} will
-     * be evaluated in the same thread that will end the future.
-     *
-     * @see org.apache.ignite.internal.IgniteInternalFuture#syncNotify()
-     */
-    public static final String IGNITE_FUT_SYNC_NOTIFICATION = "IGNITE_FUTURE_SYNC_NOTIFICATION";
-
-    /**
-     * Name of the system property or environment variable to activate concurrent
-     * listener notification for future objects implemented in Ignite. I.e.
-     * upon future completion every listener will be notified concurrently in a
-     * separate thread.
-     *
-     * @see org.apache.ignite.internal.IgniteInternalFuture#concurrentNotify()
-     */
-    public static final String IGNITE_FUT_CONCURRENT_NOTIFICATION = "IGNITE_FUTURE_CONCURRENT_NOTIFICATION";
-
-    /**
      * System property to override deployment mode configuration parameter.
      * Valid values for property are: PRIVATE, ISOLATED, SHARED or CONTINUOUS.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java
index 9c9a5e5..16ef37e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.internal.util.future.*;
 import org.apache.ignite.internal.util.tostring.*;
@@ -27,7 +26,6 @@ import org.apache.ignite.lang.*;
 import org.apache.ignite.plugin.security.*;
 import org.jetbrains.annotations.*;
 
-import java.io.*;
 import java.util.*;
 
 /**
@@ -49,18 +47,11 @@ public class ComputeTaskInternalFuture<R> extends GridFutureAdapter<R> {
     private ComputeFuture<R> userFut;
 
     /**
-     * Required by {@link Externalizable}.
-     */
-    public ComputeTaskInternalFuture() {
-        // No-op.
-    }
-
-    /**
      * @param ses Task session instance.
      * @param ctx Kernal context.
      */
     public ComputeTaskInternalFuture(ComputeTaskSession ses, GridKernalContext ctx) {
-        super(ctx);
+        super();
 
         assert ses != null;
         assert ctx != null;
@@ -197,7 +188,7 @@ public class ComputeTaskInternalFuture<R> extends GridFutureAdapter<R> {
             }
 
             @Override public IgniteFuture<?> mapFuture() {
-                return new IgniteFinishedFutureImpl<Object>(ctx);
+                return new IgniteFinishedFutureImpl<Object>();
             }
         };
 
@@ -231,8 +222,6 @@ public class ComputeTaskInternalFuture<R> extends GridFutureAdapter<R> {
     @Override public boolean cancel() throws IgniteCheckedException {
         ctx.security().authorize(ses.getTaskName(), GridSecurityPermission.TASK_CANCEL, null);
 
-        checkValid();
-
         if (onCancelled()) {
             ctx.task().onCancelled(ses.getId());
 
@@ -242,32 +231,6 @@ public class ComputeTaskInternalFuture<R> extends GridFutureAdapter<R> {
         return isCancelled();
     }
 
-    /**
-     * Cancel task on master leave event. Does not send cancel request to remote jobs and invokes master-leave
-     * callback on local jobs.
-     *
-     * @return {@code True} if future was cancelled (i.e. was not finished prior to this call).
-     * @throws IgniteCheckedException If failed.
-     */
-    public boolean cancelOnMasterLeave() throws IgniteCheckedException {
-        checkValid();
-
-        if (onCancelled()) {
-            // Invoke master-leave callback on spawned jobs on local node and then cancel them.
-            for (ClusterNode node : ctx.discovery().nodes(ses.getTopology())) {
-                if (ctx.localNodeId().equals(node.id())) {
-                    ctx.job().masterLeaveLocal(ses.getId());
-
-                    ctx.job().cancelJob(ses.getId(), null, false);
-                }
-            }
-
-            return true;
-        }
-
-        return isCancelled();
-    }
-
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(ComputeTaskInternalFuture.class, this, "super", super.toString());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/GridJobSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobSessionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobSessionImpl.java
index aa9b1b5..7d32586 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobSessionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobSessionImpl.java
@@ -292,7 +292,7 @@ public class GridJobSessionImpl implements GridTaskSessionInternal {
 
     /** {@inheritDoc} */
     @Override public IgniteFuture<?> mapFuture() {
-        return new IgniteFinishedFutureImpl<>(ctx, null);
+        return new IgniteFinishedFutureImpl<>(null);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionImpl.java
index 2957801..25ebb37 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionImpl.java
@@ -156,7 +156,7 @@ public class GridTaskSessionImpl implements GridTaskSessionInternal {
         this.fullSup = fullSup;
         this.subjId = subjId;
 
-        mapFut = new IgniteFutureImpl(new GridFutureAdapter(ctx));
+        mapFut = new IgniteFutureImpl(new GridFutureAdapter());
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
index ed4a820..969d905 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteInternalFuture.java
@@ -107,64 +107,6 @@ public interface IgniteInternalFuture<R> {
     public long duration();
 
     /**
-     * Flag to turn on or off synchronous listener notification. If this flag is {@code true}, then
-     * upon future completion the notification may happen in the same thread that created
-     * the future. This becomes especially important when adding listener to a future that
-     * is already {@code done} - if this flag is {@code true}, then listener will be
-     * immediately notified within the same thread.
-     * <p>
-     * Default value is {@code false}. To change the default, set
-     * {@link IgniteSystemProperties#IGNITE_FUT_SYNC_NOTIFICATION} system property to {@code true}.
-     *
-     * @param syncNotify Flag to turn on or off synchronous listener notification.
-     */
-    public void syncNotify(boolean syncNotify);
-
-    /**
-     * Gets value of synchronous listener notification flag. If this flag is {@code true}, then
-     * upon future completion the notification may happen in the same thread that created
-     * the future. This becomes especially important when adding listener to a future that
-     * is already {@code done} - if this flag is {@code true}, then listener will be
-     * immediately notified within the same thread.
-     * <p>
-     * Default value is {@code false}. To change the default, set
-     * {@link IgniteSystemProperties#IGNITE_FUT_SYNC_NOTIFICATION} system property to {@code true}.
-     *
-     * @return Synchronous listener notification flag.
-     */
-    public boolean syncNotify();
-
-    /**
-     * Flag to turn on or off concurrent listener notification. This flag comes into play only
-     * when a future has more than one listener subscribed to it. If this flag is {@code true},
-     * then all listeners will be notified concurrently by different threads; otherwise,
-     * listeners will be notified one after another within one thread (depending on
-     * {@link #syncNotify()} flag, these notifications may happen either in the same thread which
-     * started the future, or in a different thread).
-     * <p>
-     * Default value is {@code false}. To change the default, set
-     * {@link IgniteSystemProperties#IGNITE_FUT_CONCURRENT_NOTIFICATION} system property to {@code true}.
-     *
-     * @param concurNotify Flag to turn on or off concurrent listener notification.
-     */
-    public void concurrentNotify(boolean concurNotify);
-
-    /**
-     * Gets value concurrent listener notification flag. This flag comes into play only
-     * when a future has more than one listener subscribed to it. If this flag is {@code true},
-     * then all listeners will be notified concurrently by different threads; otherwise,
-     * listeners will be notified one after another within one thread (depending on
-     * {@link #syncNotify()} flag, these notifications may happen either in the same thread which
-     * started the future, or in a different thread).
-     * <p>
-     * Default value is {@code false}. To change the default, set
-     * {@link IgniteSystemProperties#IGNITE_FUT_CONCURRENT_NOTIFICATION} system property to {@code true}.
-     *
-     * @return Concurrent listener notification flag
-     */
-    public boolean concurrentNotify();
-
-    /**
      * Registers listener closure to be asynchronously notified whenever future completes.
      *
      * @param lsnr Listener closure to register. If not provided - this method is no-op.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
index c79fed8..e42e186 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
@@ -319,7 +319,7 @@ public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClus
             return startNodesAsync(t.get1(), t.get2(), restart, timeout, maxConn);
         }
         catch (IgniteCheckedException e) {
-            return new GridFinishedFuture<>(ctx, e);
+            return new GridFinishedFuture<>(e);
         }
     }
 
@@ -411,7 +411,7 @@ public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClus
             // If there is nothing to start, return finished future with empty result.
             if (nodeCallCnt == 0)
                 return new GridFinishedFuture<Collection<GridTuple3<String, Boolean, String>>>(
-                    ctx, Collections.<GridTuple3<String, Boolean, String>>emptyList());
+                    Collections.<GridTuple3<String, Boolean, String>>emptyList());
 
             // Exceeding max line width for readability.
             GridCompoundFuture<GridTuple3<String, Boolean, String>, Collection<GridTuple3<String, Boolean, String>>>
@@ -433,7 +433,7 @@ public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClus
             return fut;
         }
         catch (IgniteCheckedException e) {
-            return new GridFinishedFuture<>(ctx, e);
+            return new GridFinishedFuture<>(e);
         }
         finally {
             unguard();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 68f0a4a..5a1d822 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -149,7 +149,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
     private long segChkFreq;
 
     /** Local node join to topology event. */
-    private GridFutureAdapterEx<DiscoveryEvent> locJoinEvt = new GridFutureAdapterEx<>();
+    private GridFutureAdapter<DiscoveryEvent> locJoinEvt = new GridFutureAdapter<>();
 
     /** GC CPU load. */
     private volatile double gcCpuLoad;
@@ -923,7 +923,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
         long topVer = topologyVersion();
 
         if (topVer >= awaitVer)
-            return new GridFinishedFuture<>(ctx, topVer);
+            return new GridFinishedFuture<>(topVer);
 
         DiscoTopologyFuture fut = new DiscoTopologyFuture(ctx, awaitVer);
 
@@ -1653,6 +1653,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
         /** */
         private static final long serialVersionUID = 0L;
 
+        /** */
+        private GridKernalContext ctx;
+
         /** Topology await version. */
         private long awaitVer;
 
@@ -1666,8 +1669,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
          * @param awaitVer Await version.
          */
         private DiscoTopologyFuture(GridKernalContext ctx, long awaitVer) {
-            super(ctx);
-
+            this.ctx = ctx;
             this.awaitVer = awaitVer;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
index 82af8bf..39f266c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
@@ -663,7 +663,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
      */
     public <T extends Event> IgniteInternalFuture<T> waitForEvent(@Nullable final IgnitePredicate<T> p,
         @Nullable int... types) {
-        final GridFutureAdapter<T> fut = new GridFutureAdapter<>(ctx);
+        final GridFutureAdapter<T> fut = new GridFutureAdapter<>();
 
         addLocalEventListener(new GridLocalEventListener() {
             @Override public void onEvent(Event evt) {
@@ -691,7 +691,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
         @Nullable final IgnitePredicate<? super Event> p, int... types) throws IgniteCheckedException {
         assert timeout >= 0;
 
-        final GridFutureAdapter<Event> fut = new GridFutureAdapter<>(ctx);
+        final GridFutureAdapter<Event> fut = new GridFutureAdapter<>();
 
         addLocalEventListener(new GridLocalEventListener() {
             @Override public void onEvent(Event evt) {
@@ -765,7 +765,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
         assert p != null;
         assert nodes != null;
 
-        final GridFutureAdapter<List<T>> fut = new GridFutureAdapter<>(ctx);
+        final GridFutureAdapter<List<T>> fut = new GridFutureAdapter<>();
 
         ctx.closure().runLocalSafe(new GPR() {
             @Override public void run() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index 69795b1..ce7df9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -446,7 +446,7 @@ public class GridAffinityAssignmentCache {
          * @param ctx Kernal context.
          */
         private AffinityReadyFuture(GridKernalContext ctx, long reqTopVer) {
-            super(ctx);
+            super();
 
             this.reqTopVer = reqTopVer;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
index d7d0391..50221c1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
@@ -306,7 +306,7 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
                 new GridAffinityAssignment(topVer, cctx.affinity().assignments(topVer)),
                 cctx.portableEnabled());
 
-            IgniteInternalFuture<AffinityInfo> old = affMap.putIfAbsent(key, new GridFinishedFuture<>(ctx, info));
+            IgniteInternalFuture<AffinityInfo> old = affMap.putIfAbsent(key, new GridFinishedFuture<>(info));
 
             if (old != null)
                 info = old.get();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/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 12ea535..95cc4a4 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
@@ -1592,7 +1592,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
             });
         }
         else
-            return new GridFinishedFuture<>(ctx.kernalContext());
+            return new GridFinishedFuture<>();
     }
 
     /** {@inheritDoc} */
@@ -1908,7 +1908,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
             });
         }
 
-        return new GridFinishedFuture<>(ctx.kernalContext(), Collections.<K, V>emptyMap());
+        return new GridFinishedFuture<>(Collections.<K, V>emptyMap());
     }
 
     /**
@@ -2107,7 +2107,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
         assert ctx.portableEnabled() || cached == null || F.first(keys).equals(cached.key());
 
         if (F.isEmpty(keys))
-            return new GridFinishedFuture<>(ctx.kernalContext(), Collections.<K, V>emptyMap());
+            return new GridFinishedFuture<>(Collections.<K, V>emptyMap());
 
         if (keyCheck)
             validateCacheKeys(keys);
@@ -2119,7 +2119,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                 checkJta();
             }
             catch (IgniteCheckedException e) {
-                return new GridFinishedFuture<>(ctx.kernalContext(), e);
+                return new GridFinishedFuture<>(e);
             }
 
             tx = ctx.tm().threadLocalTx();
@@ -2189,7 +2189,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
 
                                 if (keys.size() == 1)
                                     // Safe to return because no locks are required in READ_COMMITTED mode.
-                                    return new GridFinishedFuture<>(ctx.kernalContext(), map);
+                                    return new GridFinishedFuture<>(map);
                             }
 
                             break;
@@ -2218,7 +2218,6 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                     final Collection<K> loaded = new HashSet<>();
 
                     return new GridEmbeddedFuture<>(
-                        ctx.kernalContext(),
                         ctx.closures().callLocalSafe(ctx.projectSafe(new GPC<Map<K, V>>() {
                             @Override public Map<K, V> call() throws Exception {
                                 ctx.store().loadAllFromStore(null/*tx*/, loadKeys.keySet(), new CI2<K, V>() {
@@ -2297,7 +2296,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                         new C2<Map<K, V>, Exception, IgniteInternalFuture<Map<K, V>>>() {
                             @Override public IgniteInternalFuture<Map<K, V>> apply(Map<K, V> map, Exception e) {
                                 if (e != null)
-                                    return new GridFinishedFuture<>(ctx.kernalContext(), e);
+                                    return new GridFinishedFuture<>(e);
 
                                 if (tx0 == null || (!tx0.implicit() && tx0.isolation() == READ_COMMITTED)) {
                                     Collection<K> notFound = new HashSet<>(loadKeys.keySet());
@@ -2314,7 +2313,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                                 }
 
                                 // There were no misses.
-                                return new GridFinishedFuture<>(ctx.kernalContext(), Collections.<K,
+                                return new GridFinishedFuture<>(Collections.<K,
                                     V>emptyMap());
                             }
                         },
@@ -2340,10 +2339,10 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                     }
                 }
 
-                return new GridFinishedFuture<>(ctx.kernalContext(), map);
+                return new GridFinishedFuture<>(map);
             }
             catch (IgniteCheckedException e) {
-                return new GridFinishedFuture<>(ctx.kernalContext(), e);
+                return new GridFinishedFuture<>(e);
             }
         }
         else {
@@ -2518,7 +2517,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
     @Override public IgniteInternalFuture<?> putAllConflictAsync(final Map<? extends K, GridCacheDrInfo<V>> drMap)
         throws IgniteCheckedException {
         if (F.isEmpty(drMap))
-            return new GridFinishedFuture<Object>(ctx.kernalContext());
+            return new GridFinishedFuture<Object>();
 
         ctx.dr().onReceiveCacheEntriesReceived(drMap.size());
 
@@ -3064,7 +3063,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                         ctx.deploy().registerClass(oldVal);
                     }
                     catch (IgniteCheckedException e) {
-                        return new GridFinishedFuture<>(ctx.kernalContext(), e);
+                        return new GridFinishedFuture<>(e);
                     }
                 }
 
@@ -3123,7 +3122,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
     @Override public IgniteInternalFuture<?> putAllAsync(final Map<? extends K, ? extends V> m,
         @Nullable final IgnitePredicate<Cache.Entry<K, V>>... filter) {
         if (F.isEmpty(m))
-            return new GridFinishedFuture<Object>(ctx.kernalContext());
+            return new GridFinishedFuture<Object>();
 
         if (keyCheck)
             validateCacheKeys(m.keySet());
@@ -3280,7 +3279,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
         final long start = statsEnabled ? System.nanoTime() : 0L;
 
         if (F.isEmpty(keys))
-            return new GridFinishedFuture<Object>(ctx.kernalContext());
+            return new GridFinishedFuture<Object>();
 
         if (keyCheck)
             validateCacheKeys(keys);
@@ -3438,7 +3437,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
         ctx.denyOnLocalRead();
 
         if (F.isEmpty(drMap))
-            return new GridFinishedFuture<Object>(ctx.kernalContext());
+            return new GridFinishedFuture<Object>();
 
         ctx.dr().onReceiveCacheEntriesReceived(drMap.size());
 
@@ -3494,7 +3493,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                         ctx.deploy().registerClass(val);
                 }
                 catch (IgniteCheckedException e) {
-                    return new GridFinishedFuture<>(ctx.kernalContext(), e);
+                    return new GridFinishedFuture<>(e);
                 }
 
                 return tx.removeAllAsync(ctx, Collections.singletonList(key), null, true,
@@ -3524,7 +3523,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                         ctx.deploy().registerClass(oldVal);
                 }
                 catch (IgniteCheckedException e) {
-                    return new GridFinishedFuture<>(ctx.kernalContext(), e);
+                    return new GridFinishedFuture<>(e);
                 }
 
                 return tx.putAllAsync(ctx, F.t(key, newVal), true, null, -1, ctx.equalsPeekArray(oldVal));
@@ -3603,7 +3602,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                         ctx.deploy().registerClass(val);
                     }
                     catch (IgniteCheckedException e) {
-                        return new GridFinishedFuture<>(ctx.kernalContext(), e);
+                        return new GridFinishedFuture<>(e);
                     }
                 }
 
@@ -3616,7 +3615,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                         val0 = (V)ctx.marshalToPortable(val);
                     }
                     catch (IgniteException e) {
-                        return new GridFinishedFuture<>(ctx.kernalContext(), e);
+                        return new GridFinishedFuture<>(e);
                     }
                 }
 
@@ -3985,7 +3984,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
             A.notNull(key, "key");
 
         if (!ctx.store().configured())
-            return new GridFinishedFuture<>(ctx.kernalContext());
+            return new GridFinishedFuture<>();
 
         GridCacheProjectionImpl<K, V> prj = ctx.projectionPerCall();
 
@@ -4008,7 +4007,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                 Collection<ClusterNode> nodes = ctx.grid().cluster().forDataNodes(name()).nodes();
 
                 if (nodes.isEmpty())
-                    return new GridFinishedFuture<>(ctx.kernalContext());
+                    return new GridFinishedFuture<>();
 
                 return ctx.closures().callAsyncNoFailover(BROADCAST,
                     new LoadKeysCallable<>(ctx.name(), keys0, true, plc),
@@ -4029,7 +4028,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
             Collection<ClusterNode> nodes = ctx.grid().cluster().forDataNodes(name()).nodes();
 
             if (nodes.isEmpty())
-                return new GridFinishedFuture<>(ctx.kernalContext());
+                return new GridFinishedFuture<>();
 
             return ctx.closures().callAsyncNoFailover(BROADCAST,
                 new LoadKeysCallable<>(ctx.name(), keys, false, plc),
@@ -4176,7 +4175,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
         Collection<ClusterNode> nodes = grp.nodes();
 
         if (nodes.isEmpty())
-            return new GridFinishedFuture<>(ctx.kernalContext(), 0);
+            return new GridFinishedFuture<>(0);
 
         IgniteInternalFuture<Collection<Integer>> fut =
             ctx.closures().broadcastNoFailover(new SizeCallable(ctx.name(), peekModes), null, nodes);
@@ -4450,7 +4449,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                         @Override public IgniteInternalFuture<IgniteInternalTx> apply(Object o, Exception e) {
                             return tx.commitAsync();
                         }
-                    }, ctx.kernalContext());
+                    });
 
                 saveFuture(holder, f);
 
@@ -4617,7 +4616,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
             checkJta();
         }
         catch (IgniteCheckedException e) {
-            return new GridFinishedFuture<>(ctx.kernalContext(), e);
+            return new GridFinishedFuture<>(e);
         }
 
         if (log.isDebugEnabled())
@@ -4685,7 +4684,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
                                 }
                             });
                         }
-                    }, ctx.kernalContext());
+                    });
 
                 saveFuture(holder, f);
 
@@ -4771,7 +4770,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
         catch (InterruptedException e) {
             Thread.currentThread().interrupt();
 
-            return new GridFinishedFutureEx<>(new IgniteInterruptedCheckedException("Failed to wait for asynchronous " +
+            return new GridFinishedFuture<>(new IgniteInterruptedCheckedException("Failed to wait for asynchronous " +
                 "operation permit (thread got interrupted).", e));
         }
     }
@@ -5114,7 +5113,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
             checkJta();
         }
         catch (IgniteCheckedException e) {
-            return new GridFinishedFuture<>(ctx.kernalContext(), e);
+            return new GridFinishedFuture<>(e);
         }
 
         return getAllAsync(Collections.singletonList(key), deserializePortable).chain(

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
index d3510e4..3f7872f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
@@ -108,7 +108,7 @@ public class GridCacheAffinityManager<K, V> extends GridCacheManagerAdapter<K, V
 
         IgniteInternalFuture<Long> fut = aff.readyFuture(topVer);
 
-        return fut != null ? fut : new GridFinishedFutureEx<>(topVer);
+        return fut != null ? fut : new GridFinishedFuture<>(topVer);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 382eb61..8a642f3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -1568,7 +1568,7 @@ public class GridCacheEvictionManager<K, V> extends GridCacheManagerAdapter<K, V
          * @param ctx Context.
          */
         EvictionFuture(GridKernalContext ctx) {
-            super(ctx);
+            super();
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMultiTxFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMultiTxFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMultiTxFuture.java
index 287a0db..c6829aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMultiTxFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMultiTxFuture.java
@@ -52,12 +52,9 @@ public final class GridCacheMultiTxFuture<K, V> extends GridFutureAdapter<Boolea
      * @param cctx Cache context.
      */
     public GridCacheMultiTxFuture(GridCacheContext<K, V> cctx) {
-        super(cctx.kernalContext());
+        super();
 
-        log = U.logger(ctx,  logRef, GridCacheMultiTxFuture.class);
-
-        // Notify listeners in different threads.
-        concurrentNotify(true);
+        log = U.logger(cctx.kernalContext(),  logRef, GridCacheMultiTxFuture.class);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
index d125c02..5190c7e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
@@ -994,7 +994,7 @@ public class GridCacheMvccManager<K, V> extends GridCacheSharedManagerAdapter<K,
         assert topVer != 0;
 
         if (topVer < 0)
-            return new GridFinishedFuture(context().kernalContext());
+            return new GridFinishedFuture();
 
         final FinishLockFuture finishFut = new FinishLockFuture(
             keyFilter == null ?
@@ -1066,7 +1066,7 @@ public class GridCacheMvccManager<K, V> extends GridCacheSharedManagerAdapter<K,
          * @param entries Entries.
          */
         FinishLockFuture(Iterable<GridDistributedCacheEntry<K, V>> entries, long topVer) {
-            super(cctx.kernalContext(), true);
+            super();
 
             assert topVer > 0;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index d7b1914..2b672d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -160,7 +160,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
     @Override protected void start0() throws IgniteCheckedException {
         super.start0();
 
-        locExchFut = new GridFutureAdapter<>(cctx.kernalContext());
+        locExchFut = new GridFutureAdapter<>();
 
         exchWorker = new ExchangeWorker();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
index 40e090b..c863e75 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
@@ -57,7 +57,7 @@ public class GridCachePreloaderAdapter<K, V> implements GridCachePreloader<K, V>
         log = cctx.logger(getClass());
         aff = cctx.config().getAffinity();
 
-        finFut = new GridFinishedFuture(cctx.kernalContext());
+        finFut = new GridFinishedFuture();
     }
 
     /** {@inheritDoc} */
@@ -112,7 +112,7 @@ public class GridCachePreloaderAdapter<K, V> implements GridCachePreloader<K, V>
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<Object> request(Collection<? extends K> keys, long topVer) {
-        return new GridFinishedFuture<>(cctx.kernalContext());
+        return new GridFinishedFuture<>();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
index c8187f4..20e3c3b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProjectionImpl.java
@@ -776,7 +776,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
 
         // Check k-v predicate first.
         if (!isAll(key, val, true))
-            return new GridFinishedFuture<>(cctx.kernalContext());
+            return new GridFinishedFuture<>();
 
         return cache.putAsync(key, val, entry, ttl, and(filter, false));
     }
@@ -858,7 +858,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
 
         // Check k-v predicate first.
         if (!isAll(key, val, true))
-            return new GridFinishedFuture<>(cctx.kernalContext(), false);
+            return new GridFinishedFuture<>(false);
 
         return cache.putxAsync(key, val, entry, ttl, and(filter, false));
     }
@@ -927,7 +927,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
         m = isAll(m, true);
 
         if (F.isEmpty(m))
-            return new GridFinishedFuture<>(cctx.kernalContext());
+            return new GridFinishedFuture<>();
 
         return cache.putAllAsync(m, and(filter, false));
     }
@@ -1169,7 +1169,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
 
         // Check k-v predicate first.
         if (!isAll(key, newVal, true))
-            return new GridFinishedFuture<>(cctx.kernalContext(), new GridCacheReturn<V>(false));
+            return new GridFinishedFuture<>(new GridCacheReturn<V>(false));
 
         return cache.replacexAsync(key, oldVal, newVal);
     }
@@ -1186,7 +1186,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<GridCacheReturn<V>> removexAsync(K key, V val) {
-        return !isAll(key, val, true) ? new GridFinishedFuture<>(cctx.kernalContext(),
+        return !isAll(key, val, true) ? new GridFinishedFuture<>(
             new GridCacheReturn<V>(false)) : cache.removexAsync(key, val);
     }
 
@@ -1197,7 +1197,7 @@ public class GridCacheProjectionImpl<K, V> implements GridCacheProjectionEx<K, V
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<Boolean> removeAsync(K key, V val) {
-        return !isAll(key, val, true) ? new GridFinishedFuture<>(cctx.kernalContext(), false) :
+        return !isAll(key, val, true) ? new GridFinishedFuture<>(false) :
             cache.removeAsync(key, val);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java
index 75b2683..759474c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxFuture.java
@@ -86,7 +86,7 @@ public class GridCacheOptimisticCheckPreparedTxFuture<K, V> extends GridCompound
         this.txNodes = txNodes;
         this.failedNodeId = failedNodeId;
 
-        log = U.logger(ctx, logRef, GridCacheOptimisticCheckPreparedTxFuture.class);
+        log = U.logger(cctx.kernalContext(), logRef, GridCacheOptimisticCheckPreparedTxFuture.class);
 
         nodes = new GridLeanMap<>();
 
@@ -338,7 +338,7 @@ public class GridCacheOptimisticCheckPreparedTxFuture<K, V> extends GridCompound
          * @param nodeId Node ID.
          */
         private MiniFuture(UUID nodeId) {
-            super(cctx.kernalContext());
+            super();
 
             this.nodeId = nodeId;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java
index 93247c6..f7f91b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java
@@ -239,7 +239,7 @@ public class GridCacheTxFinishSync<K, V> {
                     return null;
 
                 if (nodeLeft)
-                    return new GridFinishedFutureEx<>(new IgniteCheckedException("Failed to wait for finish synchronizer " +
+                    return new GridFinishedFuture<>(new IgniteCheckedException("Failed to wait for finish synchronizer " +
                         "state (node left grid): " + nodeId));
 
                 if (pendingFut == null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
index 00190d9..10396d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
@@ -160,7 +160,7 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter
 
     /** {@inheritDoc} */
     @Override public IgniteInternalFuture<?> removeAllAsync() {
-        GridFutureAdapter<Void> opFut = new GridFutureAdapter<>(ctx.kernalContext());
+        GridFutureAdapter<Void> opFut = new GridFutureAdapter<>();
 
         long topVer = ctx.affinity().affinityTopologyVersion();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index dbf82dd..52c50df 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -723,10 +723,10 @@ public class GridDistributedTxRemoteAdapter<K, V> extends IgniteTxAdapter<K, V>
         try {
             commit();
 
-            return new GridFinishedFutureEx<IgniteInternalTx>(this);
+            return new GridFinishedFuture<IgniteInternalTx>(this);
         }
         catch (IgniteCheckedException e) {
-            return new GridFinishedFutureEx<>(e);
+            return new GridFinishedFuture<>(e);
         }
     }
 
@@ -753,7 +753,7 @@ public class GridDistributedTxRemoteAdapter<K, V> extends IgniteTxAdapter<K, V>
     @Override public IgniteInternalFuture<IgniteInternalTx> rollbackAsync() {
         rollback();
 
-        return new GridFinishedFutureEx<IgniteInternalTx>(this);
+        return new GridFinishedFuture<IgniteInternalTx>(this);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java
index 101d657..bd4b264 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAssignmentFetchFuture.java
@@ -28,6 +28,7 @@ import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
 
 import java.util.*;
+import java.util.concurrent.atomic.*;
 
 import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
 
@@ -41,9 +42,15 @@ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<L
     /** Nodes order comparator. */
     private static final Comparator<ClusterNode> CMP = new GridNodeOrderComparator();
 
+    /** Logger reference. */
+    private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
+
     /** Cache context. */
     private final GridCacheContext<K, V> ctx;
 
+    /** Logger. */
+    private IgniteLogger log;
+
     /** List of available nodes this future can fetch data from. */
     private Queue<ClusterNode> availableNodes;
 
@@ -57,11 +64,14 @@ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<L
      * @param ctx Cache context.
      * @param availableNodes Available nodes.
      */
-    public GridDhtAssignmentFetchFuture(GridCacheContext<K, V> ctx, long topVer, Collection<ClusterNode> availableNodes) {
-        super(ctx.kernalContext());
+    public GridDhtAssignmentFetchFuture(
+        GridCacheContext<K, V> ctx,
+        long topVer,
+        Collection<ClusterNode> availableNodes
+    ) {
+        super();
 
         this.ctx = ctx;
-
         this.topVer = topVer;
 
         LinkedList<ClusterNode> tmp = new LinkedList<>();
@@ -69,6 +79,8 @@ public class GridDhtAssignmentFetchFuture<K, V> extends GridFutureAdapter<List<L
         Collections.sort(tmp, CMP);
 
         this.availableNodes = tmp;
+
+        log = U.logger(ctx.kernalContext(), logRef, GridDhtAssignmentFetchFuture.class);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 2ef157c..365b884 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -1095,7 +1095,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
          * @param topVer Topology version.
          */
         private MultiUpdateFuture(GridKernalContext ctx, long topVer) {
-            super(ctx);
+            super();
 
             this.topVer = topVer;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
index c331b99..608678b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheEntry.java
@@ -449,10 +449,14 @@ public class GridDhtCacheEntry<K, V> extends GridDistributedCacheEntry<K, V> {
 
                 txFut.listenAsync(new CI1<IgniteInternalFuture<?>>() {
                     @Override public void apply(IgniteInternalFuture<?> f) {
-                        synchronized (this) {
-                            // Release memory.
-                            reader0.resetTxFuture();
-                        }
+                        cctx.kernalContext().closure().runLocalSafe(new Runnable() {
+                            @Override public void run() {
+                                synchronized (this) {
+                                    // Release memory.
+                                    reader0.resetTxFuture();
+                                }
+                            }
+                        });
                     }
                 });
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java
index 81095e2..6749491 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtEmbeddedFuture.java
@@ -45,12 +45,12 @@ public class GridDhtEmbeddedFuture<A, B> extends GridEmbeddedFuture<A, B> implem
     }
 
     /**
-     * @param ctx Context.
      * @param embedded Embedded.
      * @param c Closure.
+     * @param fake Fake.
      */
-    public GridDhtEmbeddedFuture(GridKernalContext ctx, IgniteInternalFuture<B> embedded, IgniteBiClosure<B, Exception, A> c) {
-        super(ctx, embedded, c);
+    public GridDhtEmbeddedFuture(IgniteInternalFuture<B> embedded, IgniteBiClosure<B, Exception, A> c, boolean fake) {
+        super(embedded, c, fake);
 
         invalidParts = Collections.emptyList();
     }
@@ -58,28 +58,14 @@ public class GridDhtEmbeddedFuture<A, B> extends GridEmbeddedFuture<A, B> implem
     /**
      * @param embedded Future to embed.
      * @param c Embedding closure.
-     * @param ctx Kernal context.
      */
     public GridDhtEmbeddedFuture(IgniteInternalFuture<B> embedded,
-        IgniteBiClosure<B, Exception, IgniteInternalFuture<A>> c, GridKernalContext ctx) {
-        super(embedded, c, ctx);
+        IgniteBiClosure<B, Exception, IgniteInternalFuture<A>> c) {
+        super(embedded, c);
 
         invalidParts = Collections.emptyList();
     }
 
-    /**
-     * @param ctx Context.
-     * @param embedded Embedded.
-     * @param c Closure.
-     * @param invalidParts Retries.
-     */
-    public GridDhtEmbeddedFuture(GridKernalContext ctx, IgniteInternalFuture<B> embedded, IgniteBiClosure<B, Exception, A> c,
-        Collection<Integer> invalidParts) {
-        super(ctx, embedded, c);
-
-        this.invalidParts = invalidParts;
-    }
-
     /** {@inheritDoc} */
     @Override public Collection<Integer> invalidPartitions() {
         return invalidParts;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java
index ed6c3b5..c66336d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtFinishedFuture.java
@@ -43,7 +43,7 @@ public class GridDhtFinishedFuture<T> extends GridFinishedFuture<T> implements G
      * @param t Result.
      */
     public GridDhtFinishedFuture(GridKernalContext ctx, T t) {
-        super(ctx, t);
+        super(t);
     }
 
     /**
@@ -51,7 +51,7 @@ public class GridDhtFinishedFuture<T> extends GridFinishedFuture<T> implements G
      * @param err Error.
      */
     public GridDhtFinishedFuture(GridKernalContext ctx, Throwable err) {
-        super(ctx, err);
+        super(err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
index 0be5b97..c594d36 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
@@ -159,9 +159,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
 
         ver = tx == null ? cctx.versions().next() : tx.xidVersion();
 
-        log = U.logger(ctx, logRef, GridDhtGetFuture.class);
-
-        syncNotify(true);
+        log = U.logger(cctx.kernalContext(), logRef, GridDhtGetFuture.class);
     }
 
     /**
@@ -221,7 +219,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
         if (!F.isEmpty(fut.invalidPartitions()))
             retries.addAll(fut.invalidPartitions());
 
-        add(new GridEmbeddedFuture<>(cctx.kernalContext(), fut,
+        add(new GridEmbeddedFuture<>(fut,
             new IgniteBiClosure<Object, Exception, Collection<GridCacheEntryInfo<K, V>>>() {
                 @Override public Collection<GridCacheEntryInfo<K, V>> apply(Object o, Exception e) {
                     if (e != null) { // Check error first.
@@ -251,7 +249,8 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
                     // Finish this one.
                     return Collections.emptyList();
                 }
-            })
+            },
+            false)
         );
     }
 
@@ -289,15 +288,15 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
     @SuppressWarnings( {"unchecked", "IfMayBeConditional"})
     private IgniteInternalFuture<Collection<GridCacheEntryInfo<K, V>>> getAsync(final LinkedHashMap<? extends K, Boolean> keys) {
         if (F.isEmpty(keys))
-            return new GridFinishedFuture<Collection<GridCacheEntryInfo<K, V>>>(cctx.kernalContext(),
+            return new GridFinishedFuture<Collection<GridCacheEntryInfo<K, V>>>(
                 Collections.<GridCacheEntryInfo<K, V>>emptyList());
 
         final Collection<GridCacheEntryInfo<K, V>> infos = new LinkedList<>();
 
-        String taskName0 = ctx.job().currentTaskName();
+        String taskName0 = cctx.kernalContext().job().currentTaskName();
 
         if (taskName0 == null)
-            taskName0 = ctx.task().resolveTaskName(taskNameHash);
+            taskName0 = cctx.kernalContext().task().resolveTaskName(taskNameHash);
 
         final String taskName = taskName0;
 
@@ -414,11 +413,12 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
                             }
                         }
                     }
-                },
-                cctx.kernalContext());
+                }
+            );
         }
 
-        return new GridEmbeddedFuture<>(cctx.kernalContext(), fut,
+        return new GridEmbeddedFuture<>(
+            fut,
             new C2<Map<K, V>, Exception, Collection<GridCacheEntryInfo<K, V>>>() {
                 @Override public Collection<GridCacheEntryInfo<K, V>> apply(Map<K, V> map, Exception e) {
                     if (e != null) {
@@ -441,7 +441,8 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
                         return infos;
                     }
                 }
-            });
+            },
+            false);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 29f7363..e77916e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -102,7 +102,7 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
 
         log = U.logger(cctx.kernalContext(), logRef, this);
 
-        rent = new GridFutureAdapter<Object>(cctx.kernalContext()) {
+        rent = new GridFutureAdapter<Object>() {
             @Override public String toString() {
                 return "PartitionRentFuture [part=" + GridDhtLocalPartition.this + ", map=" + map + ']';
             }
@@ -437,7 +437,7 @@ public class GridDhtLocalPartition<K, V> implements Comparable<GridDhtLocalParti
 
             clearDeferredDeletes();
 
-            return new GridFinishedFuture<>(cctx.kernalContext(), true);
+            return new GridFinishedFuture<>(true);
         }
 
         return cctx.closures().callLocalSafe(new GPC<Boolean>() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index dba5ed2..ad5923c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -198,7 +198,7 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo
 
         entries = new ArrayList<>(cnt);
 
-        log = U.logger(ctx, logRef, GridDhtLockFuture.class);
+        log = U.logger(cctx.kernalContext(), logRef, GridDhtLockFuture.class);
 
         if (timeout > 0) {
             timeoutObj = new LockTimeoutObject();
@@ -797,7 +797,7 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo
                 int cnt = F.size(dhtMapping);
 
                 if (cnt > 0) {
-                    assert !n.id().equals(ctx.localNodeId());
+                    assert !n.id().equals(cctx.localNodeId());
 
                     MiniFuture fut = new MiniFuture(n, dhtMapping);
 
@@ -991,7 +991,7 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo
          * @param dhtMapping Mapping.
          */
         MiniFuture(ClusterNode node, List<GridDhtCacheEntry<K, V>> dhtMapping) {
-            super(cctx.kernalContext());
+            super();
 
             assert node != null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 753f7e9..9057319 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -684,9 +684,9 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
         }
 
         if (keyFut == null)
-            keyFut = new GridFinishedFutureEx<>();
+            keyFut = new GridFinishedFuture<>();
 
-        return new GridEmbeddedFuture<>(true, keyFut,
+        return new GridEmbeddedFuture<>(keyFut,
             new C2<Object, Exception, IgniteInternalFuture<GridNearLockResponse<K,V>>>() {
                 @Override public IgniteInternalFuture<GridNearLockResponse<K, V>> apply(Object o, Exception exx) {
                     if (exx != null)
@@ -877,11 +877,11 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                                         else {
                                             sendLockReply(nearNode, t, req, resp);
 
-                                            return new GridFinishedFutureEx<>(resp);
+                                            return new GridFinishedFuture<>(resp);
                                         }
                                     }
-                                },
-                                ctx.kernalContext());
+                                }
+                            );
                         }
                         else {
                             assert fut != null;
@@ -892,7 +892,6 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                             final GridCacheVersion mappedVer = fut.version();
 
                             return new GridDhtEmbeddedFuture<>(
-                                ctx.kernalContext(),
                                 fut,
                                 new C2<Boolean, Exception, GridNearLockResponse<K, V>>() {
                                     @Override public GridNearLockResponse<K, V> apply(Boolean b, Exception e) {
@@ -912,7 +911,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
 
                                         return res;
                                     }
-                                });
+                                }, false);
                         }
                     }
                     catch (IgniteCheckedException e) {
@@ -933,8 +932,8 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                             new IgniteCheckedException(err, e));
                     }
                 }
-            },
-            ctx.kernalContext());
+            }
+        );
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 7dac17b..41f235a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -26,11 +26,11 @@ import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.internal.processors.cache.transactions.*;
 import org.apache.ignite.internal.processors.cache.version.*;
 import org.apache.ignite.internal.transactions.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.internal.util.future.*;
 import org.apache.ignite.internal.util.tostring.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
 
 import java.io.*;
@@ -103,7 +103,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
 
         futId = IgniteUuid.randomUuid();
 
-        log = U.logger(ctx, logRef, GridDhtTxFinishFuture.class);
+        log = U.logger(cctx.kernalContext(), logRef, GridDhtTxFinishFuture.class);
     }
 
     /** {@inheritDoc} */
@@ -441,7 +441,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
          * @param nearMapping nearMapping.
          */
         MiniFuture(GridDistributedTxMapping<K, V> dhtMapping, GridDistributedTxMapping<K, V> nearMapping) {
-            super(cctx.kernalContext());
+            super();
 
             assert dhtMapping == null || nearMapping == null || dhtMapping.node() == nearMapping.node();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index 1c71f12..b98ca00 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -500,7 +500,7 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends IgniteTxLocalAdapter<K
         catch (GridDhtInvalidPartitionException ex) {
             addInvalidPartition(cacheCtx, ex.partition());
 
-            return new GridFinishedFuture<>(cctx.kernalContext(), true);
+            return new GridFinishedFuture<>(true);
         }
     }
 
@@ -526,13 +526,13 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends IgniteTxLocalAdapter<K
             checkValid();
         }
         catch (IgniteCheckedException e) {
-            return new GridFinishedFuture<>(cctx.kernalContext(), e);
+            return new GridFinishedFuture<>(e);
         }
 
         final GridCacheReturn<V> ret = new GridCacheReturn<>(false);
 
         if (F.isEmpty(entries))
-            return new GridFinishedFuture<>(cctx.kernalContext(), ret);
+            return new GridFinishedFuture<>(ret);
 
         init();
 
@@ -606,7 +606,7 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends IgniteTxLocalAdapter<K
         catch (IgniteCheckedException e) {
             setRollbackOnly();
 
-            return new GridFinishedFuture<>(cctx.kernalContext(), e);
+            return new GridFinishedFuture<>(e);
         }
     }
 
@@ -633,7 +633,7 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends IgniteTxLocalAdapter<K
                 skipped + ']');
 
         if (passedKeys.isEmpty())
-            return new GridFinishedFuture<>(cctx.kernalContext(), ret);
+            return new GridFinishedFuture<>(ret);
 
         GridDhtTransactionalCacheAdapter<K, V> dhtCache = cacheCtx.isNear() ? cacheCtx.nearTx().dht() : cacheCtx.dhtTx();
 
@@ -667,8 +667,8 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends IgniteTxLocalAdapter<K
 
                     return ret;
                 }
-            },
-            cctx.kernalContext());
+            }
+        );
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/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 e3cdc6e..58338a8 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
@@ -128,13 +128,6 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
     private IgniteInClosure<GridNearTxPrepareResponse<K, V>> completeCb;
 
     /**
-     * Empty constructor required for {@link Externalizable}.
-     */
-    public GridDhtTxPrepareFuture() {
-        // No-op.
-    }
-
-    /**
      * @param cctx Context.
      * @param tx Transaction.
      * @param nearMiniId Near mini future id.
@@ -173,7 +166,7 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
 
         this.nearMiniId = nearMiniId;
 
-        log = U.logger(ctx, logRef, GridDhtTxPrepareFuture.class);
+        log = U.logger(cctx.kernalContext(), logRef, GridDhtTxPrepareFuture.class);
 
         dhtMap = tx.dhtMap();
         nearMap = tx.nearMap();
@@ -1133,7 +1126,7 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
          * Empty constructor required for {@link Externalizable}.
          */
         public MiniFuture() {
-            super(cctx.kernalContext());
+            super();
         }
 
         /**
@@ -1142,7 +1135,7 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
          * @param nearMapping nearMapping.
          */
         MiniFuture(UUID nodeId, GridDistributedTxMapping<K, V> dhtMapping, GridDistributedTxMapping<K, V> nearMapping) {
-            super(cctx.kernalContext());
+            super();
 
             assert dhtMapping == null || nearMapping == null || dhtMapping.node() == nearMapping.node();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1b46951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index 980389c..511b3c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@ -158,7 +158,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
 
         ver = cctx.versions().next();
 
-        log = U.logger(ctx, logRef, GridPartitionedGetFuture.class);
+        log = U.logger(cctx.kernalContext(), logRef, GridPartitionedGetFuture.class);
     }
 
     /**
@@ -306,7 +306,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
             return;
 
         if (!locVals.isEmpty())
-            add(new GridFinishedFuture<>(cctx.kernalContext(), locVals));
+            add(new GridFinishedFuture<>(locVals));
 
         if (hasRmtNodes) {
             trackable = true;
@@ -347,7 +347,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
                             remapKeys.add(key);
                     }
 
-                    long updTopVer = ctx.discovery().topologyVersion();
+                    long updTopVer = cctx.discovery().topologyVersion();
 
                     assert updTopVer > topVer : "Got invalid partitions for local node but topology version did " +
                         "not change [topVer=" + topVer + ", updTopVer=" + updTopVer +
@@ -604,7 +604,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
          * @param topVer Topology version.
          */
         MiniFuture(ClusterNode node, LinkedHashMap<K, Boolean> keys, long topVer) {
-            super(cctx.kernalContext());
+            super();
 
             this.node = node;
             this.keys = keys;
@@ -651,7 +651,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
             if (log.isDebugEnabled())
                 log.debug("Remote node left grid while sending or waiting for reply (will retry): " + this);
 
-            long updTopVer = ctx.discovery().topologyVersion();
+            long updTopVer = cctx.discovery().topologyVersion();
 
             assert updTopVer > topVer : "Got topology exception but topology version did " +
                 "not change [topVer=" + topVer + ", updTopVer=" + updTopVer +
@@ -697,7 +697,7 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
                     log.debug("Remapping mini get future [invalidParts=" + invalidParts + ", fut=" + this + ']');
 
                 // Need to wait for next topology version to remap.
-                IgniteInternalFuture<Long> topFut = ctx.discovery().topologyFuture(rmtTopVer);
+                IgniteInternalFuture<Long> topFut = cctx.discovery().topologyFuture(rmtTopVer);
 
                 topFut.listenAsync(new CIX1<IgniteInternalFuture<Long>>() {
                     @SuppressWarnings("unchecked")


Mime
View raw message