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/04/01 13:11:56 UTC

[1/2] ignite git commit: IGNITE-2925: Fixed conflict resolution in ATOMIC cache.

Repository: ignite
Updated Branches:
  refs/heads/ignite-2931 1e343f23a -> 71ab05df0


IGNITE-2925: Fixed conflict resolution in ATOMIC cache.


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

Branch: refs/heads/ignite-2931
Commit: 1aa2a2baf9f3499f815f7a6865a8bf71273ecf9a
Parents: 42048c2
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Apr 1 14:06:41 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Apr 1 14:06:41 2016 +0300

----------------------------------------------------------------------
 .../dht/atomic/GridDhtAtomicCache.java          | 28 +++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1aa2a2ba/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 f85862d..1797acd 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
@@ -1062,6 +1062,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         @Nullable final CacheEntryPredicate[] filter,
         boolean waitTopFut
     ) {
+        CacheOperationContext opCtx = ctx.operationContextPerCall();
+
         GridCacheOperation op;
         Collection vals;
 
@@ -1078,7 +1080,27 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
             vals = null;
         }
 
-        CacheOperationContext opCtx = ctx.operationContextPerCall();
+        GridCacheDrInfo conflictPutVal = null;
+        GridCacheVersion conflictRmvVer = null;
+
+        if (opCtx != null && opCtx.hasDataCenterId()) {
+            Byte dcId = opCtx.dataCenterId();
+
+            assert dcId != null;
+
+            if (op == UPDATE) {
+                conflictPutVal = new GridCacheDrInfo(ctx.toCacheObject(val), ctx.versions().next(dcId));
+
+                vals = null;
+            }
+            else if (op == GridCacheOperation.TRANSFORM) {
+                conflictPutVal = new GridCacheDrInfo(proc, ctx.versions().next(dcId));
+
+                vals = null;
+            }
+            else
+                conflictRmvVer = ctx.versions().next(dcId);
+        }
 
         return new GridNearAtomicUpdateFuture(
             ctx,
@@ -1088,8 +1110,8 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
             Collections.singletonList(key),
             vals,
             invokeArgs,
-            null,
-            null,
+            conflictPutVal != null ? Collections.singleton(conflictPutVal) : null,
+            conflictRmvVer != null ? Collections.singleton(conflictRmvVer) : null,
             retval,
             false,
             opCtx != null ? opCtx.expiry() : null,


[2/2] ignite git commit: Merge branch 'master' into ignite-2931

Posted by vo...@apache.org.
Merge branch 'master' into ignite-2931


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

Branch: refs/heads/ignite-2931
Commit: 71ab05df05e3d68fb4d49cb1f34bfbd7ac6ca518
Parents: 1e343f2 1aa2a2b
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Apr 1 14:08:28 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Apr 1 14:08:28 2016 +0300

----------------------------------------------------------------------
 .../dht/atomic/GridDhtAtomicCache.java          | 28 +++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/71ab05df/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 3b7d0ff,1797acd..1b5b8ad
--- 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
@@@ -1048,9 -1059,11 +1048,11 @@@ public class GridDhtAtomicCache<K, V> e
          @Nullable EntryProcessor proc,
          @Nullable Object[] invokeArgs,
          boolean retval,
 -        @Nullable final CacheEntryPredicate[] filter,
 +        @Nullable CacheEntryPredicate filter,
          boolean waitTopFut
      ) {
+         CacheOperationContext opCtx = ctx.operationContextPerCall();
+ 
          GridCacheOperation op;
          Collection vals;