ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [36/36] incubator-ignite git commit: # ignite-283-1: WIP.
Date Wed, 18 Feb 2015 10:07:04 GMT
# ignite-283-1: WIP.


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

Branch: refs/heads/ignite-283
Commit: 707a24b6f1a782556aaed78fb0d09d889f52be79
Parents: 099ecbf
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Feb 18 13:05:16 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Feb 18 13:05:16 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheEntryEx.java      |   8 +-
 .../processors/cache/GridCacheMapEntry.java     |  44 ++--
 .../cache/conflict/GridCacheConflictInfo.java   |  30 ---
 .../conflict/GridCacheConflictInnerUpdate.java  |  88 --------
 .../conflict/GridCacheNoTtlConflictInfo.java    |  99 ---------
 .../conflict/GridCacheTtlConflictInfo.java      | 138 ------------
 .../dht/atomic/GridDhtAtomicCache.java          |  94 ++++-----
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |   4 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  64 +++---
 .../dht/atomic/GridNearAtomicUpdateRequest.java | 208 ++++++++++++++-----
 .../distributed/near/GridNearAtomicCache.java   |  11 +-
 .../processors/cache/GridCacheTestEntryEx.java  |   6 +-
 12 files changed, 266 insertions(+), 528 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index 0502e2a..1ffed64 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.eviction.*;
-import org.apache.ignite.internal.processors.cache.conflict.*;
 import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.internal.processors.cache.transactions.*;
 import org.apache.ignite.internal.processors.cache.version.*;
