You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/02/25 13:31:40 UTC

[41/51] [abbrv] ignite git commit: Review.

Review.


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

Branch: refs/heads/ignite-2523
Commit: c814ae3a421e6f2e6d8d754135d258777d65bfe5
Parents: 331c219
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Feb 25 15:10:57 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Feb 25 15:10:57 2016 +0300

----------------------------------------------------------------------
 .../dht/atomic/GridDhtAtomicCache.java          |  58 ++--
 .../GridDhtAtomicMultipleUpdateRequest.java     |   2 +-
 .../GridDhtAtomicMultipleUpdateResponse.java    |   2 +-
 .../GridDhtAtomicSingleUpdateRequest.java       |   2 +-
 .../GridDhtAtomicSingleUpdateResponse.java      |   2 +-
 .../dht/atomic/GridDhtAtomicUpdateFuture.java   |  28 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  | 271 -------------------
 .../GridDhtAtomicUpdateRequestInterface.java    | 271 +++++++++++++++++++
 .../dht/atomic/GridDhtAtomicUpdateResponse.java | 112 --------
 .../GridDhtAtomicUpdateResponseInterface.java   | 112 ++++++++
 .../GridNearAtomicMultipleUpdateRequest.java    |   8 +-
 .../GridNearAtomicMultipleUpdateResponse.java   |   2 +-
 .../GridNearAtomicSingleUpdateRequest.java      |   8 +-
 .../GridNearAtomicSingleUpdateResponse.java     |   2 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  38 +--
 .../dht/atomic/GridNearAtomicUpdateRequest.java | 207 --------------
 .../GridNearAtomicUpdateRequestInterface.java   | 207 ++++++++++++++
 .../atomic/GridNearAtomicUpdateResponse.java    | 211 ---------------
 .../GridNearAtomicUpdateResponseInterface.java  | 211 +++++++++++++++
 .../distributed/near/GridNearAtomicCache.java   |  16 +-
 .../IgniteClientReconnectCollectionsTest.java   |   4 +-
 ...niteCacheClientNodeChangingTopologyTest.java |   4 +-
 22 files changed, 889 insertions(+), 889 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index d1423f9..6965a9c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -141,7 +141,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         Integer.getInteger(IGNITE_ATOMIC_DEFERRED_ACK_TIMEOUT, 500);
 
     /** Update reply closure. */
-    private CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> updateReplyClos;
+    private CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface> updateReplyClos;
 
     /** Pending  */
     private ConcurrentMap<UUID, DeferredResponseBuffer> pendingResponses = new ConcurrentHashMap8<>();
@@ -194,9 +194,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
             }
         });
 
