ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [17/26] ignite git commit: Another attempt to remove "remapKeys" collection.
Date Wed, 20 Apr 2016 07:12:22 GMT
Another attempt to remove "remapKeys" collection.


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

Branch: refs/heads/ignite-2523-1
Commit: 3f2450d27ba23fd5a5cfddfa06e3ff47cf46326a
Parents: 1b95311
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Apr 18 15:52:02 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Apr 18 15:52:02 2016 +0300

----------------------------------------------------------------------
 .../GridNearAtomicSingleUpdateFuture.java       | 27 +++-----------------
 1 file changed, 4 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3f2450d2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
index e93f240..7a95640 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFuture.java
@@ -42,7 +42,6 @@ import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 
 import javax.cache.expiry.ExpiryPolicy;
@@ -70,9 +69,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
     /** Not null is operation is mapped to single node. */
     private GridNearAtomicUpdateRequest req;
 
-    /** Keys to remap. */
-    private Collection<KeyCacheObject> remapKeys;
-
     /**
      * @param cctx Cache context.
      * @param cache Cache instance.
@@ -215,12 +211,9 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
 
             this.req = null;
 
-            if (res.remapKeys() != null) {
-                if (remapKeys == null)
-                    remapKeys = U.newHashSet(res.remapKeys().size());
-
-                remapKeys.addAll(res.remapKeys());
+            boolean remapKey = !F.isEmpty(res.remapKeys());
 
+            if (remapKey) {
                 if (mapErrTopVer == null || mapErrTopVer.compareTo(req.topologyVersion())
< 0)
                     mapErrTopVer = req.topologyVersion();
             }
@@ -259,7 +252,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
                 }
             }
 
-            if (remapKeys != null) {
+            if (remapKey) {
                 assert mapErrTopVer != null;
 
                 remapTopVer = cctx.shared().exchange().topologyVersion();
@@ -283,14 +276,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
                             new AffinityTopologyVersion(cause.topologyVersion().topologyVersion()
+ 1);
 
                         err = null;
-
-                        Collection<Object> failedKeys = cause.failedKeys();
-
-                        remapKeys = new ArrayList<>(failedKeys.size());
-
-                        for (Object key : failedKeys)
-                            remapKeys.add(cctx.toCacheKeyObject(key));
-
                         updVer = null;
                     }
                 }
@@ -332,8 +317,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
             }
 
             if (topLocked) {
-                assert !F.isEmpty(remapKeys) : remapKeys;
-
                 CachePartialUpdateCheckedException e =
                     new CachePartialUpdateCheckedException("Failed to update keys (retry
update if possible).");
 
@@ -342,7 +325,7 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
 
                 cause.retryReadyFuture(cctx.affinity().affinityReadyFuture(remapTopVer));
 
-                e.add(remapKeys, cause);
+                e.add(Collections.singleton(cctx.toCacheKeyObject(key)), cause);
 
                 onDone(e);
 
@@ -543,8 +526,6 @@ public class GridNearAtomicSingleUpdateFuture extends GridNearAtomicAbstractUpda
                 resCnt = 0;
 
                 req = singleReq0;
-
-                this.remapKeys = null;
             }
         }
         catch (Exception e) {


Mime
View raw message