@@ -427,7 +426,7 @@ public interface GridCacheEntryEx<K, V> {
      * @param conflictTtl Conflict TTL (if any).
      * @param conflictExpireTime Conflict expire time (if any).
      * @param conflictVer DR version (if any).
-     * @param drResolve If {@code true} then performs DR conflicts resolution.
+     * @param conflictResolve If {@code true} then performs conflicts resolution.
      * @param intercept If {@code true} then calls cache interceptor.
      * @param subjId Subject ID initiated this update.
      * @param taskName Task name.
@@ -456,7 +455,10 @@ public interface GridCacheEntryEx<K, V> {
         boolean checkVer,
         @Nullable IgnitePredicate<Cache.Entry<K, V>>[] filter,
         GridDrType drType,
-        GridCacheConflictInnerUpdate conflict,
+        long conflictTtl,
+        long conflictExpireTime,
+        @Nullable GridCacheVersion conflictVer,
+        boolean conflictResolve,
         boolean intercept,
         @Nullable UUID subjId,
         String taskName

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index d8a42cc..68782ff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.eviction.*;
 import org.apache.ignite.internal.managers.deployment.*;
-import org.apache.ignite.internal.processors.cache.conflict.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.*;
 import org.apache.ignite.internal.processors.cache.extras.*;
 import org.apache.ignite.internal.processors.cache.query.*;
@@ -1553,7 +1552,10 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V>
         boolean verCheck,
         @Nullable IgnitePredicate<Cache.Entry<K, V>>[] filter,
         GridDrType drType,
-        GridCacheConflictInnerUpdate conflict,
+        long conflictTtl,
+        long conflictExpireTime,
+        @Nullable GridCacheVersion conflictVer,
+        boolean conflictResolve,
         boolean intercept,
         @Nullable UUID subjId,
         String taskName
@@ -1586,7 +1588,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V>
             Object transformClo = null;
 
             // Request-level conflict resolution is needed, i.e. we do not know who will win in advance.
-            if (conflict.resolve()) {
+            if (conflictResolve) {
                 GridCacheVersion oldConflictVer = version().conflictVersion();
 
                 // Cache is conflict-enabled.
@@ -1603,13 +1605,13 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V>
                     }
 
                     // Get TTL and expire time (no special-purpose TTL values can be set for conflict).
-                    assert conflict.ttl() != CU.TTL_ZERO && conflict.ttl() != CU.TTL_NOT_CHANGED && conflict.ttl() >= 0;
-                    assert conflict.expireTime() != CU.EXPIRE_TIME_CALCULATE && conflict.expireTime() >= 0;
+                    assert conflictTtl != CU.TTL_ZERO && conflictTtl != CU.TTL_NOT_CHANGED && conflictTtl >= 0;
+                    assert conflictExpireTime != CU.EXPIRE_TIME_CALCULATE && conflictExpireTime >= 0;
 
                     // Prepare old and new entries for conflict resolution.
                     GridCacheVersionedEntryEx<K, V> oldEntry = versionedEntry();
                     GridCacheVersionedEntryEx<K, V> newEntry = new GridCachePlainVersionedEntry<>(key, (V)writeObj,
-                        conflict.ttl(), conflict.expireTime(), conflict.version());
+                        conflictTtl, conflictExpireTime, conflictVer);
 
                     // Resolve conflict.
                     conflictCtx = cctx.conflictResolve(oldEntry, newEntry, verCheck);
@@ -1619,12 +1621,12 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V>
                     // Use old value?
                     if (conflictCtx.isUseOld()) {
                         // Handle special case with atomic comparator.
-                        if (!isNew() &&                                                               // Not initial value,
-                            verCheck &&                                                               // and atomic version check,
-                            oldConflictVer.dataCenterId() == conflict.version().dataCenterId() &&     // and data centers are equal,
-                            ATOMIC_VER_COMPARATOR.compare(oldConflictVer, conflict.version()) == 0 && // and both versions are equal,
-                            cctx.writeThrough() &&                                                    // and store is enabled,
-                            primary)                                                                  // and we are primary.
+                        if (!isNew() &&                                                        // Not initial value,
+                            verCheck &&                                                        // and atomic version check,
+                            oldConflictVer.dataCenterId() == conflictVer.dataCenterId() &&     // and data centers are equal,
+                            ATOMIC_VER_COMPARATOR.compare(oldConflictVer, conflictVer) == 0 && // and both versions are equal,
+                            cctx.writeThrough() &&                                             // and store is enabled,
+                            primary)                                                           // and we are primary.
                         {
                             V val = rawGetOrUnmarshalUnlocked(false);
 
@@ -1655,7 +1657,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V>
                             writeObj = conflictCtx.mergeValue();
                             valBytes = null;
 
-                            conflict.clearVersion(); // Update will be considered as local.
+                            conflictVer = null;
                         }
                         else
                             assert conflictCtx.isUseNew();
@@ -1669,7 +1671,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V>
                 }
                 else
                     // Nullify conflict version on this update, so that we will use regular version during next updates.
-                    conflict.clearVersion();
+                    conflictVer = null;
             }
 
             // Perform version check only in case there was no explicit conflict resolution.
@@ -1841,29 +1843,25 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K, V>
             boolean hadVal = hasValueUnlocked();
 
             // Incorporate conflict version into new version if needed.
-            if (conflict.version() != null && conflict.version() != newVer)
+            if (conflictVer != null && conflictVer != newVer)
                 newVer = new GridCacheVersionEx(newVer.topologyVersion(),
                     newVer.globalTime(),
                     newVer.order(),
                     newVer.nodeOrder(),
                     newVer.dataCenterId(),
-                    conflict.version());
+                    conflictVer);
 
 
             if (op == GridCacheOperation.UPDATE) {
                 // Conflict context is null if there were no explicit conflict resolution.
                 if (conflictCtx == null) {
                     // Calculate TTL and expire time for local update.
-                    if (conflict.hasExplicitTtl()) {
+                    if (conflictTtl != CU.TTL_NOT_CHANGED) {
                         // TTL/expireTime was sent to us from node where conflict had been resolved.
-                        assert conflict.hasExplicitExpireTime() : conflict.expireTime();
-
-                        newTtl = conflict.ttl();
-                        newExpireTime = conflict.expireTime();
+                        newTtl = conflictTtl;
+                        newExpireTime = conflictExpireTime;
                     }
                     else {
-                        assert !conflict.hasExplicitExpireTime() : conflict.expireTime();
-
                         if (expiryPlc != null)
                             newTtl = hadVal ? expiryPlc.forUpdate() : expiryPlc.forCreate();
                         else

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheConflictInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheConflictInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheConflictInfo.java
deleted file mode 100644
index bc1621d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheConflictInfo.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.apache.ignite.internal.processors.cache.conflict;
-
-import org.apache.ignite.internal.processors.cache.version.*;
-
-import java.io.*;
-
-/**
- * Cache conflict info which is passed over the wire.
- */
-public interface GridCacheConflictInfo {
-    /**
-     * @return Version.
-     */
-    public GridCacheVersion version();
-
-    /**
-     * @return TTL.
-     */
-    public long ttl();
-
-    /**
-     * @return Expire time.
-     */
-    public long expireTime();
-
-    /**
-     * @return {@code True} if has expiration info.
-     */
-    public boolean hasExpirationInfo();
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheConflictInnerUpdate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheConflictInnerUpdate.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheConflictInnerUpdate.java
deleted file mode 100644
index 75b7e3b..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheConflictInnerUpdate.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.apache.ignite.internal.processors.cache.conflict;
-
-import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.jetbrains.annotations.*;
-
-/**
- * Conflict inner update info.
- */
-public class GridCacheConflictInnerUpdate {
-    /** Resolve flag. */
-    private final boolean resolve;
-
-    /** Version. */
-    private GridCacheVersion ver;
-
-    /** TTL. */
-    private final long ttl;
-
-    /** Expire time. */
-    private final long expireTime;
-
-    /**
-     * Conflict inner update info.
-     *
-     * @param resolve Resolve flag.
-     * @param ver Version.
-     * @param ttl TTL.
-     * @param expireTime Expire time.
-     */
-    public GridCacheConflictInnerUpdate(boolean resolve, GridCacheVersion ver, long ttl, long expireTime) {
-        // TODO: IGNITE-283: Add assertion for invariants.
-
-        this.resolve = resolve;
-        this.ver = ver;
-        this.ttl = ttl;
-        this.expireTime = expireTime;
-    }
-
-    /**
-     * @return Resolve flag.
-     */
-    public boolean resolve() {
-        return resolve;
-    }
-
-    /**
-     * @return Version.
-     */
-    @Nullable public GridCacheVersion version() {
-        return ver;
-    }
-
-    /**
-     * Clear version so that update will be considered local.
-     */
-    public void clearVersion() {
-        ver = null;
-    }
-
-    /*
-     * @return TTL.
-     */
-    public long ttl() {
-        return ttl;
-    }
-
-    /**
-     * @return {@code True} if explicit TTL is set.
-     */
-    public boolean hasExplicitTtl() {
-        return ttl != CU.TTL_NOT_CHANGED;
-    }
-
-    /**
-     * @return {@code True} if explicit expire time is set.
-     */
-    public boolean hasExplicitExpireTime() {
-        return expireTime != CU.EXPIRE_TIME_CALCULATE;
-    }
-
-    /**
-     * @return Expire time.
-     */
-    public long expireTime() {
-        return expireTime;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheNoTtlConflictInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheNoTtlConflictInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheNoTtlConflictInfo.java
deleted file mode 100644
index 90898b9..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheNoTtlConflictInfo.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.apache.ignite.internal.processors.cache.conflict;
-
-import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.plugin.extensions.communication.*;
-import sun.plugin2.message.*;
-
-import java.io.*;
-import java.nio.*;
-
-/**
- * Conflict info without TTL.
- */
-public class GridCacheNoTtlConflictInfo extends MessageAdapter implements GridCacheConflictInfo {
-    /** Version. */
-    private GridCacheVersion ver;
-
-    /**
-     * {@link Externalizable} support.
-     */
-    public GridCacheNoTtlConflictInfo() {
-        // No-op.
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param ver Version.
-     */
-    public GridCacheNoTtlConflictInfo(GridCacheVersion ver) {
-        this.ver = ver;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheVersion version() {
-        return ver;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long ttl() {
-        return CU.TTL_NOT_CHANGED;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long expireTime() {
-        return CU.EXPIRE_TIME_CALCULATE;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasExpirationInfo() {
-        return false;
-    }
-
-    @Override
-    public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
-        writer.setBuffer(buf);
-
-        if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
-                return false;
-
-            writer.onTypeWritten();
-        }
-
-        switch (writer.state()) {
-            case 0:
-                if (!writer.writeMessage("ver", ver))
-                    return false;
-
-                writer.incrementState();
-
-        }
-
-        return true;
-    }
-
-    @Override
-    public boolean readFrom(ByteBuffer buf) {
-        reader.setBuffer(buf);
-
-        switch (readState) {
-            case 0:
-                ver = reader.readMessage("ver");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                readState++;
-
-        }
-
-        return true;
-    }
-
-    @Override
-    public byte directType() {
-        return 0;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheTtlConflictInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheTtlConflictInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheTtlConflictInfo.java
deleted file mode 100644
index 395f505..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/conflict/GridCacheTtlConflictInfo.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package org.apache.ignite.internal.processors.cache.conflict;
-
-import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.plugin.extensions.communication.*;
-
-import java.io.*;
-import java.nio.*;
-
-/**
- * Conflict info with TTL.
- */
-public class GridCacheTtlConflictInfo extends MessageAdapter implements GridCacheConflictInfo {
-    /** Version. */
-    private GridCacheVersion ver;
-
-    /** TTL. */
-    private long ttl;
-
-    /** Expire time. */
-    private long expireTime;
-
-    /**
-     * {@link Externalizable} support.
-     */
-    public GridCacheTtlConflictInfo() {
-        // No-op.
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param ver Version.
-     * @param ttl TTL.
-     * @param expireTime Expire time.
-     */
-    public GridCacheTtlConflictInfo(GridCacheVersion ver, long ttl, long expireTime) {
-        assert ttl != CU.TTL_ZERO && ttl != CU.TTL_NOT_CHANGED;
-        assert expireTime != CU.EXPIRE_TIME_CALCULATE;
-
-        this.ver = ver;
-        this.ttl = ttl;
-        this.expireTime = expireTime;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheVersion version() {
-        return ver;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long ttl() {
-        return ttl;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long expireTime() {
-        return expireTime;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasExpirationInfo() {
-        return true;
-    }
-
-    @Override
-    public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
-        writer.setBuffer(buf);
-
-        if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
-                return false;
-
-            writer.onTypeWritten();
-        }
-
-        switch (writer.state()) {
-            case 0:
-                if (!writer.writeLong("expireTime", expireTime))
-                    return false;
-
-                writer.incrementState();
-
-            case 1:
-                if (!writer.writeLong("ttl", ttl))
-                    return false;
-
-                writer.incrementState();
-
-            case 2:
-                if (!writer.writeMessage("ver", ver))
-                    return false;
-
-                writer.incrementState();
-
-        }
-
-        return true;
-    }
-
-    @Override public boolean readFrom(ByteBuffer buf) {
-        reader.setBuffer(buf);
-
-        switch (readState) {
-            case 0:
-                expireTime = reader.readLong("expireTime");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                readState++;
-
-            case 1:
-                ttl = reader.readLong("ttl");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                readState++;
-
-            case 2:
-                ver = reader.readMessage("ver");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                readState++;
-
-        }
-
-        return true;
-    }
-
-    @Override
-    public byte directType() {
-        return 0;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/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 687d9c4..420b6f7 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
@@ -23,7 +23,6 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.conflict.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
@@ -1648,26 +1647,14 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                 if (entry == null)
                     continue;
 
-                GridCacheConflictInfo newConflictInfo = req.conflictInfo(i);
+                GridCacheVersion newConflictVer = req.conflictVersion(i);
+                long newConflictTtl = req.conflictTtl(i);
+                long newConflictExpireTime = req.conflictExpireTime(i);
 
-                GridCacheVersion newConflictVer;
-                long newConflictTtl;
-                long newConflictExpireTime;
+                assert !(newConflictVer instanceof GridCacheVersionEx) : newConflictVer;
 
-                if (newConflictInfo != null) {
-                    newConflictVer = newConflictInfo.version();
-                    newConflictTtl = newConflictInfo.ttl();
-                    newConflictExpireTime = newConflictInfo.expireTime();
-                }
-                else {
-                    newConflictVer = null;
-                    newConflictTtl = CU.TTL_NOT_CHANGED;
-                    newConflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
-                }
-
-                // Plain version is expected here.
-                assert newConflictInfo == null ||
-                    (newConflictInfo.version() != null && !(newConflictInfo.version() instanceof GridCacheVersionEx));
+                if (newConflictVer == null)
+                    newConflictVer = ver;
 
                 boolean primary = !req.fastMap() || ctx.affinity().primary(ctx.localNode(), entry.key(),
                     req.topologyVersion());
@@ -1701,8 +1688,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                     ctx.config().getAtomicWriteOrderMode() == CLOCK, // Check version in CLOCK mode on primary node.
                     req.filter(),
                     replicate ? primary ? DR_PRIMARY : DR_BACKUP : DR_NONE,
-                    new GridCacheConflictInnerUpdate(newConflictInfo != null, newConflictVer, newConflictTtl,
-                        newConflictExpireTime),
+                    newConflictTtl,
+                    newConflictExpireTime,
+                    newConflictVer,
+                    true,
                     intercept,
                     req.subjectId(),
                     taskName);
@@ -1717,14 +1706,12 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                     if (updRes.sendToDht()) { // Send to backups even in case of remove-remove scenarios.
                         GridCacheVersionConflictContext<K, V> conflictCtx = updRes.conflictResolveResult();
 
-                        if (conflictCtx != null) {
-                            assert newConflictInfo != null;
-
-                            if (conflictCtx.isMerge())
-                                newConflictVer = null; // Conflict version is discarded in case of merge.
+                        if (ctx == null)
+                            newConflictVer = null;
+                        else if (conflictCtx.isMerge()) {
+                            newConflictVer = null; // Conflict version is discarded in case of merge.
+                            newValBytes = null; // Value has been changed.
                         }
-                        else
-                            assert newConflictInfo == null;
 
                         EntryProcessor<K, V, ?> entryProcessor = null;
 
@@ -1734,7 +1721,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                         if (!readersOnly) {
                             dhtFut.addWriteEntry(entry,
                                 updRes.newValue(),
-                                updRes.newValueBytes(),
+                                newValBytes,
                                 entryProcessor,
                                 updRes.newTtl(),
                                 updRes.conflictExpireTime(),
@@ -1745,7 +1732,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                             dhtFut.addNearWriteEntries(filteredReaders,
                                 entry,
                                 updRes.newValue(),
-                                updRes.newValueBytes(),
+                                newValBytes,
                                 entryProcessor,
                                 updRes.newTtl(),
                                 updRes.conflictExpireTime());
@@ -1760,18 +1747,23 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                 if (hasNear) {
                     if (primary && updRes.sendToDht()) {
                         if (!ctx.affinity().belongs(node, entry.partition(), topVer)) {
+                            GridCacheVersionConflictContext<K, V> ctx = updRes.conflictResolveResult();
+
+                            if (ctx != null && ctx.isMerge())
+                                newValBytes = null;
+
                             // If put the same value as in request then do not need to send it back.
                             if (op == TRANSFORM || writeVal != updRes.newValue()) {
                                 res.addNearValue(i,
                                     updRes.newValue(),
-                                    updRes.newValueBytes(),
+                                    newValBytes,
                                     updRes.newTtl(),
                                     updRes.conflictExpireTime());
                             }
                             else
                                 res.addNearTtl(i, updRes.newTtl(), updRes.conflictExpireTime());
 
-                            if (updRes.newValue() != null || updRes.newValueBytes() != null) {
+                            if (updRes.newValue() != null || newValBytes != null) {
                                 IgniteInternalFuture<Boolean> f = entry.addReader(node.id(), req.messageId(), topVer);
 
                                 assert f == null : f;
@@ -1863,7 +1855,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
     ) {
         assert putMap == null ^ rmvKeys == null;
 
-        assert req.conflictInfos() == null : "Cannot be called when there are conflict entries in the batch.";
+        assert req.conflictVersions() == null : "Cannot be called when there are conflict entries in the batch.";
 
         long topVer = req.topologyVersion();
 
@@ -1968,7 +1960,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                         ctx.config().getAtomicWriteOrderMode() == CLOCK, // Check version in CLOCK mode on primary node.
                         null,
                         replicate ? primary ? DR_PRIMARY : DR_BACKUP : DR_NONE,
-                        new GridCacheConflictInnerUpdate(false, null, CU.TTL_NOT_CHANGED, CU.EXPIRE_TIME_CALCULATE),
+                        CU.TTL_NOT_CHANGED,
+                        CU.EXPIRE_TIME_CALCULATE,
+                        null,
+                        false,
                         false,
                         req.subjectId(),
                         taskName);
@@ -2266,8 +2261,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         Collection<GridCacheDrInfo<V>> drPutVals;
         Collection<GridCacheVersion> drRmvVals;
 
-        if (req.conflictInfos() == null) {
-            // This is regular PUT, i.e. no conflicts.
+        if (req.conflictVersions() == null) {
             vals = req.values();
 
             drPutVals = null;
@@ -2279,15 +2273,13 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
             drPutVals = new ArrayList<>(size);
 
             for (int i = 0; i < size; i++) {
-                GridCacheConflictInfo conflictInfo = req.conflictInfo(i);
-
-                assert conflictInfo != null;
+                long ttl = req.conflictTtl(i);
 
-                if (conflictInfo.hasExpirationInfo())
-                    drPutVals.add(new GridCacheDrExpirationInfo<>(req.value(i), conflictInfo.version(),
-                        conflictInfo.ttl(), conflictInfo.expireTime()));
+                if (ttl == CU.TTL_NOT_CHANGED)
+                    drPutVals.add(new GridCacheDrInfo<>(req.value(i), req.conflictVersion(i)));
                 else
-                    drPutVals.add(new GridCacheDrInfo<>(req.value(i), conflictInfo.version()));
+                    drPutVals.add(new GridCacheDrExpirationInfo<>(req.value(i), req.conflictVersion(i), ttl,
+                        req.conflictExpireTime(i)));
             }
 
             vals = null;
@@ -2296,16 +2288,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         else {
             assert req.operation() == DELETE;
 
-            List<GridCacheConflictInfo> conflictInfos = req.conflictInfos();
-
-            assert conflictInfos != null;
-
-            drRmvVals = F.viewReadOnly(conflictInfos, new IgniteClosure<GridCacheConflictInfo, GridCacheVersion>() {
-                    @Override public GridCacheVersion apply(GridCacheConflictInfo conflictInfo) {
-                        return conflictInfo.version();
-                    }
-                }
-            );
+            drRmvVals = req.conflictVersions();
 
             vals = null;
             drPutVals = null;
@@ -2489,7 +2472,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                             /*check version*/!req.forceTransformBackups(),
                             CU.<K, V>empty(),
                             replicate ? DR_BACKUP : DR_NONE,
-                            new GridCacheConflictInnerUpdate(false, req.conflictVersion(i), ttl, expireTime),
+                            ttl,
+                            expireTime,
+                            req.conflictVersion(i),
+                            false,
                             intercept,
                             req.subjectId(),
                             taskName);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/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
index 97163fc..dc07ff0 100644
--- 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
@@ -689,7 +689,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
         switch (writer.state()) {
             case 3:
-                if (!writer.writeMessage("drExpireTimes", drExpireTimes))
+                if (!writer.writeMessage("conflictExpireTimes", drExpireTimes))
                     return false;
 
                 writer.incrementState();
@@ -822,7 +822,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
         switch (readState) {
             case 3:
-                drExpireTimes = reader.readMessage("drExpireTimes");
+                drExpireTimes = reader.readMessage("conflictExpireTimes");
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/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 ad46728..f0d8c92 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
@@ -25,7 +25,6 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.managers.discovery.*;
 import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.conflict.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
 import org.apache.ignite.internal.processors.cache.dr.*;
@@ -521,31 +520,39 @@ public class GridNearAtomicUpdateFuture<K, V> extends GridFutureAdapter<Object>
             K key = F.first(keys);
 
             Object val;
-            GridCacheConflictInfo conflictInfo;
+            GridCacheVersion conflictVer;
+            long conflictTtl;
+            long conflictExpireTime;
 
             if (vals != null) {
                 // Regular PUT.
                 val = F.first(vals);
-                conflictInfo = null;
+                conflictVer = null;
+                conflictTtl = CU.TTL_NOT_CHANGED;
+                conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
             }
             else if (conflictPutVals != null) {
                 // Conflict PUT.
                 GridCacheDrInfo<V> conflictPutVal =  F.first(conflictPutVals);
 
                 val = conflictPutVal.value();
-                conflictInfo = create(conflictPutVal.version(), conflictPutVal.ttl(),
-                    conflictPutVal.expireTime());
+                conflictVer = conflictPutVal.version();
+                conflictTtl = conflictPutVal.ttl();
+                conflictExpireTime = conflictPutVal.expireTime();
             }
             else if (conflictRmvVals != null) {
                 // Conflict REMOVE.
                 val = null;
-                conflictInfo = create(F.first(conflictRmvVals), CU.TTL_NOT_CHANGED,
-                    CU.EXPIRE_TIME_CALCULATE);
+                conflictVer = F.first(conflictRmvVals);
+                conflictTtl = CU.TTL_NOT_CHANGED;
+                conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
             }
             else {
                 // Regular REMOVE.
                 val = null;
-                conflictInfo = null;
+                conflictVer = null;
+                conflictTtl = CU.TTL_NOT_CHANGED;
+                conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
             }
 
             // We still can get here if user pass map with single element.
@@ -596,7 +603,7 @@ public class GridNearAtomicUpdateFuture<K, V> extends GridFutureAdapter<Object>
                 subjId,
                 taskNameHash);
 
-            req.addUpdateEntry(key, val, conflictInfo, true);
+            req.addUpdateEntry(key, val, conflictTtl, conflictExpireTime, conflictVer, true);
 
             single = true;
 
@@ -640,11 +647,15 @@ public class GridNearAtomicUpdateFuture<K, V> extends GridFutureAdapter<Object>
                 }
 
                 Object val;
-                GridCacheConflictInfo conflictInfo;
+                GridCacheVersion conflictVer;
+                long conflictTtl;
+                long conflictExpireTime;
 
                 if (vals != null) {
                     val = it.next();
-                    conflictInfo = null;
+                    conflictVer = null;
+                    conflictTtl = CU.TTL_NOT_CHANGED;
+                    conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
 
                     if (val == null) {
                         NullPointerException err = new NullPointerException("Null value.");
@@ -658,17 +669,21 @@ public class GridNearAtomicUpdateFuture<K, V> extends GridFutureAdapter<Object>
                     GridCacheDrInfo<V> conflictPutVal =  conflictPutValsIt.next();
 
                     val = conflictPutVal.value();
-                    conflictInfo = create(conflictPutVal.version(), conflictPutVal.ttl(),
-                        conflictPutVal.expireTime());
+                    conflictVer = conflictPutVal.version();
+                    conflictTtl =  conflictPutVal.ttl();
+                    conflictExpireTime = conflictPutVal.expireTime();
                 }
                 else if (conflictRmvVals != null) {
                     val = null;
-                    conflictInfo = create(conflictRmvValsIt.next(), CU.TTL_NOT_CHANGED,
-                        CU.EXPIRE_TIME_CALCULATE);
+                    conflictVer = conflictRmvValsIt.next();
+                    conflictTtl = CU.TTL_NOT_CHANGED;
+                    conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
                 }
                 else {
                     val = null;
-                    conflictInfo = null;
+                    conflictVer = null;
+                    conflictTtl = CU.TTL_NOT_CHANGED;
+                    conflictExpireTime = CU.EXPIRE_TIME_CALCULATE;
                 }
 
                 if (val == null && op != GridCacheOperation.DELETE)
@@ -716,7 +731,7 @@ public class GridNearAtomicUpdateFuture<K, V> extends GridFutureAdapter<Object>
                             "Invalid mapping state [old=" + old + ", remap=" + remap + ']';
                     }
 
-                    mapped.addUpdateEntry(key, val, conflictInfo, i == 0);
+                    mapped.addUpdateEntry(key, val, conflictTtl, conflictExpireTime, conflictVer, i == 0);
 
                     i++;
                 }
@@ -738,21 +753,6 @@ public class GridNearAtomicUpdateFuture<K, V> extends GridFutureAdapter<Object>
         doUpdate(pendingMappings);
     }
 
-    // TODO: IGNITE-283: Remove.
-    public static GridCacheConflictInfo create(GridCacheVersion ver, long ttl, long expireTime) {
-        if (ttl == CU.TTL_NOT_CHANGED) {
-            assert expireTime == CU.EXPIRE_TIME_CALCULATE;
-
-            return new GridCacheNoTtlConflictInfo(ver);
-        }
-        else {
-            assert ttl != CU.TTL_ZERO && ttl >= 0;
-            assert expireTime != CU.EXPIRE_TIME_CALCULATE && expireTime >= 0;
-
-            return new GridCacheTtlConflictInfo(ver, ttl, expireTime);
-        }
-    }
-
     /**
      * Maps key to nodes. If filters are absent and operation is not TRANSFORM, then we can assign version on near
      * node and send updates in parallel to all participating nodes.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/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
index d3aceab..a734b1d 100644
--- 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
@@ -21,9 +21,9 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.conflict.*;
 import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.internal.processors.cache.version.*;
+import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
@@ -95,9 +95,15 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
     /** Entry processor arguments bytes. */
     private byte[][] invokeArgsBytes;
 
-    /** DR versions. */
-    @GridDirectCollection(GridCacheConflictInfo.class)
-    private List<GridCacheConflictInfo> conflictInfos;
+    /** Conflict versions. */
+    @GridDirectCollection(GridCacheVersion.class)
+    private List<GridCacheVersion> conflictVers;
+
+    /** Conflict TTLs. */
+    private GridLongList conflictTtls;
+
+    /** Conflict expire times. */
+    private GridLongList conflictExpireTimes;
 
     /** Return value flag. */
     private boolean retval;
@@ -284,12 +290,16 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
     /**
      * @param key Key to add.
      * @param val Optional update value.
-     * @param conflictInfo Conflict info (optional).
+     * @param conflictTtl Conflict TTL (optional).
+     * @param conflictExpireTime Conflict expire time (optional).
+     * @param conflicVer Conflict version (optional).
      * @param primary If given key is primary on this mapping.
      */
     public void addUpdateEntry(K key,
         @Nullable Object val,
-        @Nullable GridCacheConflictInfo conflictInfo,
+        long conflictTtl,
+        long conflictExpireTime,
+        @Nullable GridCacheVersion conflicVer,
         boolean primary) {
         assert val != null || op == DELETE;
         assert op != TRANSFORM || val instanceof EntryProcessor;
@@ -299,19 +309,41 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
         hasPrimary |= primary;
 
-        // In case there is no DR, do not create the list.
-        if (conflictInfo != null) {
-            if (conflictInfos == null) {
-                conflictInfos = new ArrayList<>();
+        // In case there is no conflict, do not create the list.
+        if (conflicVer != null) {
+            if (conflictVers == null) {
+                conflictVers = new ArrayList<>();
+
+                for (int i = 0; i < keys.size() - 1; i++)
+                    conflictVers.add(null);
+            }
+
+            conflictVers.add(conflicVer);
+        }
+        else if (conflictVers != null)
+            conflictVers.add(null);
+
+        if (conflictTtl >= 0) {
+            if (conflictTtls == null) {
+                conflictTtls = new GridLongList(keys.size());
 
                 for (int i = 0; i < keys.size() - 1; i++)
-                    conflictInfos.add(null);
+                    conflictTtls.add(CU.TTL_NOT_CHANGED);
             }
 
-            conflictInfos.add(conflictInfo);
+            conflictTtls.add(conflictTtl);
+        }
+
+        if (conflictExpireTime >= 0) {
+            if (conflictExpireTimes == null) {
+                conflictExpireTimes = new GridLongList(keys.size());
+
+                for (int i = 0; i < keys.size() - 1; i++)
+                    conflictExpireTimes.add(CU.EXPIRE_TIME_CALCULATE);
+            }
+
+            conflictExpireTimes.add(conflictExpireTime);
         }
-        else if (conflictInfos != null)
-            conflictInfos.add(null);
     }
 
     /**
@@ -346,7 +378,6 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
      * @param idx Key index.
      * @return Value.
      */
-    @SuppressWarnings("unchecked")
     public V value(int idx) {
         assert op == UPDATE : op;
 
@@ -357,7 +388,6 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
      * @param idx Key index.
      * @return Entry processor.
      */
-    @SuppressWarnings("unchecked")
     public EntryProcessor<K, V, ?> entryProcessor(int idx) {
         assert op == TRANSFORM : op;
 
@@ -404,25 +434,67 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
     /**
      * @return DR versions.
      */
-    @Nullable public List<GridCacheConflictInfo> conflictInfos() {
-        return conflictInfos;
+    @Nullable public List<GridCacheVersion> conflictVersions() {
+        return conflictVers;
     }
 
     /**
      * @param idx Index.
      * @return DR version.
      */
-    @Nullable public GridCacheConflictInfo conflictInfo(int idx) {
-        if (conflictInfos != null) {
-            assert idx >= 0 && idx < conflictInfos.size();
+    @Nullable public GridCacheVersion conflictVersion(int idx) {
+        if (conflictVers != null) {
+            assert idx >= 0 && idx < conflictVers.size();
 
-            return conflictInfos.get(idx);
+            return conflictVers.get(idx);
         }
 
         return null;
     }
 
     /**
+     * @return Conflict TTLs.
+     */
+    @Nullable public GridLongList conflictTtls() {
+        return conflictTtls;
+    }
+
+    /**
+     * @param idx Index.
+     * @return Conflict TTL.
+     */
+    public long conflictTtl(int idx) {
+        if (conflictTtls != null) {
+            assert idx >= 0 && idx < conflictTtls.size();
+
+            return conflictTtls.get(idx);
+        }
+
+        return CU.TTL_NOT_CHANGED;
+    }
+
+    /**
+     * @return Conflict expire times.
+     */
+    @Nullable public GridLongList conflictExpireTimes() {
+        return conflictExpireTimes;
+    }
+
+    /**
+     * @param idx Index.
+     * @return DR TTL.
+     */
+    public long conflictExpireTime(int idx) {
+        if (conflictExpireTimes != null) {
+            assert idx >= 0 && idx < conflictExpireTimes.size();
+
+            return conflictExpireTimes.get(idx);
+        }
+
+        return CU.EXPIRE_TIME_CALCULATE;
+    }
+
+    /**
      * @return Flag indicating whether this request contains primary keys.
      */
     public boolean hasPrimary() {
@@ -486,102 +558,114 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
         switch (writer.state()) {
             case 3:
-                if (!writer.writeCollection("conflictInfos", conflictInfos, Type.MSG))
+                if (!writer.writeMessage("conflictExpireTimes", conflictExpireTimes))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeByteArray("expiryPlcBytes", expiryPlcBytes))
+                if (!writer.writeMessage("conflictTtls", conflictTtls))
                     return false;
 
                 writer.incrementState();
 
             case 5:
-                if (!writer.writeBoolean("fastMap", fastMap))
+                if (!writer.writeCollection("conflictVers", conflictVers, Type.MSG))
                     return false;
 
                 writer.incrementState();
 
             case 6:
-                if (!writer.writeObjectArray("filterBytes", filterBytes, Type.BYTE_ARR))
+                if (!writer.writeByteArray("expiryPlcBytes", expiryPlcBytes))
                     return false;
 
                 writer.incrementState();
 
             case 7:
-                if (!writer.writeBoolean("forceTransformBackups", forceTransformBackups))
+                if (!writer.writeBoolean("fastMap", fastMap))
                     return false;
 
                 writer.incrementState();
 
             case 8:
-                if (!writer.writeMessage("futVer", futVer))
+                if (!writer.writeObjectArray("filterBytes", filterBytes, Type.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 9:
-                if (!writer.writeBoolean("hasPrimary", hasPrimary))
+                if (!writer.writeBoolean("forceTransformBackups", forceTransformBackups))
                     return false;
 
                 writer.incrementState();
 
             case 10:
-                if (!writer.writeObjectArray("invokeArgsBytes", invokeArgsBytes, Type.BYTE_ARR))
+                if (!writer.writeMessage("futVer", futVer))
                     return false;
 
                 writer.incrementState();
 
             case 11:
-                if (!writer.writeCollection("keyBytes", keyBytes, Type.BYTE_ARR))
+                if (!writer.writeBoolean("hasPrimary", hasPrimary))
                     return false;
 
                 writer.incrementState();
 
             case 12:
-                if (!writer.writeByte("op", op != null ? (byte)op.ordinal() : -1))
+                if (!writer.writeObjectArray("invokeArgsBytes", invokeArgsBytes, Type.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 13:
-                if (!writer.writeBoolean("retval", retval))
+                if (!writer.writeCollection("keyBytes", keyBytes, Type.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 14:
-                if (!writer.writeUuid("subjId", subjId))
+                if (!writer.writeByte("op", op != null ? (byte)op.ordinal() : -1))
                     return false;
 
                 writer.incrementState();
 
             case 15:
-                if (!writer.writeByte("syncMode", syncMode != null ? (byte)syncMode.ordinal() : -1))
+                if (!writer.writeBoolean("retval", retval))
                     return false;
 
                 writer.incrementState();
 
             case 16:
-                if (!writer.writeInt("taskNameHash", taskNameHash))
+                if (!writer.writeUuid("subjId", subjId))
                     return false;
 
                 writer.incrementState();
 
             case 17:
-                if (!writer.writeLong("topVer", topVer))
+                if (!writer.writeByte("syncMode", syncMode != null ? (byte)syncMode.ordinal() : -1))
                     return false;
 
                 writer.incrementState();
 
             case 18:
-                if (!writer.writeMessage("updateVer", updateVer))
+                if (!writer.writeInt("taskNameHash", taskNameHash))
                     return false;
 
                 writer.incrementState();
 
             case 19:
+                if (!writer.writeLong("topVer", topVer))
+                    return false;
+
+                writer.incrementState();
+
+            case 20:
+                if (!writer.writeMessage("updateVer", updateVer))
+                    return false;
+
+                writer.incrementState();
+
+            case 21:
                 if (!writer.writeCollection("valBytes", valBytes, Type.MSG))
                     return false;
 
@@ -601,7 +685,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
         switch (readState) {
             case 3:
-                conflictInfos = reader.readCollection("conflictInfos", Type.MSG);
+                conflictExpireTimes = reader.readMessage("conflictExpireTimes");
 
                 if (!reader.isLastRead())
                     return false;
@@ -609,7 +693,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 readState++;
 
             case 4:
-                expiryPlcBytes = reader.readByteArray("expiryPlcBytes");
+                conflictTtls = reader.readMessage("conflictTtls");
 
                 if (!reader.isLastRead())
                     return false;
@@ -617,7 +701,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 readState++;
 
             case 5:
-                fastMap = reader.readBoolean("fastMap");
+                conflictVers = reader.readCollection("conflictVers", Type.MSG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -625,7 +709,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 readState++;
 
             case 6:
-                filterBytes = reader.readObjectArray("filterBytes", Type.BYTE_ARR, byte[].class);
+                expiryPlcBytes = reader.readByteArray("expiryPlcBytes");
 
                 if (!reader.isLastRead())
                     return false;
@@ -633,7 +717,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 readState++;
 
             case 7:
-                forceTransformBackups = reader.readBoolean("forceTransformBackups");
+                fastMap = reader.readBoolean("fastMap");
 
                 if (!reader.isLastRead())
                     return false;
@@ -641,7 +725,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 readState++;
 
             case 8:
-                futVer = reader.readMessage("futVer");
+                filterBytes = reader.readObjectArray("filterBytes", Type.BYTE_ARR, byte[].class);
 
                 if (!reader.isLastRead())
                     return false;
@@ -649,7 +733,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 readState++;
 
             case 9:
-                hasPrimary = reader.readBoolean("hasPrimary");
+                forceTransformBackups = reader.readBoolean("forceTransformBackups");
 
                 if (!reader.isLastRead())
                     return false;
@@ -657,7 +741,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 readState++;
 
             case 10:
-                invokeArgsBytes = reader.readObjectArray("invokeArgsBytes", Type.BYTE_ARR, byte[].class);
+                futVer = reader.readMessage("futVer");
 
                 if (!reader.isLastRead())
                     return false;
@@ -665,7 +749,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 readState++;
 
             case 11:
-                keyBytes = reader.readCollection("keyBytes", Type.BYTE_ARR);
+                hasPrimary = reader.readBoolean("hasPrimary");
 
                 if (!reader.isLastRead())
                     return false;
@@ -673,6 +757,22 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 readState++;
 
             case 12:
+                invokeArgsBytes = reader.readObjectArray("invokeArgsBytes", Type.BYTE_ARR, byte[].class);
+
+                if (!reader.isLastRead())
+                    return false;
+
+                readState++;
+
+            case 13:
+                keyBytes = reader.readCollection("keyBytes", Type.BYTE_ARR);
+
+                if (!reader.isLastRead())
+                    return false;
+
+                readState++;
+
+            case 14:
                 byte opOrd;
 
                 opOrd = reader.readByte("op");
@@ -684,7 +784,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                 readState++;
 
-            case 13:
+            case 15:
                 retval = reader.readBoolean("retval");
 
                 if (!reader.isLastRead())
@@ -692,7 +792,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                 readState++;
 
-            case 14:
+            case 16:
                 subjId = reader.readUuid("subjId");
 
                 if (!reader.isLastRead())
@@ -700,7 +800,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                 readState++;
 
-            case 15:
+            case 17:
                 byte syncModeOrd;
 
                 syncModeOrd = reader.readByte("syncMode");
@@ -712,7 +812,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                 readState++;
 
-            case 16:
+            case 18:
                 taskNameHash = reader.readInt("taskNameHash");
 
                 if (!reader.isLastRead())
@@ -720,7 +820,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                 readState++;
 
-            case 17:
+            case 19:
                 topVer = reader.readLong("topVer");
 
                 if (!reader.isLastRead())
@@ -728,7 +828,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                 readState++;
 
-            case 18:
+            case 20:
                 updateVer = reader.readMessage("updateVer");
 
                 if (!reader.isLastRead())
@@ -736,7 +836,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                 readState++;
 
-            case 19:
+            case 21:
                 valBytes = reader.readCollection("valBytes", Type.MSG);
 
                 if (!reader.isLastRead())

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index 5001810..3a458f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
 import org.apache.ignite.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.conflict.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
 import org.apache.ignite.internal.processors.cache.dr.*;
@@ -235,7 +234,10 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
                         /*check version*/true,
                         CU.<K, V>empty(),
                         DR_NONE,
-                        new GridCacheConflictInnerUpdate(false, null, ttl, expireTime),
+                        ttl,
+                        expireTime,
+                        null,
+                        false,
                         false,
                         subjId,
                         taskName);
@@ -332,7 +334,10 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
                             /*check version*/!req.forceTransformBackups(),
                             CU.<K, V>empty(),
                             DR_NONE,
-                            new GridCacheConflictInnerUpdate(false, null, ttl, expireTime),
+                            ttl,
+                            expireTime,
+                            null,
+                            false,
                             intercept,
                             req.subjectId(),
                             taskName);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/707a24b6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
index 2321f09..28e0d76 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.eviction.*;
-import org.apache.ignite.internal.processors.cache.conflict.*;
 import org.apache.ignite.internal.processors.cache.transactions.*;
 import org.apache.ignite.internal.processors.cache.version.*;
 import org.apache.ignite.internal.processors.dr.*;
@@ -479,7 +478,10 @@ public class GridCacheTestEntryEx<K, V> extends GridMetadataAwareAdapter impleme
         boolean checkVer,
         @Nullable IgnitePredicate<Cache.Entry<K, V>>[] filter,
         GridDrType drType,
-        GridCacheConflictInnerUpdate conflict,
+        long conflictTtl,
+        long conflictExpireTime,
+        @Nullable GridCacheVersion conflictVer,
+        boolean conflictResolve,
         boolean intercept,
         UUID subjId,
         String taskName) throws IgniteCheckedException,


Mime
View raw message