You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by nt...@apache.org on 2016/04/04 20:38:34 UTC
[28/37] ignite git commit: IGNITE-2925: Fixed conflict resolution in
ATOMIC cache.
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-2004
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,