-        updateReplyClos = new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
+        updateReplyClos = new CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface>() {
             @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
-            @Override public void apply(GridNearAtomicUpdateRequest req, GridNearAtomicUpdateResponse res) {
+            @Override public void apply(GridNearAtomicUpdateRequestInterface req, GridNearAtomicUpdateResponseInterface res) {
                 if (ctx.config().getAtomicWriteOrderMode() == CLOCK) {
                     assert req.writeSynchronizationMode() != FULL_ASYNC : req;
 
@@ -1331,8 +1331,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      */
     public void updateAllAsyncInternal(
         final UUID nodeId,
-        final GridNearAtomicUpdateRequest req,
-        final CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> completionCb
+        final GridNearAtomicUpdateRequestInterface req,
+        final CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface> completionCb
     ) {
         IgniteInternalFuture<Object> forceFut = preldr.request(req.keys(), req.topologyVersion());
 
@@ -1356,10 +1356,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      */
     public void updateAllAsyncInternal0(
         UUID nodeId,
-        GridNearAtomicUpdateRequest req,
-        CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> completionCb
+        GridNearAtomicUpdateRequestInterface req,
+        CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface> completionCb
     ) {
-        GridNearAtomicUpdateResponse res;
+        GridNearAtomicUpdateResponseInterface res;
 
         if (req instanceof GridNearAtomicSingleUpdateRequest)
             res = new GridNearAtomicSingleUpdateResponse(ctx.cacheId(), nodeId, req.futureVersion(),
@@ -1588,12 +1588,12 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     private UpdateBatchResult updateWithBatch(
         ClusterNode node,
         boolean hasNear,
-        GridNearAtomicUpdateRequest req,
-        GridNearAtomicUpdateResponse res,
+        GridNearAtomicUpdateRequestInterface req,
+        GridNearAtomicUpdateResponseInterface res,
         List<GridDhtCacheEntry> locked,
         GridCacheVersion ver,
         @Nullable GridDhtAtomicUpdateFuture dhtFut,
-        CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> completionCb,
+        CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface> completionCb,
         boolean replicate,
         String taskName,
         @Nullable IgniteCacheExpiryPolicy expiry,
@@ -2004,12 +2004,12 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     private UpdateSingleResult updateSingle(
         ClusterNode node,
         boolean hasNear,
-        GridNearAtomicUpdateRequest req,
-        GridNearAtomicUpdateResponse res,
+        GridNearAtomicUpdateRequestInterface req,
+        GridNearAtomicUpdateResponseInterface res,
         List<GridDhtCacheEntry> locked,
         GridCacheVersion ver,
         @Nullable GridDhtAtomicUpdateFuture dhtFut,
-        CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> completionCb,
+        CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface> completionCb,
         boolean replicate,
         String taskName,
         @Nullable IgniteCacheExpiryPolicy expiry,
@@ -2266,9 +2266,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         @Nullable Collection<KeyCacheObject> rmvKeys,
         @Nullable Map<KeyCacheObject, EntryProcessor<Object, Object, Object>> entryProcessorMap,
         @Nullable GridDhtAtomicUpdateFuture dhtFut,
-        CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> completionCb,
-        final GridNearAtomicUpdateRequest req,
-        final GridNearAtomicUpdateResponse res,
+        CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface> completionCb,
+        final GridNearAtomicUpdateRequestInterface req,
+        final GridNearAtomicUpdateResponseInterface res,
         boolean replicate,
         UpdateBatchResult batchRes,
         String taskName,
@@ -2658,8 +2658,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      *      will return false.
      * @return {@code True} if filter evaluation succeeded.
      */
-    private boolean checkFilter(GridCacheEntryEx entry, GridNearAtomicUpdateRequest req,
-        GridNearAtomicUpdateResponse res) {
+    private boolean checkFilter(GridCacheEntryEx entry, GridNearAtomicUpdateRequestInterface req,
+        GridNearAtomicUpdateResponseInterface res) {
         try {
             return ctx.isAllLocked(entry, req.filter());
         }
@@ -2673,7 +2673,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     /**
      * @param req Request to remap.
      */
-    private void remapToNewPrimary(GridNearAtomicUpdateRequest req) {
+    private void remapToNewPrimary(GridNearAtomicUpdateRequestInterface req) {
         assert req.writeSynchronizationMode() == FULL_ASYNC : req;
 
         if (log.isDebugEnabled())
@@ -2752,9 +2752,9 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      */
     @Nullable private GridDhtAtomicUpdateFuture createDhtFuture(
         GridCacheVersion writeVer,
-        GridNearAtomicUpdateRequest updateReq,
-        GridNearAtomicUpdateResponse updateRes,
-        CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> completionCb,
+        GridNearAtomicUpdateRequestInterface updateReq,
+        GridNearAtomicUpdateResponseInterface updateRes,
+        CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface> completionCb,
         boolean force
     ) {
         if (!force) {
@@ -2785,7 +2785,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      * @param nodeId Sender node ID.
      * @param req Near atomic update request.
      */
-    private void processNearAtomicUpdateRequest(UUID nodeId, GridNearAtomicUpdateRequest req) {
+    private void processNearAtomicUpdateRequest(UUID nodeId, GridNearAtomicUpdateRequestInterface req) {
         if (log.isDebugEnabled())
             log.debug("Processing near atomic update request [nodeId=" + nodeId + ", req=" + req + ']');
 
@@ -2799,7 +2799,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      * @param res Near atomic update response.
      */
     @SuppressWarnings("unchecked")
-    private void processNearAtomicUpdateResponse(UUID nodeId, GridNearAtomicUpdateResponse res) {
+    private void processNearAtomicUpdateResponse(UUID nodeId, GridNearAtomicUpdateResponseInterface res) {
         if (log.isDebugEnabled())
             log.debug("Processing near atomic update response [nodeId=" + nodeId + ", res=" + res + ']');
 
@@ -2818,14 +2818,14 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      * @param nodeId Sender node ID.
      * @param req Dht atomic update request.
      */
-    private void processDhtAtomicUpdateRequest(UUID nodeId, GridDhtAtomicUpdateRequest req) {
+    private void processDhtAtomicUpdateRequest(UUID nodeId, GridDhtAtomicUpdateRequestInterface req) {
         if (log.isDebugEnabled())
             log.debug("Processing dht atomic update request [nodeId=" + nodeId + ", req=" + req + ']');
 
         GridCacheVersion ver = req.writeVersion();
 
         // Always send update reply.
-        GridDhtAtomicUpdateResponse res;
+        GridDhtAtomicUpdateResponseInterface res;
 
         if (req instanceof GridDhtAtomicSingleUpdateRequest)
             res = new GridDhtAtomicSingleUpdateResponse(ctx.cacheId(), req.futureVersion(),
@@ -2999,7 +2999,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      * @param res Dht atomic update response.
      */
     @SuppressWarnings("unchecked")
-    private void processDhtAtomicUpdateResponse(UUID nodeId, GridDhtAtomicUpdateResponse res) {
+    private void processDhtAtomicUpdateResponse(UUID nodeId, GridDhtAtomicUpdateResponseInterface res) {
         if (log.isDebugEnabled())
             log.debug("Processing dht atomic update response [nodeId=" + nodeId + ", res=" + res + ']');
 
@@ -3036,7 +3036,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      * @param nodeId Originating node ID.
      * @param res Near update response.
      */
-    private void sendNearUpdateReply(UUID nodeId, GridNearAtomicUpdateResponse res) {
+    private void sendNearUpdateReply(UUID nodeId, GridNearAtomicUpdateResponseInterface res) {
         try {
             ctx.io().send(nodeId, (GridCacheMessage)res, ctx.ioPolicy());
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateRequest.java
index 8a0cc69..2fb5065 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateRequest.java
@@ -49,7 +49,7 @@ import org.jetbrains.annotations.Nullable;
 /**
  * Lite dht cache backup update request.
  */
-public class GridDhtAtomicMultipleUpdateRequest extends GridCacheMessage implements GridCacheDeployable, GridDhtAtomicUpdateRequest {
+public class GridDhtAtomicMultipleUpdateRequest extends GridCacheMessage implements GridCacheDeployable, GridDhtAtomicUpdateRequestInterface {
     /** */
     private static final long serialVersionUID = 0L;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateResponse.java
index 5d26610..1c599c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicMultipleUpdateResponse.java
@@ -41,7 +41,7 @@ import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 /**
  * DHT atomic cache backup update response.
  */
-public class GridDhtAtomicMultipleUpdateResponse extends GridCacheMessage implements GridCacheDeployable, GridDhtAtomicUpdateResponse {
+public class GridDhtAtomicMultipleUpdateResponse extends GridCacheMessage implements GridCacheDeployable, GridDhtAtomicUpdateResponseInterface {
     /** */
     private static final long serialVersionUID = 0L;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
index 2b29df6..a2ed9b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java
@@ -43,7 +43,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.UUID;
 
-public class GridDhtAtomicSingleUpdateRequest extends GridCacheMessage implements GridCacheDeployable, GridDhtAtomicUpdateRequest {
+public class GridDhtAtomicSingleUpdateRequest extends GridCacheMessage implements GridCacheDeployable, GridDhtAtomicUpdateRequestInterface {
     /** */
     private static final long serialVersionUID = 0L;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java
index fc5a8b2..488bf7f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateResponse.java
@@ -35,7 +35,7 @@ import java.nio.ByteBuffer;
 import java.util.Collection;
 import java.util.Collections;
 
-public class GridDhtAtomicSingleUpdateResponse extends GridCacheMessage implements GridCacheDeployable, GridDhtAtomicUpdateResponse {
+public class GridDhtAtomicSingleUpdateResponse extends GridCacheMessage implements GridCacheDeployable, GridDhtAtomicUpdateResponseInterface {
     /** */
     private static final long serialVersionUID = 0L;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
index df50542..6e2ed31 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java
@@ -79,20 +79,20 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void> implement
 
     /** Completion callback. */
     @GridToStringExclude
-    private final CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> completionCb;
+    private final CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface> completionCb;
 
     /** Mappings. */
     @GridToStringInclude
-    private final Map<UUID, GridDhtAtomicUpdateRequest> mappings;
+    private final Map<UUID, GridDhtAtomicUpdateRequestInterface> mappings;
 
     /** Entries with readers. */
     private Map<KeyCacheObject, GridDhtCacheEntry> nearReadersEntries;
 
     /** Update request. */
-    private final GridNearAtomicUpdateRequest updateReq;
+    private final GridNearAtomicUpdateRequestInterface updateReq;
 
     /** Update response. */
-    private final GridNearAtomicUpdateResponse updateRes;
+    private final GridNearAtomicUpdateResponseInterface updateRes;
 
     /** Future keys. */
     private final Collection<KeyCacheObject> keys;
@@ -115,10 +115,10 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void> implement
      */
     public GridDhtAtomicUpdateFuture(
         GridCacheContext cctx,
-        CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse> completionCb,
+        CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface> completionCb,
         GridCacheVersion writeVer,
-        GridNearAtomicUpdateRequest updateReq,
-        GridNearAtomicUpdateResponse updateRes
+        GridNearAtomicUpdateRequestInterface updateReq,
+        GridNearAtomicUpdateResponseInterface updateRes
     ) {
         this.cctx = cctx;
         this.writeVer = writeVer;
@@ -171,7 +171,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void> implement
     private boolean registerResponse(UUID nodeId) {
         int resCnt0;
 
-        GridDhtAtomicUpdateRequest req = mappings.get(nodeId);
+        GridDhtAtomicUpdateRequestInterface req = mappings.get(nodeId);
 
         if (req != null) {
             synchronized (this) {
@@ -248,7 +248,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void> implement
             UUID nodeId = node.id();
 
             if (!nodeId.equals(cctx.localNodeId())) {
-                GridDhtAtomicUpdateRequest updateReq = mappings.get(nodeId);
+                GridDhtAtomicUpdateRequestInterface updateReq = mappings.get(nodeId);
 
                 if (updateReq == null) {
                     if (this.updateReq instanceof GridNearAtomicSingleUpdateRequest)
@@ -338,7 +338,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void> implement
         AffinityTopologyVersion topVer = updateReq.topologyVersion();
 
         for (UUID nodeId : readers) {
-            GridDhtAtomicUpdateRequest updateReq = mappings.get(nodeId);
+            GridDhtAtomicUpdateRequestInterface updateReq = mappings.get(nodeId);
 
             if (updateReq == null) {
                 ClusterNode node = cctx.discovery().node(nodeId);
@@ -402,7 +402,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void> implement
                     Collection<KeyCacheObject> hndKeys = new ArrayList<>(keys.size());
 
                     exit:
-                    for (GridDhtAtomicUpdateRequest req : mappings.values()) {
+                    for (GridDhtAtomicUpdateRequestInterface req : mappings.values()) {
                         for (int i = 0; i < req.size(); i++) {
                             KeyCacheObject key = req.key(i);
 
@@ -432,7 +432,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void> implement
                 if (lsnrs != null) {
                     Collection<KeyCacheObject> hndKeys = new ArrayList<>(keys.size());
 
-                    exit: for (GridDhtAtomicUpdateRequest req : mappings.values()) {
+                    exit: for (GridDhtAtomicUpdateRequestInterface req : mappings.values()) {
                         for (int i = 0; i < req.size(); i++) {
                             KeyCacheObject key = req.key(i);
 
@@ -480,7 +480,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void> implement
      */
     public void map() {
         if (!mappings.isEmpty()) {
-            for (GridDhtAtomicUpdateRequest req : mappings.values()) {
+            for (GridDhtAtomicUpdateRequestInterface req : mappings.values()) {
                 try {
                     if (log.isDebugEnabled())
                         log.debug("Sending DHT atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']');
@@ -516,7 +516,7 @@ public class GridDhtAtomicUpdateFuture extends GridFutureAdapter<Void> implement
      * @param nodeId Backup node ID.
      * @param updateRes Update response.
      */
-    public void onResult(UUID nodeId, GridDhtAtomicUpdateResponse updateRes) {
+    public void onResult(UUID nodeId, GridDhtAtomicUpdateResponseInterface updateRes) {
         if (log.isDebugEnabled())
             log.debug("Received DHT atomic update future result [nodeId=" + nodeId + ", updateRes=" + updateRes + ']');
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
deleted file mode 100644
index 3e97462..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * 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.distributed.dht.atomic;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import org.apache.ignite.internal.processors.cache.CacheObject;
-import org.apache.ignite.internal.processors.cache.GridCacheMessage;
-import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
-import org.apache.ignite.internal.processors.cache.KeyCacheObject;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.plugin.extensions.communication.Message;
-import org.jetbrains.annotations.Nullable;
-import javax.cache.processor.EntryProcessor;
-import java.util.Collection;
-import java.util.UUID;
-
-/**
- * Base interface for DHT atomic update requests.
- */
-public interface GridDhtAtomicUpdateRequest extends Message {
-
-    /**
-     * @return Force transform backups flag.
-     */
-    boolean forceTransformBackups();
-
-    /**
-     * @param key Key to add.
-     * @param val Value, {@code null} if should be removed.
-     * @param entryProcessor Entry processor.
-     * @param ttl TTL (optional).
-     * @param conflictExpireTime Conflict expire time (optional).
-     * @param conflictVer Conflict version (optional).
-     * @param addPrevVal If {@code true} adds previous value.
-     * @param prevVal Previous value.
-     */
-    void addWriteValue(KeyCacheObject key,
-        @Nullable CacheObject val,
-        EntryProcessor<Object, Object, Object> entryProcessor,
-        long ttl,
-        long conflictExpireTime,
-        @Nullable GridCacheVersion conflictVer,
-        boolean addPrevVal,
-        int partId,
-        @Nullable CacheObject prevVal,
-        @Nullable Long updateIdx,
-        boolean storeLocPrevVal);
-
-    /**
-     * @param key Key to add.
-     * @param val Value, {@code null} if should be removed.
-     * @param entryProcessor Entry processor.
-     * @param ttl TTL.
-     * @param expireTime Expire time.
-     */
-    void addNearWriteValue(KeyCacheObject key,
-        @Nullable CacheObject val,
-        EntryProcessor<Object, Object, Object> entryProcessor,
-        long ttl,
-        long expireTime);
-
-    /**
-     * Gets message lookup index. See {@link GridCacheMessage#lookupIndex()}.
-     *
-     * @return Message lookup index.
-     */
-    int lookupIndex();
-
-    /**
-     * @return Node ID.
-     */
-    UUID nodeId();
-
-    /**
-     * @return Subject ID.
-     */
-    UUID subjectId();
-
-    /**
-     * @return Task name.
-     */
-    int taskNameHash();
-
-    /**
-     * @return Keys size.
-     */
-    int size();
-
-    /**
-     * @return Keys size.
-     */
-    int nearSize();
-
-    /**
-     * @return Version assigned on primary node.
-     */
-    GridCacheVersion futureVersion();
-
-    /**
-     * @return Write version.
-     */
-    GridCacheVersion writeVersion();
-
-    /**
-     * @return Cache write synchronization mode.
-     */
-    CacheWriteSynchronizationMode writeSynchronizationMode();
-
-    /**
-     * @return Topology version.
-     */
-    AffinityTopologyVersion topologyVersion();
-
-    /**
-     * @return Keys.
-     */
-    Collection<KeyCacheObject> keys();
-
-    /**
-     * @param idx Key index.
-     * @return Key.
-     */
-    KeyCacheObject key(int idx);
-
-    /**
-     * @param idx Partition index.
-     * @return Partition id.
-     */
-    int partitionId(int idx);
-
-    /**
-     * @param updCntr Update counter.
-     * @return Update counter.
-     */
-    Long updateCounter(int updCntr);
-
-    /**
-     * @param idx Near key index.
-     * @return Key.
-     */
-    KeyCacheObject nearKey(int idx);
-
-    /**
-     * @return Keep binary flag.
-     */
-    boolean keepBinary();
-
-    /**
-     * @param idx Key index.
-     * @return Value.
-     */
-    @Nullable CacheObject value(int idx);
-
-    /**
-     * @param idx Key index.
-     * @return Value.
-     */
-    @Nullable CacheObject previousValue(int idx);
-
-    /**
-     * @param idx Key index.
-     * @return Value.
-     */
-    @Nullable CacheObject localPreviousValue(int idx);
-
-    /**
-     * @param idx Key index.
-     * @return Entry processor.
-     */
-    @Nullable EntryProcessor<Object, Object, Object> entryProcessor(int idx);
-
-    /**
-     * @param idx Near key index.
-     * @return Value.
-     */
-    @Nullable CacheObject nearValue(int idx);
-
-    /**
-     * @param idx Key index.
-     * @return Transform closure.
-     */
-    @Nullable EntryProcessor<Object, Object, Object> nearEntryProcessor(int idx);
-
-    /**
-     * @param idx Index.
-     * @return Conflict version.
-     */
-    @Nullable GridCacheVersion conflictVersion(int idx);
-
-    /**
-     * @param idx Index.
-     * @return TTL.
-     */
-    long ttl(int idx);
-
-    /**
-     * @param idx Index.
-     * @return TTL for near cache update.
-     */
-    long nearTtl(int idx);
-
-    /**
-     * @param idx Index.
-     * @return Conflict expire time.
-     */
-    long conflictExpireTime(int idx);
-
-    /**
-     * @param idx Index.
-     * @return Expire time for near cache update.
-     */
-    long nearExpireTime(int idx);
-
-    /**
-     * @return {@code True} if on response flag changed.
-     */
-    boolean onResponse();
-
-    /**
-     * @return Optional arguments for entry processor.
-     */
-    @Nullable Object[] invokeArguments();
-
-    /**
-     * This method is called before the whole message is serialized
-     * and is responsible for pre-marshalling state.
-     *
-     * @param ctx Cache context.
-     * @throws IgniteCheckedException If failed.
-     */
-    void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException;
-
-    /**
-     * This method is called after the message is deserialized and is responsible for
-     * unmarshalling state marshalled in {@link #prepareMarshal(GridCacheSharedContext)} method.
-     *
-     * @param ctx Context.
-     * @param ldr Class loader.
-     * @throws IgniteCheckedException If failed.
-     */
-    void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException;
-
-    /**
-     *  Deployment enabled flag indicates whether deployment info has to be added to this message.
-     *
-     * @return {@code true} or if deployment info must be added to the the message, {@code false} otherwise.
-     */
-    boolean addDeploymentInfo();
-
-    /**
-     * @return Error.
-     */
-    IgniteCheckedException classError();
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequestInterface.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequestInterface.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequestInterface.java
new file mode 100644
index 0000000..43e6698
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequestInterface.java
@@ -0,0 +1,271 @@
+/*
+ * 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.distributed.dht.atomic;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheMessage;
+import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
+import org.apache.ignite.internal.processors.cache.KeyCacheObject;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.jetbrains.annotations.Nullable;
+import javax.cache.processor.EntryProcessor;
+import java.util.Collection;
+import java.util.UUID;
+
+/**
+ * Base interface for DHT atomic update requests.
+ */
+public interface GridDhtAtomicUpdateRequestInterface extends Message {
+
+    /**
+     * @return Force transform backups flag.
+     */
+    boolean forceTransformBackups();
+
+    /**
+     * @param key Key to add.
+     * @param val Value, {@code null} if should be removed.
+     * @param entryProcessor Entry processor.
+     * @param ttl TTL (optional).
+     * @param conflictExpireTime Conflict expire time (optional).
+     * @param conflictVer Conflict version (optional).
+     * @param addPrevVal If {@code true} adds previous value.
+     * @param prevVal Previous value.
+     */
+    void addWriteValue(KeyCacheObject key,
+        @Nullable CacheObject val,
+        EntryProcessor<Object, Object, Object> entryProcessor,
+        long ttl,
+        long conflictExpireTime,
+        @Nullable GridCacheVersion conflictVer,
+        boolean addPrevVal,
+        int partId,
+        @Nullable CacheObject prevVal,
+        @Nullable Long updateIdx,
+        boolean storeLocPrevVal);
+
+    /**
+     * @param key Key to add.
+     * @param val Value, {@code null} if should be removed.
+     * @param entryProcessor Entry processor.
+     * @param ttl TTL.
+     * @param expireTime Expire time.
+     */
+    void addNearWriteValue(KeyCacheObject key,
+        @Nullable CacheObject val,
+        EntryProcessor<Object, Object, Object> entryProcessor,
+        long ttl,
+        long expireTime);
+
+    /**
+     * Gets message lookup index. See {@link GridCacheMessage#lookupIndex()}.
+     *
+     * @return Message lookup index.
+     */
+    int lookupIndex();
+
+    /**
+     * @return Node ID.
+     */
+    UUID nodeId();
+
+    /**
+     * @return Subject ID.
+     */
+    UUID subjectId();
+
+    /**
+     * @return Task name.
+     */
+    int taskNameHash();
+
+    /**
+     * @return Keys size.
+     */
+    int size();
+
+    /**
+     * @return Keys size.
+     */
+    int nearSize();
+
+    /**
+     * @return Version assigned on primary node.
+     */
+    GridCacheVersion futureVersion();
+
+    /**
+     * @return Write version.
+     */
+    GridCacheVersion writeVersion();
+
+    /**
+     * @return Cache write synchronization mode.
+     */
+    CacheWriteSynchronizationMode writeSynchronizationMode();
+
+    /**
+     * @return Topology version.
+     */
+    AffinityTopologyVersion topologyVersion();
+
+    /**
+     * @return Keys.
+     */
+    Collection<KeyCacheObject> keys();
+
+    /**
+     * @param idx Key index.
+     * @return Key.
+     */
+    KeyCacheObject key(int idx);
+
+    /**
+     * @param idx Partition index.
+     * @return Partition id.
+     */
+    int partitionId(int idx);
+
+    /**
+     * @param updCntr Update counter.
+     * @return Update counter.
+     */
+    Long updateCounter(int updCntr);
+
+    /**
+     * @param idx Near key index.
+     * @return Key.
+     */
+    KeyCacheObject nearKey(int idx);
+
+    /**
+     * @return Keep binary flag.
+     */
+    boolean keepBinary();
+
+    /**
+     * @param idx Key index.
+     * @return Value.
+     */
+    @Nullable CacheObject value(int idx);
+
+    /**
+     * @param idx Key index.
+     * @return Value.
+     */
+    @Nullable CacheObject previousValue(int idx);
+
+    /**
+     * @param idx Key index.
+     * @return Value.
+     */
+    @Nullable CacheObject localPreviousValue(int idx);
+
+    /**
+     * @param idx Key index.
+     * @return Entry processor.
+     */
+    @Nullable EntryProcessor<Object, Object, Object> entryProcessor(int idx);
+
+    /**
+     * @param idx Near key index.
+     * @return Value.
+     */
+    @Nullable CacheObject nearValue(int idx);
+
+    /**
+     * @param idx Key index.
+     * @return Transform closure.
+     */
+    @Nullable EntryProcessor<Object, Object, Object> nearEntryProcessor(int idx);
+
+    /**
+     * @param idx Index.
+     * @return Conflict version.
+     */
+    @Nullable GridCacheVersion conflictVersion(int idx);
+
+    /**
+     * @param idx Index.
+     * @return TTL.
+     */
+    long ttl(int idx);
+
+    /**
+     * @param idx Index.
+     * @return TTL for near cache update.
+     */
+    long nearTtl(int idx);
+
+    /**
+     * @param idx Index.
+     * @return Conflict expire time.
+     */
+    long conflictExpireTime(int idx);
+
+    /**
+     * @param idx Index.
+     * @return Expire time for near cache update.
+     */
+    long nearExpireTime(int idx);
+
+    /**
+     * @return {@code True} if on response flag changed.
+     */
+    boolean onResponse();
+
+    /**
+     * @return Optional arguments for entry processor.
+     */
+    @Nullable Object[] invokeArguments();
+
+    /**
+     * This method is called before the whole message is serialized
+     * and is responsible for pre-marshalling state.
+     *
+     * @param ctx Cache context.
+     * @throws IgniteCheckedException If failed.
+     */
+    void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException;
+
+    /**
+     * This method is called after the message is deserialized and is responsible for
+     * unmarshalling state marshalled in {@link #prepareMarshal(GridCacheSharedContext)} method.
+     *
+     * @param ctx Context.
+     * @param ldr Class loader.
+     * @throws IgniteCheckedException If failed.
+     */
+    void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException;
+
+    /**
+     *  Deployment enabled flag indicates whether deployment info has to be added to this message.
+     *
+     * @return {@code true} or if deployment info must be added to the the message, {@code false} otherwise.
+     */
+    boolean addDeploymentInfo();
+
+    /**
+     * @return Error.
+     */
+    IgniteCheckedException classError();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
deleted file mode 100644
index 6fa9c4f..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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.distributed.dht.atomic;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.cache.GridCacheMessage;
-import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
-import org.apache.ignite.internal.processors.cache.KeyCacheObject;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.plugin.extensions.communication.Message;
-import java.util.Collection;
-
-/**
- * Base interface for DHT atomic update responses.
- */
-public interface GridDhtAtomicUpdateResponse extends Message {
-
-    /**
-     * Gets message lookup index. See {@link GridCacheMessage#lookupIndex()}.
-     *
-     * @return Message lookup index.
-     */
-    int lookupIndex();
-
-    /**
-     * @return Version assigned on primary node.
-     */
-    GridCacheVersion futureVersion();
-
-    /**
-     * Sets update error.
-     *
-     * @param err Error.
-     */
-    void onError(IgniteCheckedException err);
-
-    /**
-     * @return Error, if any.
-     */
-    IgniteCheckedException error();
-
-    /**
-     * @return Failed keys.
-     */
-    Collection<KeyCacheObject> failedKeys();
-
-    /**
-     * Adds key to collection of failed keys.
-     *
-     * @param key Key to add.
-     * @param e Error cause.
-     */
-    void addFailedKey(KeyCacheObject key, Throwable e);
-
-    /**
-     * @return Evicted readers.
-     */
-    Collection<KeyCacheObject> nearEvicted();
-
-    /**
-     * Adds near evicted key..
-     *
-     * @param key Evicted key.
-     */
-    void addNearEvicted(KeyCacheObject key);
-
-    /**
-     * This method is called before the whole message is serialized
-     * and is responsible for pre-marshalling state.
-     *
-     * @param ctx Cache context.
-     * @throws IgniteCheckedException If failed.
-     */
-    void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException;
-
-    /**
-     * This method is called after the message is deserialized and is responsible for
-     * unmarshalling state marshalled in {@link #prepareMarshal(GridCacheSharedContext)} method.
-     *
-     * @param ctx Context.
-     * @param ldr Class loader.
-     * @throws IgniteCheckedException If failed.
-     */
-    void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException;
-
-    /**
-     *  Deployment enabled flag indicates whether deployment info has to be added to this message.
-     *
-     * @return {@code true} or if deployment info must be added to the the message, {@code false} otherwise.
-     */
-    boolean addDeploymentInfo();
-
-    /**
-     * @return Message ID.
-     */
-    long messageId();
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponseInterface.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponseInterface.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponseInterface.java
new file mode 100644
index 0000000..7defbf0
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponseInterface.java
@@ -0,0 +1,112 @@
+/*
+ * 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.distributed.dht.atomic;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.processors.cache.GridCacheMessage;
+import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
+import org.apache.ignite.internal.processors.cache.KeyCacheObject;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import java.util.Collection;
+
+/**
+ * Base interface for DHT atomic update responses.
+ */
+public interface GridDhtAtomicUpdateResponseInterface extends Message {
+
+    /**
+     * Gets message lookup index. See {@link GridCacheMessage#lookupIndex()}.
+     *
+     * @return Message lookup index.
+     */
+    int lookupIndex();
+
+    /**
+     * @return Version assigned on primary node.
+     */
+    GridCacheVersion futureVersion();
+
+    /**
+     * Sets update error.
+     *
+     * @param err Error.
+     */
+    void onError(IgniteCheckedException err);
+
+    /**
+     * @return Error, if any.
+     */
+    IgniteCheckedException error();
+
+    /**
+     * @return Failed keys.
+     */
+    Collection<KeyCacheObject> failedKeys();
+
+    /**
+     * Adds key to collection of failed keys.
+     *
+     * @param key Key to add.
+     * @param e Error cause.
+     */
+    void addFailedKey(KeyCacheObject key, Throwable e);
+
+    /**
+     * @return Evicted readers.
+     */
+    Collection<KeyCacheObject> nearEvicted();
+
+    /**
+     * Adds near evicted key..
+     *
+     * @param key Evicted key.
+     */
+    void addNearEvicted(KeyCacheObject key);
+
+    /**
+     * This method is called before the whole message is serialized
+     * and is responsible for pre-marshalling state.
+     *
+     * @param ctx Cache context.
+     * @throws IgniteCheckedException If failed.
+     */
+    void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException;
+
+    /**
+     * This method is called after the message is deserialized and is responsible for
+     * unmarshalling state marshalled in {@link #prepareMarshal(GridCacheSharedContext)} method.
+     *
+     * @param ctx Context.
+     * @param ldr Class loader.
+     * @throws IgniteCheckedException If failed.
+     */
+    void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException;
+
+    /**
+     *  Deployment enabled flag indicates whether deployment info has to be added to this message.
+     *
+     * @return {@code true} or if deployment info must be added to the the message, {@code false} otherwise.
+     */
+    boolean addDeploymentInfo();
+
+    /**
+     * @return Message ID.
+     */
+    long messageId();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateRequest.java
index d702202..d1c3654 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateRequest.java
@@ -59,7 +59,7 @@ import static org.apache.ignite.internal.processors.cache.GridCacheOperation.UPD
  * Lite DHT cache update request sent from near node to primary node.
  */
 public class GridNearAtomicMultipleUpdateRequest extends GridCacheMessage
-    implements GridNearAtomicUpdateRequest, GridCacheDeployable {
+    implements GridNearAtomicUpdateRequestInterface, GridCacheDeployable {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -158,7 +158,7 @@ public class GridNearAtomicMultipleUpdateRequest extends GridCacheMessage
 
     /** */
     @GridDirectTransient
-    private GridNearAtomicUpdateResponse res;
+    private GridNearAtomicUpdateResponseInterface res;
 
     /** Maximum possible size of inner collections. */
     @GridDirectTransient
@@ -503,7 +503,7 @@ public class GridNearAtomicMultipleUpdateRequest extends GridCacheMessage
     }
 
     /** {@inheritDoc} */
-    @Override public boolean onResponse(GridNearAtomicUpdateResponse res) {
+    @Override public boolean onResponse(GridNearAtomicUpdateResponseInterface res) {
         if (this.res == null) {
             this.res = res;
 
@@ -514,7 +514,7 @@ public class GridNearAtomicMultipleUpdateRequest extends GridCacheMessage
     }
 
     /** {@inheritDoc} */
-    @Override @Nullable public GridNearAtomicUpdateResponse response() {
+    @Override @Nullable public GridNearAtomicUpdateResponseInterface response() {
         return res;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java
index cbab328..24e7c3a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicMultipleUpdateResponse.java
@@ -47,7 +47,7 @@ import org.jetbrains.annotations.Nullable;
 /**
  * DHT atomic cache near update response.
  */
-public class GridNearAtomicMultipleUpdateResponse extends GridCacheMessage implements GridCacheDeployable, GridNearAtomicUpdateResponse {
+public class GridNearAtomicMultipleUpdateResponse extends GridCacheMessage implements GridCacheDeployable, GridNearAtomicUpdateResponseInterface {
     /** */
     private static final long serialVersionUID = 0L;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java
index 61889e3..ce086d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateRequest.java
@@ -58,7 +58,7 @@ import static org.apache.ignite.internal.processors.cache.GridCacheOperation.UPD
  * Lite DHT cache update request sent from near node to primary node.
  */
 public class GridNearAtomicSingleUpdateRequest extends GridCacheMessage
-    implements GridNearAtomicUpdateRequest, GridCacheDeployable {
+    implements GridNearAtomicUpdateRequestInterface, GridCacheDeployable {
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -150,7 +150,7 @@ public class GridNearAtomicSingleUpdateRequest extends GridCacheMessage
 
     /** */
     @GridDirectTransient
-    private GridNearAtomicUpdateResponse res;
+    private GridNearAtomicUpdateResponseInterface res;
 
     /**
      * Empty constructor required by {@link Externalizable}.
@@ -428,7 +428,7 @@ public class GridNearAtomicSingleUpdateRequest extends GridCacheMessage
     }
 
     /** {@inheritDoc} */
-    @Override public boolean onResponse(GridNearAtomicUpdateResponse res) {
+    @Override public boolean onResponse(GridNearAtomicUpdateResponseInterface res) {
         if (this.res == null) {
             this.res = res;
 
@@ -439,7 +439,7 @@ public class GridNearAtomicSingleUpdateRequest extends GridCacheMessage
     }
 
     /** {@inheritDoc} */
-    @Override @Nullable public GridNearAtomicUpdateResponse response() {
+    @Override @Nullable public GridNearAtomicUpdateResponseInterface response() {
         return res;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateResponse.java
index c7e5c8e..075f477 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateResponse.java
@@ -41,7 +41,7 @@ import java.util.Collections;
 import java.util.List;
 import java.util.UUID;
 
-public class GridNearAtomicSingleUpdateResponse extends GridCacheMessage implements GridCacheDeployable, GridNearAtomicUpdateResponse {
+public class GridNearAtomicSingleUpdateResponse extends GridCacheMessage implements GridCacheDeployable, GridNearAtomicUpdateResponseInterface {
 
     /** */
     private static final long serialVersionUID = 0L;

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 82a2a8c..de89d91 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -339,7 +339,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
      * @param nodeId Node ID.
      * @param res Update response.
      */
-    public void onResult(UUID nodeId, GridNearAtomicUpdateResponse res) {
+    public void onResult(UUID nodeId, GridNearAtomicUpdateResponseInterface res) {
         state.onResult(nodeId, res, false);
     }
 
@@ -349,7 +349,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
      * @param req Update request.
      * @param res Update response.
      */
-    private void updateNear(GridNearAtomicUpdateRequest req, GridNearAtomicUpdateResponse res) {
+    private void updateNear(GridNearAtomicUpdateRequestInterface req, GridNearAtomicUpdateResponseInterface res) {
         assert nearEnabled;
 
         if (res.remapKeys() != null || !req.hasPrimary())
@@ -451,12 +451,12 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
      * @param nodeId Node ID.
      * @param req Request.
      */
-    private void mapSingle(UUID nodeId, GridNearAtomicUpdateRequest req) {
+    private void mapSingle(UUID nodeId, GridNearAtomicUpdateRequestInterface req) {
         if (cctx.localNodeId().equals(nodeId)) {
             cache.updateAllAsyncInternal(nodeId, req,
-                new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
-                    @Override public void apply(GridNearAtomicUpdateRequest req,
-                        GridNearAtomicUpdateResponse res) {
+                new CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface>() {
+                    @Override public void apply(GridNearAtomicUpdateRequestInterface req,
+                        GridNearAtomicUpdateResponseInterface res) {
                         onResult(res.nodeId(), res);
                     }
                 });
@@ -510,9 +510,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
 
         if (locUpdate != null) {
             cache.updateAllAsyncInternal(cctx.localNodeId(), locUpdate,
-                new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
-                    @Override public void apply(GridNearAtomicUpdateRequest req,
-                        GridNearAtomicUpdateResponse res) {
+                new CI2<GridNearAtomicUpdateRequestInterface, GridNearAtomicUpdateResponseInterface>() {
+                    @Override public void apply(GridNearAtomicUpdateRequestInterface req,
+                        GridNearAtomicUpdateResponseInterface res) {
                         onResult(res.nodeId(), res);
                     }
                 });
@@ -555,7 +555,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
         private Collection<KeyCacheObject> remapKeys;
 
         /** Not null is operation is mapped to single node. */
-        private GridNearAtomicUpdateRequest singleReq;
+        private GridNearAtomicUpdateRequestInterface singleReq;
 
         /** Operation result. */
         private GridCacheReturn opRes;
@@ -571,10 +571,10 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
          * @param nodeId Left node ID.
          */
         void onNodeLeft(UUID nodeId) {
-            GridNearAtomicUpdateResponse res = null;
+            GridNearAtomicUpdateResponseInterface res = null;
 
             synchronized (this) {
-                GridNearAtomicUpdateRequest req;
+                GridNearAtomicUpdateRequestInterface req;
 
                 if (singleReq != null)
                     req = singleReq.nodeId().equals(nodeId) ? singleReq : null;
@@ -612,8 +612,8 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
          * @param nodeErr {@code True} if response was created on node failure.
          */
         @SuppressWarnings({"unchecked", "ThrowableResultOfMethodCallIgnored"}) void onResult(UUID nodeId,
-            GridNearAtomicUpdateResponse res, boolean nodeErr) {
-            GridNearAtomicUpdateRequest req;
+            GridNearAtomicUpdateResponseInterface res, boolean nodeErr) {
+            GridNearAtomicUpdateRequestInterface req;
 
             AffinityTopologyVersion remapTopVer = null;
 
@@ -744,7 +744,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
             if (rcvAll && nearEnabled) {
                 if (mappings != null) {
                     for (GridNearAtomicMultipleUpdateRequest req0 : mappings.values()) {
-                        GridNearAtomicUpdateResponse res0 = req0.response();
+                        GridNearAtomicUpdateResponseInterface res0 = req0.response();
 
                         assert res0 != null : req0;
 
@@ -817,9 +817,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
          * @param req Request.
          * @param e Error.
          */
-        void onSendError(GridNearAtomicUpdateRequest req, IgniteCheckedException e) {
+        void onSendError(GridNearAtomicUpdateRequestInterface req, IgniteCheckedException e) {
             synchronized (this) {
-                GridNearAtomicUpdateResponse res;
+                GridNearAtomicUpdateResponseInterface res;
 
                 if (req instanceof GridNearAtomicSingleUpdateRequest)
                     res = new GridNearAtomicSingleUpdateResponse(cctx.cacheId(),
@@ -853,7 +853,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
             }
 
             Exception err = null;
-            GridNearAtomicUpdateRequest singleReq0 = null;
+            GridNearAtomicUpdateRequestInterface singleReq0 = null;
             Map<UUID, GridNearAtomicMultipleUpdateRequest> mappings0 = null;
 
             int size = keys.size();
@@ -1138,7 +1138,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object> implem
          * @return Request.
          * @throws Exception If failed.
          */
-        private GridNearAtomicUpdateRequest mapSingleUpdate(AffinityTopologyVersion topVer,
+        private GridNearAtomicUpdateRequestInterface mapSingleUpdate(AffinityTopologyVersion topVer,
             Collection<ClusterNode> topNodes, GridCacheVersion futVer, @Nullable GridCacheVersion updVer)
             throws Exception {
             Object key = F.first(keys);

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
deleted file mode 100644
index b2d847b..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * 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.distributed.dht.atomic;
-
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
-import org.apache.ignite.internal.processors.cache.CacheObject;
-import org.apache.ignite.internal.processors.cache.GridCacheOperation;
-import org.apache.ignite.internal.processors.cache.KeyCacheObject;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.plugin.extensions.communication.Message;
-import org.jetbrains.annotations.Nullable;
-
-import javax.cache.expiry.ExpiryPolicy;
-import javax.cache.processor.EntryProcessor;
-import java.util.List;
-import java.util.UUID;
-
-/**
- * Base interface for near atomic update requests.
- */
-public interface GridNearAtomicUpdateRequest extends Message {
-    /**
-     * @return Message ID.
-     */
-    public long messageId();
-
-    /**
-     * @return Mapped node ID.
-     */
-    public UUID nodeId();
-
-    /**
-     * @param nodeId Node ID.
-     */
-    public void nodeId(UUID nodeId);
-
-    /**
-     * @return Subject ID.
-     */
-    public UUID subjectId();
-
-    /**
-     * @return Task name hash.
-     */
-    public int taskNameHash();
-
-    /**
-     * @return Future version.
-     */
-    public GridCacheVersion futureVersion();
-
-    /**
-     * @return Flag indicating whether this is fast-map udpate.
-     */
-    public boolean fastMap();
-
-    /**
-     * @return Update version for fast-map request.
-     */
-    public GridCacheVersion updateVersion();
-
-    /**
-     * @return Topology version.
-     */
-    public AffinityTopologyVersion topologyVersion();
-
-    /**
-     * @return Topology locked flag.
-     */
-    public boolean topologyLocked();
-
-    /**
-     * @return {@code True} if request sent from client node.
-     */
-    public boolean clientRequest();
-
-    /**
-     * @return Cache write synchronization mode.
-     */
-    public CacheWriteSynchronizationMode writeSynchronizationMode();
-
-    /**
-     * @return Expiry policy.
-     */
-    public ExpiryPolicy expiry();
-
-    /**
-     * @return Return value flag.
-     */
-    public boolean returnValue();
-
-    /**
-     * @return Filter.
-     */
-    @Nullable public CacheEntryPredicate[] filter();
-
-    /**
-     * @return Skip write-through to a persistent storage.
-     */
-    public boolean skipStore();
-
-    /**
-     * @return Keep binary flag.
-     */
-    public boolean keepBinary();
-
-    /**
-     * @return Keys for this update request.
-     */
-    public List<KeyCacheObject> keys();
-
-    /**
-     * @return Values for this update request.
-     */
-    public List<?> values();
-
-    /**
-     * @return Update operation.
-     */
-    public GridCacheOperation operation();
-
-    /**
-     * @return Optional arguments for entry processor.
-     */
-    @Nullable public Object[] invokeArguments();
-
-    /**
-     * @param idx Key index.
-     * @return Value.
-     */
-    public CacheObject value(int idx);
-
-    /**
-     * @param idx Key index.
-     * @return Entry processor.
-     */
-    public EntryProcessor<Object, Object, Object> entryProcessor(int idx);
-
-    /**
-     * @param idx Index to get.
-     * @return Write value - either value, or transform closure.
-     */
-    public CacheObject writeValue(int idx);
-
-    /**
-     * @return Conflict versions.
-     */
-    @Nullable public List<GridCacheVersion> conflictVersions();
-
-    /**
-     * @param idx Index.
-     * @return Conflict version.
-     */
-    @Nullable public GridCacheVersion conflictVersion(int idx);
-
-    /**
-     * @param idx Index.
-     * @return Conflict TTL.
-     */
-    public long conflictTtl(int idx);
-
-    /**
-     * @param idx Index.
-     * @return Conflict expire time.
-     */
-    public long conflictExpireTime(int idx);
-
-    /**
-     * @return Flag indicating whether this request contains primary keys.
-     */
-    public boolean hasPrimary();
-
-    /**
-     * @param res Response.
-     * @return {@code True} if current response was {@code null}.
-     */
-    public boolean onResponse(GridNearAtomicUpdateResponse res);
-
-    /**
-     * @return Response.
-     */
-    @Nullable public GridNearAtomicUpdateResponse response();
-
-    /**
-     * Cleanup values.
-     *
-     * @param clearKeys If {@code true} clears keys.
-     */
-    void cleanup(boolean clearKeys);
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequestInterface.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequestInterface.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequestInterface.java
new file mode 100644
index 0000000..f0f511b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequestInterface.java
@@ -0,0 +1,207 @@
+/*
+ * 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.distributed.dht.atomic;
+
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
+import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.GridCacheOperation;
+import org.apache.ignite.internal.processors.cache.KeyCacheObject;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.jetbrains.annotations.Nullable;
+
+import javax.cache.expiry.ExpiryPolicy;
+import javax.cache.processor.EntryProcessor;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * Base interface for near atomic update requests.
+ */
+public interface GridNearAtomicUpdateRequestInterface extends Message {
+    /**
+     * @return Message ID.
+     */
+    public long messageId();
+
+    /**
+     * @return Mapped node ID.
+     */
+    public UUID nodeId();
+
+    /**
+     * @param nodeId Node ID.
+     */
+    public void nodeId(UUID nodeId);
+
+    /**
+     * @return Subject ID.
+     */
+    public UUID subjectId();
+
+    /**
+     * @return Task name hash.
+     */
+    public int taskNameHash();
+
+    /**
+     * @return Future version.
+     */
+    public GridCacheVersion futureVersion();
+
+    /**
+     * @return Flag indicating whether this is fast-map udpate.
+     */
+    public boolean fastMap();
+
+    /**
+     * @return Update version for fast-map request.
+     */
+    public GridCacheVersion updateVersion();
+
+    /**
+     * @return Topology version.
+     */
+    public AffinityTopologyVersion topologyVersion();
+
+    /**
+     * @return Topology locked flag.
+     */
+    public boolean topologyLocked();
+
+    /**
+     * @return {@code True} if request sent from client node.
+     */
+    public boolean clientRequest();
+
+    /**
+     * @return Cache write synchronization mode.
+     */
+    public CacheWriteSynchronizationMode writeSynchronizationMode();
+
+    /**
+     * @return Expiry policy.
+     */
+    public ExpiryPolicy expiry();
+
+    /**
+     * @return Return value flag.
+     */
+    public boolean returnValue();
+
+    /**
+     * @return Filter.
+     */
+    @Nullable public CacheEntryPredicate[] filter();
+
+    /**
+     * @return Skip write-through to a persistent storage.
+     */
+    public boolean skipStore();
+
+    /**
+     * @return Keep binary flag.
+     */
+    public boolean keepBinary();
+
+    /**
+     * @return Keys for this update request.
+     */
+    public List<KeyCacheObject> keys();
+
+    /**
+     * @return Values for this update request.
+     */
+    public List<?> values();
+
+    /**
+     * @return Update operation.
+     */
+    public GridCacheOperation operation();
+
+    /**
+     * @return Optional arguments for entry processor.
+     */
+    @Nullable public Object[] invokeArguments();
+
+    /**
+     * @param idx Key index.
+     * @return Value.
+     */
+    public CacheObject value(int idx);
+
+    /**
+     * @param idx Key index.
+     * @return Entry processor.
+     */
+    public EntryProcessor<Object, Object, Object> entryProcessor(int idx);
+
+    /**
+     * @param idx Index to get.
+     * @return Write value - either value, or transform closure.
+     */
+    public CacheObject writeValue(int idx);
+
+    /**
+     * @return Conflict versions.
+     */
+    @Nullable public List<GridCacheVersion> conflictVersions();
+
+    /**
+     * @param idx Index.
+     * @return Conflict version.
+     */
+    @Nullable public GridCacheVersion conflictVersion(int idx);
+
+    /**
+     * @param idx Index.
+     * @return Conflict TTL.
+     */
+    public long conflictTtl(int idx);
+
+    /**
+     * @param idx Index.
+     * @return Conflict expire time.
+     */
+    public long conflictExpireTime(int idx);
+
+    /**
+     * @return Flag indicating whether this request contains primary keys.
+     */
+    public boolean hasPrimary();
+
+    /**
+     * @param res Response.
+     * @return {@code True} if current response was {@code null}.
+     */
+    public boolean onResponse(GridNearAtomicUpdateResponseInterface res);
+
+    /**
+     * @return Response.
+     */
+    @Nullable public GridNearAtomicUpdateResponseInterface response();
+
+    /**
+     * Cleanup values.
+     *
+     * @param clearKeys If {@code true} clears keys.
+     */
+    void cleanup(boolean clearKeys);
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/c814ae3a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
deleted file mode 100644
index 4c4e8c1..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * 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.distributed.dht.atomic;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.cache.CacheObject;
-import org.apache.ignite.internal.processors.cache.GridCacheContext;
-import org.apache.ignite.internal.processors.cache.GridCacheMessage;
-import org.apache.ignite.internal.processors.cache.GridCacheReturn;
-import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
-import org.apache.ignite.internal.processors.cache.KeyCacheObject;
-import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
-import org.apache.ignite.plugin.extensions.communication.Message;
-import org.jetbrains.annotations.Nullable;
-import java.util.Collection;
-import java.util.List;
-import java.util.UUID;
-
-/**
- * Base interface for near atomic update responses.
- */
-public interface GridNearAtomicUpdateResponse extends Message {
-
-    /**
-     * Gets message lookup index. See {@link GridCacheMessage#lookupIndex()}.
-     *
-     * @return Message lookup index.
-     */
-    int lookupIndex();
-
-    /**
-     * @return Mapped node ID.
-     */
-    UUID nodeId();
-
-    /**
-     * @param nodeId Node ID.
-     */
-    void nodeId(UUID nodeId);
-
-    /**
-     * @return Future version.
-     */
-    GridCacheVersion futureVersion();
-
-    /**
-     * Sets update error.
-     *
-     * @param err Error.
-     */
-    void error(IgniteCheckedException err);
-
-    /**
-     * @return Error, if any.
-     */
-    IgniteCheckedException error();
-
-    /**
-     * @return Collection of failed keys.
-     */
-    Collection<KeyCacheObject> failedKeys();
-
-    /**
-     * @return Return value.
-     */
-    GridCacheReturn returnValue();
-
-    /**
-     * @param ret Return value.
-     */
-    @SuppressWarnings("unchecked") void returnValue(GridCacheReturn ret);
-
-    /**
-     * @param remapKeys Remap keys.
-     */
-    void remapKeys(List<KeyCacheObject> remapKeys);
-
-    /**
-     * @return Remap keys.
-     */
-    Collection<KeyCacheObject> remapKeys();
-
-    /**
-     * Adds value to be put in near cache on originating node.
-     *
-     * @param keyIdx Key index.
-     * @param val Value.
-     * @param ttl TTL for near cache update.
-     * @param expireTime Expire time for near cache update.
-     */
-    void addNearValue(int keyIdx,
-        @Nullable CacheObject val,
-        long ttl,
-        long expireTime);
-
-    /**
-     * @param keyIdx Key index.
-     * @param ttl TTL for near cache update.
-     * @param expireTime Expire time for near cache update.
-     */
-    @SuppressWarnings("ForLoopReplaceableByForEach") void addNearTtl(int keyIdx, long ttl, long expireTime);
-
-    /**
-     * @param idx Index.
-     * @return Expire time for near cache update.
-     */
-    long nearExpireTime(int idx);
-
-    /**
-     * @param idx Index.
-     * @return TTL for near cache update.
-     */
-    long nearTtl(int idx);
-
-    /**
-     * @param nearVer Version generated on primary node to be used for originating node's near cache update.
-     */
-    void nearVersion(GridCacheVersion nearVer);
-
-    /**
-     * @return Version generated on primary node to be used for originating node's near cache update.
-     */
-    GridCacheVersion nearVersion();
-
-    /**
-     * @param keyIdx Index of key for which update was skipped
-     */
-    void addSkippedIndex(int keyIdx);
-
-    /**
-     * @return Indexes of keys for which update was skipped
-     */
-    @Nullable List<Integer> skippedIndexes();
-
-    /**
-     * @return Indexes of keys for which values were generated on primary node.
-     */
-    @Nullable List<Integer> nearValuesIndexes();
-
-    /**
-     * @param idx Index.
-     * @return Value generated on primary node which should be put to originating node's near cache.
-     */
-    @Nullable CacheObject nearValue(int idx);
-
-    /**
-     * Adds key to collection of failed keys.
-     *
-     * @param key Key to add.
-     * @param e Error cause.
-     */
-    void addFailedKey(KeyCacheObject key, Throwable e);
-
-    /**
-     * Adds keys to collection of failed keys.
-     *
-     * @param keys Key to add.
-     * @param e Error cause.
-     */
-    void addFailedKeys(Collection<KeyCacheObject> keys, Throwable e);
-
-    /**
-     * Adds keys to collection of failed keys.
-     *
-     * @param keys Key to add.
-     * @param e Error cause.
-     * @param ctx Context.
-     */
-    void addFailedKeys(Collection<KeyCacheObject> keys, Throwable e, GridCacheContext ctx);
-
-    /**
-     * This method is called before the whole message is serialized
-     * and is responsible for pre-marshalling state.
-     *
-     * @param ctx Cache context.
-     * @throws IgniteCheckedException If failed.
-     */
-    void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException;
-
-    /**
-     * This method is called after the message is deserialized and is responsible for
-     * unmarshalling state marshalled in {@link #prepareMarshal(GridCacheSharedContext)} method.
-     *
-     * @param ctx Context.
-     * @param ldr Class loader.
-     * @throws IgniteCheckedException If failed.
-     */
-    void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException;
-
-    /**
-     *  Deployment enabled flag indicates whether deployment info has to be added to this message.
-     *
-     * @return {@code true} or if deployment info must be added to the the message, {@code false} otherwise.
-     */
-    boolean addDeploymentInfo();
-}