ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-4768
Date Tue, 07 Mar 2017 12:29:14 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-4768 905637926 -> ca67537f3


ignite-4768


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

Branch: refs/heads/ignite-4768
Commit: ca67537f3aa0042bcf00afcf81bb99012c0f9231
Parents: 9056379
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Mar 7 15:29:06 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Mar 7 15:29:06 2017 +0300

----------------------------------------------------------------------
 .../internal/binary/BinaryObjectImpl.java       |  16 +-
 .../processors/cache/KeyCacheObjectImpl.java    |  65 +++++-
 .../distributed/GridDistributedLockRequest.java |  26 +--
 .../GridDistributedTxPrepareRequest.java        | 191 +++++++++--------
 .../GridDistributedUnlockRequest.java           |  18 +-
 .../distributed/dht/GridDhtLockRequest.java     |  16 +-
 .../dht/GridDhtTxPrepareRequest.java            | 118 +++--------
 .../distributed/dht/GridDhtUnlockRequest.java   |  15 +-
 .../distributed/near/GridNearGetRequest.java    |  55 ++---
 .../distributed/near/GridNearLockRequest.java   |  16 +-
 .../near/GridNearSingleGetRequest.java          |  46 ++---
 .../near/GridNearTxPrepareRequest.java          | 207 +++++++------------
 .../distributed/near/GridNearUnlockRequest.java |  20 +-
 .../cache/transactions/IgniteTxEntry.java       |  22 --
 .../cache/transactions/IgniteTxHandler.java     |   2 +-
 .../IgniteCacheObjectProcessorImpl.java         |  18 +-
 ...eCacheContinuousQueryImmutableEntryTest.java |   2 +-
 .../file/GridFileSwapSpaceSpiSelfTest.java      |   2 +-
 18 files changed, 309 insertions(+), 546 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java
index 7a81659..6b88158 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java
@@ -74,7 +74,6 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
     private boolean detachAllowed;
 
     /** */
-    @GridDirectTransient
     private int part = -1;
 
     /**
@@ -561,7 +560,6 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
 
         start = in.readInt();
     }
-
     /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
@@ -584,6 +582,12 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
                 writer.incrementState();
 
             case 1:
+                if (!writer.writeInt("part", part))
+                    return false;
+
+                writer.incrementState();
+
+            case 2:
                 if (!writer.writeInt("start", detachAllowed ? 0 : start))
                     return false;
 
@@ -611,6 +615,14 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
                 reader.incrementState();
 
             case 1:
+                part = reader.readInt("part");
+
+                if (!reader.isLastRead())
+                    return false;
+
+                reader.incrementState();
+
+            case 2:
                 start = reader.readInt("start");
 
                 if (!reader.isLastRead())

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
index 146e554..4f8570c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/KeyCacheObjectImpl.java
@@ -17,8 +17,10 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import java.nio.ByteBuffer;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.GridDirectTransient;
+import org.apache.ignite.plugin.extensions.communication.MessageReader;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -29,7 +31,6 @@ public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheOb
     private static final long serialVersionUID = 0L;
 
     /** */
-    @GridDirectTransient
     private int part = -1;
 
     /**
@@ -42,14 +43,6 @@ public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheOb
     /**
      * @param val Value.
      * @param valBytes Value bytes.
-     */
-    public KeyCacheObjectImpl(Object val, byte[] valBytes) {
-        this(val, valBytes, -1);
-    }
-
-    /**
-     * @param val Value.
-     * @param valBytes Value bytes.
      * @param part Partition.
      */
     public KeyCacheObjectImpl(Object val, byte[] valBytes, int part) {
@@ -130,7 +123,57 @@ public class KeyCacheObjectImpl extends CacheObjectAdapter implements KeyCacheOb
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 1;
+        return 2;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
+        reader.setBuffer(buf);
+
+        if (!reader.beforeMessageRead())
+            return false;
+
+        if (!super.readFrom(buf, reader))
+            return false;
+
+        switch (reader.state()) {
+            case 1:
+                part = reader.readInt("part");
+
+                if (!reader.isLastRead())
+                    return false;
+
+                reader.incrementState();
+
+        }
+
+        return reader.afterMessageRead(KeyCacheObjectImpl.class);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
+        writer.setBuffer(buf);
+
+        if (!super.writeTo(buf, writer))
+            return false;
+
+        if (!writer.isHeaderWritten()) {
+            if (!writer.writeHeader(directType(), fieldsCount()))
+                return false;
+
+            writer.onHeaderWritten();
+        }
+
+        switch (writer.state()) {
+            case 1:
+                if (!writer.writeInt("part", part))
+                    return false;
+
+                writer.incrementState();
+
+        }
+
+        return true;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
index a671296..48c01f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -79,10 +79,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
     @GridDirectCollection(KeyCacheObject.class)
     private List<KeyCacheObject> keys;
 
-    /** Partition IDs of keys to lock. */
-    @GridDirectCollection(int.class)
-    protected List<Integer> partIds;
-
     /** Array indicating whether value should be returned for a key. */
     @GridToStringInclude
     private boolean[] retVals;
@@ -226,13 +222,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
     }
 
     /**
-     * @return Return flags.
-     */
-    public boolean[] returnFlags() {
-        return retVals;
-    }
-
-    /**
      * Sets skip store flag value.
      *
      * @param skipStore Skip store flag.
@@ -289,15 +278,11 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
         boolean retVal,
         GridCacheContext ctx
     ) throws IgniteCheckedException {
-        if (keys == null) {
+        if (keys == null)
             keys = new ArrayList<>(keysCount());
-            partIds = new ArrayList<>(keysCount());
-        }
 
         keys.add(key);
 
-        partIds.add(key.partition());
-
         retVals[idx] = retVal;
 
         idx++;
@@ -312,7 +297,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
 
     /** {@inheritDoc} */
     @Override public int partition() {
-        return partIds != null && !partIds.isEmpty() ? partIds.get(0) : -1;
+        return keys != null && !keys.isEmpty() ? keys.get(0).partition() : -1;
     }
 
     /**
@@ -344,13 +329,6 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
         GridCacheContext cctx = ctx.cacheContext(cacheId);
 
         finishUnmarshalCacheObjects(keys, cctx, ldr);
-
-        if (partIds != null && !partIds.isEmpty()) {
-            assert partIds.size() == keys.size();
-
-            for (int i = 0; i < keys.size(); i++)
-                keys.get(i).partition(partIds.get(i));
-        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
index 5e1499c..aaef258 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
@@ -44,7 +44,6 @@ import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteProductVersion;
 import org.apache.ignite.plugin.extensions.communication.MessageCollectionItemType;
 import org.apache.ignite.plugin.extensions.communication.MessageReader;
 import org.apache.ignite.plugin.extensions.communication.MessageWriter;
@@ -60,18 +59,30 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** Version in which direct marshalling of tx nodes was introduced. */
-    public static final IgniteProductVersion TX_NODES_DIRECT_MARSHALLABLE_SINCE = IgniteProductVersion.fromString("1.5.0");
+    /** */
+    private static final int NEED_RETURN_VALUE_FLAG_MASK = 0x01;
+
+    /** */
+    private static final int INVALIDATE_FLAG_MASK = 0x02;
+
+    /** */
+    private static final int ONE_PHASE_COMMIT_FLAG_MASK = 0x04;
+
+    /** */
+    private static final int LAST_REQ_FLAG_MASK = 0x08;
+
+    /** */
+    private static final int SYSTEM_TX_FLAG_MASK = 0x10;
 
     /** Collection to message converter. */
-    public static final C1<Collection<UUID>, UUIDCollectionMessage> COL_TO_MSG = new C1<Collection<UUID>, UUIDCollectionMessage>() {
+    private static final C1<Collection<UUID>, UUIDCollectionMessage> COL_TO_MSG = new C1<Collection<UUID>, UUIDCollectionMessage>() {
         @Override public UUIDCollectionMessage apply(Collection<UUID> uuids) {
             return new UUIDCollectionMessage(uuids);
         }
     };
 
     /** Message to collection converter. */
-    public static final C1<UUIDCollectionMessage, Collection<UUID>> MSG_TO_COL = new C1<UUIDCollectionMessage, Collection<UUID>>() {
+    private static final C1<UUIDCollectionMessage, Collection<UUID>> MSG_TO_COL = new C1<UUIDCollectionMessage, Collection<UUID>>() {
         @Override public Collection<UUID> apply(UUIDCollectionMessage msg) {
             return msg.uuids();
         }
@@ -97,10 +108,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
     @GridToStringInclude
     private long timeout;
 
-    /** Invalidation flag. */
-    @GridToStringInclude
-    private boolean invalidate;
-
     /** Transaction read set. */
     @GridToStringInclude
     @GridDirectCollection(IgniteTxEntry.class)
@@ -135,15 +142,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
     @GridDirectMap(keyType = UUID.class, valueType = UUIDCollectionMessage.class)
     private Map<UUID, UUIDCollectionMessage> txNodesMsg;
 
-    /** */
-    private byte[] txNodesBytes;
-
-    /** One phase commit flag. */
-    private boolean onePhaseCommit;
-
-    /** System flag. */
-    private boolean sys;
-
     /** IO policy. */
     private byte plc;
 
@@ -151,6 +149,9 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
     @GridDirectTransient
     private IgniteTxState txState;
 
+    /** */
+    private byte flags;
+
     /**
      * Required by {@link Externalizable}.
      */
@@ -173,6 +174,8 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
         @Nullable Collection<IgniteTxEntry> reads,
         Collection<IgniteTxEntry> writes,
         Map<UUID, Collection<UUID>> txNodes,
+        boolean retVal,
+        boolean last,
         boolean onePhaseCommit,
         boolean addDepInfo
     ) {
@@ -182,16 +185,37 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
         threadId = tx.threadId();
         concurrency = tx.concurrency();
         isolation = tx.isolation();
-        invalidate = tx.isInvalidate();
         txSize = tx.size();
-        sys = tx.system();
         plc = tx.ioPolicy();
 
         this.timeout = timeout;
         this.reads = reads;
         this.writes = writes;
         this.txNodes = txNodes;
-        this.onePhaseCommit = onePhaseCommit;
+
+        setFlag(tx.system(), SYSTEM_TX_FLAG_MASK);
+
+        setFlag(retVal, NEED_RETURN_VALUE_FLAG_MASK);
+
+        setFlag(tx.isInvalidate(), INVALIDATE_FLAG_MASK);
+
+        setFlag(onePhaseCommit, ONE_PHASE_COMMIT_FLAG_MASK);
+
+        setFlag(last, LAST_REQ_FLAG_MASK);
+    }
+
+    /**
+     * @return Flag indicating whether transaction needs return value.
+     */
+    public final boolean needReturnValue() {
+        return isFlag(NEED_RETURN_VALUE_FLAG_MASK);
+    }
+
+    /**
+     * @param retVal Need return value.
+     */
+    public final void needReturnValue(boolean retVal) {
+        setFlag(retVal, NEED_RETURN_VALUE_FLAG_MASK);
     }
 
     /**
@@ -204,8 +228,8 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
     /**
      * @return System flag.
      */
-    public boolean system() {
-        return sys;
+    public final boolean system() {
+        return isFlag(SYSTEM_TX_FLAG_MASK);
     }
 
     /**
@@ -253,7 +277,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
      * @return Invalidate flag.
      */
     public boolean isInvalidate() {
-        return invalidate;
+        return isFlag(INVALIDATE_FLAG_MASK);
     }
 
     /**
@@ -316,7 +340,14 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
      * @return One phase commit flag.
      */
     public boolean onePhaseCommit() {
-        return onePhaseCommit;
+        return isFlag(ONE_PHASE_COMMIT_FLAG_MASK);
+    }
+
+    /**
+     * @return {@code True} if this is last prepare request for node.
+     */
+    public boolean last() {
+        return isFlag(LAST_REQ_FLAG_MASK);
     }
 
     /** {@inheritDoc} */
@@ -351,15 +382,8 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
             dhtVerVals = dhtVers.values();
         }
 
-        // Marshal txNodes only if there is a node in topology with an older version.
-        if (ctx.exchange().minimumNodeVersion(topologyVersion()).compareTo(TX_NODES_DIRECT_MARSHALLABLE_SINCE) < 0) {
-            if (txNodes != null && txNodesBytes == null)
-                txNodesBytes = U.marshal(ctx, txNodes);
-        }
-        else {
-            if (txNodesMsg == null)
-                txNodesMsg = F.viewReadOnly(txNodes, COL_TO_MSG);
-        }
+        if (txNodesMsg == null)
+            txNodesMsg = F.viewReadOnly(txNodes, COL_TO_MSG);
     }
 
     /** {@inheritDoc} */
@@ -392,9 +416,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
 
         if (txNodesMsg != null)
             txNodes = F.viewReadOnly(txNodesMsg, MSG_TO_COL);
-
-        if (txNodesBytes != null && txNodes == null)
-            txNodes = U.unmarshal(ctx, txNodesBytes, U.resolveClassLoader(ldr, ctx.gridConfig()));
     }
 
     /** {@inheritDoc} */
@@ -407,6 +428,26 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
         return ctx.txPrepareMessageLogger();
     }
 
+    /**
+     * Sets flag mask.
+     *
+     * @param flag Set or clear.
+     * @param mask Mask.
+     */
+    private void setFlag(boolean flag, int mask) {
+        flags = flag ? (byte)(flags | mask) : (byte)(flags & ~mask);
+    }
+
+    /**
+     * Reags flag mask.
+     *
+     * @param mask Mask to read.
+     * @return Flag value.
+     */
+    private boolean isFlag(int mask) {
+        return (flags & mask) != 0;
+    }
+
     /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
@@ -441,7 +482,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
                 writer.incrementState();
 
             case 10:
-                if (!writer.writeBoolean("invalidate", invalidate))
+                if (!writer.writeByte("flags", flags))
                     return false;
 
                 writer.incrementState();
@@ -453,66 +494,48 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
                 writer.incrementState();
 
             case 12:
-                if (!writer.writeBoolean("onePhaseCommit", onePhaseCommit))
-                    return false;
-
-                writer.incrementState();
-
-            case 13:
                 if (!writer.writeByte("plc", plc))
                     return false;
 
                 writer.incrementState();
 
-            case 14:
+            case 13:
                 if (!writer.writeCollection("reads", reads, MessageCollectionItemType.MSG))
                     return false;
 
                 writer.incrementState();
 
-            case 15:
-                if (!writer.writeBoolean("sys", sys))
-                    return false;
-
-                writer.incrementState();
-
-            case 16:
+            case 14:
                 if (!writer.writeLong("threadId", threadId))
                     return false;
 
                 writer.incrementState();
 
-            case 17:
+            case 15:
                 if (!writer.writeLong("timeout", timeout))
                     return false;
 
                 writer.incrementState();
 
-            case 18:
-                if (!writer.writeByteArray("txNodesBytes", txNodesBytes))
-                    return false;
-
-                writer.incrementState();
-
-            case 19:
+            case 16:
                 if (!writer.writeMap("txNodesMsg", txNodesMsg, MessageCollectionItemType.UUID, MessageCollectionItemType.MSG))
                     return false;
 
                 writer.incrementState();
 
-            case 20:
+            case 17:
                 if (!writer.writeInt("txSize", txSize))
                     return false;
 
                 writer.incrementState();
 
-            case 21:
+            case 18:
                 if (!writer.writeMessage("writeVer", writeVer))
                     return false;
 
                 writer.incrementState();
 
-            case 22:
+            case 19:
                 if (!writer.writeCollection("writes", writes, MessageCollectionItemType.MSG))
                     return false;
 
@@ -563,7 +586,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
                 reader.incrementState();
 
             case 10:
-                invalidate = reader.readBoolean("invalidate");
+                flags = reader.readByte("flags");
 
                 if (!reader.isLastRead())
                     return false;
@@ -583,14 +606,6 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
                 reader.incrementState();
 
             case 12:
-                onePhaseCommit = reader.readBoolean("onePhaseCommit");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 13:
                 plc = reader.readByte("plc");
 
                 if (!reader.isLastRead())
@@ -598,7 +613,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
 
                 reader.incrementState();
 
-            case 14:
+            case 13:
                 reads = reader.readCollection("reads", MessageCollectionItemType.MSG);
 
                 if (!reader.isLastRead())
@@ -606,15 +621,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
 
                 reader.incrementState();
 
-            case 15:
-                sys = reader.readBoolean("sys");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 16:
+            case 14:
                 threadId = reader.readLong("threadId");
 
                 if (!reader.isLastRead())
@@ -622,7 +629,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
 
                 reader.incrementState();
 
-            case 17:
+            case 15:
                 timeout = reader.readLong("timeout");
 
                 if (!reader.isLastRead())
@@ -630,15 +637,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
 
                 reader.incrementState();
 
-            case 18:
-                txNodesBytes = reader.readByteArray("txNodesBytes");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 19:
+            case 16:
                 txNodesMsg = reader.readMap("txNodesMsg", MessageCollectionItemType.UUID, MessageCollectionItemType.MSG, false);
 
                 if (!reader.isLastRead())
@@ -646,7 +645,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
 
                 reader.incrementState();
 
-            case 20:
+            case 17:
                 txSize = reader.readInt("txSize");
 
                 if (!reader.isLastRead())
@@ -654,7 +653,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
 
                 reader.incrementState();
 
-            case 21:
+            case 18:
                 writeVer = reader.readMessage("writeVer");
 
                 if (!reader.isLastRead())
@@ -662,7 +661,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
 
                 reader.incrementState();
 
-            case 22:
+            case 19:
                 writes = reader.readCollection("writes", MessageCollectionItemType.MSG);
 
                 if (!reader.isLastRead())
@@ -682,7 +681,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 23;
+        return 20;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
index 5d70ec1..be7ecf8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedUnlockRequest.java
@@ -45,10 +45,6 @@ public class GridDistributedUnlockRequest extends GridDistributedBaseMessage {
     @GridDirectCollection(KeyCacheObject.class)
     private List<KeyCacheObject> keys;
 
-    /** Partition IDs. */
-    @GridDirectCollection(int.class)
-    protected List<Integer> partIds;
-
     /**
      * Empty constructor required by {@link Externalizable}.
      */
@@ -80,18 +76,15 @@ public class GridDistributedUnlockRequest extends GridDistributedBaseMessage {
      * @throws IgniteCheckedException If failed.
      */
     public void addKey(KeyCacheObject key, GridCacheContext ctx) throws IgniteCheckedException {
-        if (keys == null) {
+        if (keys == null)
             keys = new ArrayList<>(keysCount());
-            partIds = new ArrayList<>(keysCount());
-        }
 
         keys.add(key);
-        partIds.add(key.partition());
     }
 
     /** {@inheritDoc} */
     @Override public int partition() {
-        return partIds != null && !partIds.isEmpty() ? partIds.get(0) : -1;
+        return keys != null && !keys.isEmpty() ? keys.get(0).partition() : -1;
     }
 
     /** {@inheritDoc}
@@ -107,13 +100,6 @@ public class GridDistributedUnlockRequest extends GridDistributedBaseMessage {
         super.finishUnmarshal(ctx, ldr);
 
         finishUnmarshalCacheObjects(keys, ctx.cacheContext(cacheId), ldr);
-
-        if (partIds != null && !partIds.isEmpty()) {
-            assert partIds.size() == keys.size();
-
-            for (int i = 0; i < keys.size(); i++)
-                keys.get(i).partition(partIds.get(i));
-        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
index 95c6dfc..50167d8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java
@@ -419,12 +419,6 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
 
                 writer.incrementState();
 
-            case 30:
-                if (!writer.writeCollection("partIds", partIds, MessageCollectionItemType.INT))
-                    return false;
-
-                writer.incrementState();
-
         }
 
         return true;
@@ -521,14 +515,6 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
 
                 reader.incrementState();
 
-            case 30:
-                partIds = reader.readCollection("partIds", MessageCollectionItemType.INT);
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
         }
 
         return reader.afterMessageRead(GridDhtLockRequest.class);
@@ -541,7 +527,7 @@ public class GridDhtLockRequest extends GridDistributedLockRequest {
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 31;
+        return 30;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
index a8f2087..4c8a22d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
@@ -52,9 +52,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** */
-    public static final int NEED_RETURN_VALUE_FLAG_MASK = 0x01;
-
     /** Max order. */
     private UUID nearNodeId;
 
@@ -91,9 +88,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
     /** Near transaction ID. */
     private GridCacheVersion nearXidVer;
 
-    /** {@code True} if this is last prepare request for node. */
-    private boolean last;
-
     /** Subject ID. */
     private UUID subjId;
 
@@ -103,9 +97,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
     /** Preload keys. */
     private BitSet preloadKeys;
 
-    /** */
-    private byte flags;
-
     /**
      * Empty constructor required for {@link Externalizable}.
      */
@@ -143,7 +134,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
         int taskNameHash,
         boolean addDepInfo,
         boolean retVal) {
-        super(tx, timeout, null, dhtWrites, txNodes, onePhaseCommit, addDepInfo);
+        super(tx, timeout, null, dhtWrites, txNodes, retVal, last, onePhaseCommit, addDepInfo);
 
         assert futId != null;
         assert miniId != null;
@@ -153,7 +144,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
         this.nearWrites = nearWrites;
         this.miniId = miniId;
         this.nearXidVer = nearXidVer;
-        this.last = last;
         this.subjId = subjId;
         this.taskNameHash = taskNameHash;
 
@@ -165,30 +155,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
     }
 
     /**
-     * @return Flag indicating whether transaction needs return value.
-     */
-    public boolean needReturnValue() {
-        return (flags & NEED_RETURN_VALUE_FLAG_MASK) != 0;
-    }
-
-    /**
-     * @param retVal Need return value.
-     */
-    public void needReturnValue(boolean retVal) {
-        if (retVal)
-            flags = (byte)(flags | NEED_RETURN_VALUE_FLAG_MASK);
-        else
-            flags &= ~NEED_RETURN_VALUE_FLAG_MASK;
-    }
-
-    /**
-     * @return {@code True} if this is last prepare request for node.
-     */
-    public boolean last() {
-        return last;
-    }
-
-    /**
      * @return Near transaction ID.
      */
     public GridCacheVersion nearXidVersion() {
@@ -227,7 +193,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
      * @param idx Entry index to set invalidation flag.
      * @param invalidate Invalidation flag value.
      */
-    public void invalidateNearEntry(int idx, boolean invalidate) {
+    void invalidateNearEntry(int idx, boolean invalidate) {
         invalidateNearEntries.set(idx, invalidate);
     }
 
@@ -244,7 +210,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
      *
      * @param idx Key index.
      */
-    public void markKeyForPreload(int idx) {
+    void markKeyForPreload(int idx) {
         if (preloadKeys == null)
             preloadKeys = new BitSet();
 
@@ -374,85 +340,73 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
         }
 
         switch (writer.state()) {
-            case 23:
-                if (!writer.writeByte("flags", flags))
-                    return false;
-
-                writer.incrementState();
-
-            case 24:
+            case 20:
                 if (!writer.writeIgniteUuid("futId", futId))
                     return false;
 
                 writer.incrementState();
 
-            case 25:
+            case 21:
                 if (!writer.writeBitSet("invalidateNearEntries", invalidateNearEntries))
                     return false;
 
                 writer.incrementState();
 
-            case 26:
-                if (!writer.writeBoolean("last", last))
-                    return false;
-
-                writer.incrementState();
-
-            case 27:
+            case 22:
                 if (!writer.writeIgniteUuid("miniId", miniId))
                     return false;
 
                 writer.incrementState();
 
-            case 28:
+            case 23:
                 if (!writer.writeUuid("nearNodeId", nearNodeId))
                     return false;
 
                 writer.incrementState();
 
-            case 29:
+            case 24:
                 if (!writer.writeCollection("nearWrites", nearWrites, MessageCollectionItemType.MSG))
                     return false;
 
                 writer.incrementState();
 
-            case 30:
+            case 25:
                 if (!writer.writeMessage("nearXidVer", nearXidVer))
                     return false;
 
                 writer.incrementState();
 
-            case 31:
+            case 26:
                 if (!writer.writeCollection("ownedKeys", ownedKeys, MessageCollectionItemType.MSG))
                     return false;
 
                 writer.incrementState();
 
-            case 32:
+            case 27:
                 if (!writer.writeCollection("ownedVals", ownedVals, MessageCollectionItemType.MSG))
                     return false;
 
                 writer.incrementState();
 
-            case 33:
+            case 28:
                 if (!writer.writeBitSet("preloadKeys", preloadKeys))
                     return false;
 
                 writer.incrementState();
 
-            case 34:
+            case 29:
                 if (!writer.writeUuid("subjId", subjId))
                     return false;
 
                 writer.incrementState();
 
-            case 35:
+            case 30:
                 if (!writer.writeInt("taskNameHash", taskNameHash))
                     return false;
 
                 writer.incrementState();
 
-            case 36:
+            case 31:
                 if (!writer.writeMessage("topVer", topVer))
                     return false;
 
@@ -474,15 +428,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
             return false;
 
         switch (reader.state()) {
-            case 23:
-                flags = reader.readByte("flags");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 24:
+            case 20:
                 futId = reader.readIgniteUuid("futId");
 
                 if (!reader.isLastRead())
@@ -490,7 +436,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 25:
+            case 21:
                 invalidateNearEntries = reader.readBitSet("invalidateNearEntries");
 
                 if (!reader.isLastRead())
@@ -498,15 +444,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 26:
-                last = reader.readBoolean("last");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 27:
+            case 22:
                 miniId = reader.readIgniteUuid("miniId");
 
                 if (!reader.isLastRead())
@@ -514,7 +452,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 28:
+            case 23:
                 nearNodeId = reader.readUuid("nearNodeId");
 
                 if (!reader.isLastRead())
@@ -522,7 +460,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 29:
+            case 24:
                 nearWrites = reader.readCollection("nearWrites", MessageCollectionItemType.MSG);
 
                 if (!reader.isLastRead())
@@ -530,7 +468,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 30:
+            case 25:
                 nearXidVer = reader.readMessage("nearXidVer");
 
                 if (!reader.isLastRead())
@@ -538,7 +476,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 31:
+            case 26:
                 ownedKeys = reader.readCollection("ownedKeys", MessageCollectionItemType.MSG);
 
                 if (!reader.isLastRead())
@@ -546,7 +484,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 32:
+            case 27:
                 ownedVals = reader.readCollection("ownedVals", MessageCollectionItemType.MSG);
 
                 if (!reader.isLastRead())
@@ -554,7 +492,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 33:
+            case 28:
                 preloadKeys = reader.readBitSet("preloadKeys");
 
                 if (!reader.isLastRead())
@@ -562,7 +500,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 34:
+            case 29:
                 subjId = reader.readUuid("subjId");
 
                 if (!reader.isLastRead())
@@ -570,7 +508,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 35:
+            case 30:
                 taskNameHash = reader.readInt("taskNameHash");
 
                 if (!reader.isLastRead())
@@ -578,7 +516,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 36:
+            case 31:
                 topVer = reader.readMessage("topVer");
 
                 if (!reader.isLastRead())
@@ -598,6 +536,6 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 37;
+        return 32;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
index 3737295..752df54 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
@@ -119,11 +119,6 @@ public class GridDhtUnlockRequest extends GridDistributedUnlockRequest {
 
                 writer.incrementState();
 
-            case 9:
-                if (!writer.writeCollection("partIds", partIds, MessageCollectionItemType.INT))
-                    return false;
-
-                writer.incrementState();
         }
 
         return true;
@@ -148,14 +143,6 @@ public class GridDhtUnlockRequest extends GridDistributedUnlockRequest {
 
                 reader.incrementState();
 
-            case 9:
-                partIds = reader.readCollection("partIds", MessageCollectionItemType.INT);
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
         }
 
         return reader.afterMessageRead(GridDhtUnlockRequest.class);
@@ -168,6 +155,6 @@ public class GridDhtUnlockRequest extends GridDistributedUnlockRequest {
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 10;
+        return 9;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
index 7ca2635..79c71b3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetRequest.java
@@ -73,10 +73,6 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
     @GridDirectCollection(KeyCacheObject.class)
     private List<KeyCacheObject> keys;
 
-    /** Partition IDs. */
-    @GridDirectCollection(int.class)
-    private List<Integer> partIds;
-
     /** */
     @GridDirectCollection(boolean.class)
     private Collection<Boolean> flags;
@@ -154,12 +150,10 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
 
         this.keys = new ArrayList<>(keys.size());
         flags = new ArrayList<>(keys.size());
-        partIds = new ArrayList<>(keys.size());
 
         for (Map.Entry<KeyCacheObject, Boolean> entry : keys.entrySet()) {
             this.keys.add(entry.getKey());
             flags.add(entry.getValue());
-            partIds.add(entry.getKey().partition());
         }
 
         this.readThrough = readThrough;
@@ -259,7 +253,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
 
     /** {@inheritDoc} */
     @Override public int partition() {
-        return partIds != null && !partIds.isEmpty() ? partIds.get(0) : -1;
+        return keys != null && !keys.isEmpty() ? keys.get(0).partition() : -1;
     }
 
     /**
@@ -302,13 +296,6 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
             while (keysIt.hasNext())
                 keyMap.put(keysIt.next(), flagsIt.next());
         }
-
-        if (partIds != null && !partIds.isEmpty()) {
-            assert partIds.size() == keys.size();
-
-            for (int i = 0; i < keys.size(); i++)
-                keys.get(i).partition(partIds.get(i));
-        }
     }
 
     /** {@inheritDoc} */
@@ -368,48 +355,42 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
                 writer.incrementState();
 
             case 9:
-                if (!writer.writeCollection("partIds", partIds, MessageCollectionItemType.INT))
-                    return false;
-
-                writer.incrementState();
-
-            case 10:
                 if (!writer.writeBoolean("readThrough", readThrough))
                     return false;
 
                 writer.incrementState();
 
-            case 11:
+            case 10:
                 if (!writer.writeBoolean("reload", reload))
                     return false;
 
                 writer.incrementState();
 
-            case 12:
+            case 11:
                 if (!writer.writeBoolean("skipVals", skipVals))
                     return false;
 
                 writer.incrementState();
 
-            case 13:
+            case 12:
                 if (!writer.writeUuid("subjId", subjId))
                     return false;
 
                 writer.incrementState();
 
-            case 14:
+            case 13:
                 if (!writer.writeInt("taskNameHash", taskNameHash))
                     return false;
 
                 writer.incrementState();
 
-            case 15:
+            case 14:
                 if (!writer.writeMessage("topVer", topVer))
                     return false;
 
                 writer.incrementState();
 
-            case 16:
+            case 15:
                 if (!writer.writeMessage("ver", ver))
                     return false;
 
@@ -480,14 +461,6 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
                 reader.incrementState();
 
             case 9:
-                partIds = reader.readCollection("partIds", MessageCollectionItemType.INT);
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 10:
                 readThrough = reader.readBoolean("readThrough");
 
                 if (!reader.isLastRead())
@@ -495,7 +468,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
 
                 reader.incrementState();
 
-            case 11:
+            case 10:
                 reload = reader.readBoolean("reload");
 
                 if (!reader.isLastRead())
@@ -503,7 +476,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
 
                 reader.incrementState();
 
-            case 12:
+            case 11:
                 skipVals = reader.readBoolean("skipVals");
 
                 if (!reader.isLastRead())
@@ -511,7 +484,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
 
                 reader.incrementState();
 
-            case 13:
+            case 12:
                 subjId = reader.readUuid("subjId");
 
                 if (!reader.isLastRead())
@@ -519,7 +492,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
 
                 reader.incrementState();
 
-            case 14:
+            case 13:
                 taskNameHash = reader.readInt("taskNameHash");
 
                 if (!reader.isLastRead())
@@ -527,7 +500,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
 
                 reader.incrementState();
 
-            case 15:
+            case 14:
                 topVer = reader.readMessage("topVer");
 
                 if (!reader.isLastRead())
@@ -535,7 +508,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
 
                 reader.incrementState();
 
-            case 16:
+            case 15:
                 ver = reader.readMessage("ver");
 
                 if (!reader.isLastRead())
@@ -555,7 +528,7 @@ public class GridNearGetRequest extends GridCacheMessage implements GridCacheDep
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 17;
+        return 16;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
index 9e12153..3091b45 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockRequest.java
@@ -464,12 +464,6 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
 
                 writer.incrementState();
 
-            case 35:
-                if (!writer.writeCollection("partIds", partIds, MessageCollectionItemType.INT))
-                    return false;
-
-                writer.incrementState();
-
         }
 
         return true;
@@ -606,14 +600,6 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
 
                 reader.incrementState();
 
-            case 35:
-                partIds = reader.readCollection("partIds", MessageCollectionItemType.INT);
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
         }
 
         return reader.afterMessageRead(GridNearLockRequest.class);
@@ -626,7 +612,7 @@ public class GridNearLockRequest extends GridDistributedLockRequest {
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 36;
+        return 35;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetRequest.java
index 1a925f3..994172b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetRequest.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.processors.cache.distributed.near;
 import java.nio.ByteBuffer;
 import java.util.UUID;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.IgniteCodeGeneratingFail;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheDeployable;
@@ -38,25 +37,24 @@ import static org.apache.ignite.internal.processors.cache.GridCacheUtils.SKIP_ST
 /**
  *
  */
-@IgniteCodeGeneratingFail // partId read should not be generated by MessageCodeGenerator.
 public class GridNearSingleGetRequest extends GridCacheMessage implements GridCacheDeployable {
     /** */
     private static final long serialVersionUID = 0L;
 
     /** */
-    public static final int READ_THROUGH_FLAG_MASK = 0x01;
+    private static final int READ_THROUGH_FLAG_MASK = 0x01;
 
     /** */
-    public static final int SKIP_VALS_FLAG_MASK = 0x02;
+    private static final int SKIP_VALS_FLAG_MASK = 0x02;
 
     /** */
-    public static final int ADD_READER_FLAG_MASK = 0x04;
+    private static final int ADD_READER_FLAG_MASK = 0x04;
 
     /** */
-    public static final int NEED_VER_FLAG_MASK = 0x08;
+    private static final int NEED_VER_FLAG_MASK = 0x08;
 
     /** */
-    public static final int NEED_ENTRY_INFO_FLAG_MASK = 0x10;
+    private static final int NEED_ENTRY_INFO_FLAG_MASK = 0x10;
 
     /** Future ID. */
     private long futId;
@@ -64,9 +62,6 @@ public class GridNearSingleGetRequest extends GridCacheMessage implements GridCa
     /** */
     private KeyCacheObject key;
 
-    /** Partition ID. */
-    private int partId = -1;
-
     /** Flags. */
     private byte flags;
 
@@ -128,7 +123,6 @@ public class GridNearSingleGetRequest extends GridCacheMessage implements GridCa
         this.cacheId = cacheId;
         this.futId = futId;
         this.key = key;
-        this.partId = key.partition();
         this.topVer = topVer;
         this.subjId = subjId;
         this.taskNameHash = taskNameHash;
@@ -202,7 +196,9 @@ public class GridNearSingleGetRequest extends GridCacheMessage implements GridCa
 
     /** {@inheritDoc} */
     @Override public int partition() {
-        return partId;
+        assert key != null;
+
+        return key.partition();
     }
 
     /**
@@ -257,8 +253,6 @@ public class GridNearSingleGetRequest extends GridCacheMessage implements GridCa
 
         assert key != null;
 
-        key.partition(partId);
-
         GridCacheContext cctx = ctx.cacheContext(cacheId);
 
         key.finishUnmarshal(cctx.cacheObjectContext(), ldr);
@@ -316,14 +310,6 @@ public class GridNearSingleGetRequest extends GridCacheMessage implements GridCa
                 reader.incrementState();
 
             case 8:
-                partId = reader.readInt("partId", -1);
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 9:
                 subjId = reader.readUuid("subjId");
 
                 if (!reader.isLastRead())
@@ -331,7 +317,7 @@ public class GridNearSingleGetRequest extends GridCacheMessage implements GridCa
 
                 reader.incrementState();
 
-            case 10:
+            case 9:
                 taskNameHash = reader.readInt("taskNameHash");
 
                 if (!reader.isLastRead())
@@ -339,7 +325,7 @@ public class GridNearSingleGetRequest extends GridCacheMessage implements GridCa
 
                 reader.incrementState();
 
-            case 11:
+            case 10:
                 topVer = reader.readMessage("topVer");
 
                 if (!reader.isLastRead())
@@ -398,24 +384,18 @@ public class GridNearSingleGetRequest extends GridCacheMessage implements GridCa
                 writer.incrementState();
 
             case 8:
-                if (!writer.writeInt("partId", partId))
-                    return false;
-
-                writer.incrementState();
-
-            case 9:
                 if (!writer.writeUuid("subjId", subjId))
                     return false;
 
                 writer.incrementState();
 
-            case 10:
+            case 9:
                 if (!writer.writeInt("taskNameHash", taskNameHash))
                     return false;
 
                 writer.incrementState();
 
-            case 11:
+            case 10:
                 if (!writer.writeMessage("topVer", topVer))
                     return false;
 
@@ -438,7 +418,7 @@ public class GridNearSingleGetRequest extends GridCacheMessage implements GridCa
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 12;
+        return 11;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
index e55566b..c9ab48f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
@@ -45,43 +45,40 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** */
+    private static final int NEAR_FLAG_MASK = 0x01;
+
+    /** */
+    private static final int FIRST_CLIENT_REQ_FLAG_MASK = 0x02;
+
+    /** */
+    private static final int IMPLICIT_SINGLE_FLAG_MASK = 0x04;
+
+    /** */
+    private static final int EXPLICIT_LOCK_FLAG_MASK = 0x08;
+
     /** Future ID. */
     private IgniteUuid futId;
 
     /** Mini future ID. */
     private IgniteUuid miniId;
 
-    /** Near mapping flag. */
-    private boolean near;
-
     /** Topology version. */
     private AffinityTopologyVersion topVer;
 
-    /** {@code True} if this last prepare request for node. */
-    private boolean last;
-
     /** IDs of backup nodes receiving last prepare request during this prepare. */
     @GridDirectCollection(UUID.class)
     @GridToStringInclude
     private Collection<UUID> lastBackups;
 
-    /** Need return value flag. */
-    private boolean retVal;
-
-    /** Implicit single flag. */
-    private boolean implicitSingle;
-
-    /** Explicit lock flag. Set to true if at least one entry was explicitly locked. */
-    private boolean explicitLock;
-
     /** Subject ID. */
     private UUID subjId;
 
     /** Task name hash. */
     private int taskNameHash;
 
-    /** {@code True} if first optimistic tx prepare request sent from client node. */
-    private boolean firstClientReq;
+    /** */
+    private byte flags;
 
     /**
      * Empty constructor required for {@link Externalizable}.
@@ -128,43 +125,42 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
         boolean firstClientReq,
         boolean addDepInfo
     ) {
-        super(tx, timeout, reads, writes, txNodes, onePhaseCommit, addDepInfo);
+        super(tx,
+            timeout,
+            reads,
+            writes,
+            txNodes,
+            retVal,
+            last,
+            onePhaseCommit,
+            addDepInfo);
 
         assert futId != null;
         assert !firstClientReq || tx.optimistic() : tx;
 
         this.futId = futId;
         this.topVer = topVer;
-        this.near = near;
-        this.last = last;
-        this.retVal = retVal;
-        this.implicitSingle = implicitSingle;
-        this.explicitLock = explicitLock;
         this.subjId = subjId;
         this.taskNameHash = taskNameHash;
-        this.firstClientReq = firstClientReq;
-    }
 
-    /**
-     * @return {@code True} if first optimistic tx prepare request sent from client node.
-     */
-    public boolean firstClientRequest() {
-        return firstClientReq;
+        setFlag(near, NEAR_FLAG_MASK);
+        setFlag(implicitSingle, IMPLICIT_SINGLE_FLAG_MASK);
+        setFlag(explicitLock, EXPLICIT_LOCK_FLAG_MASK);
+        setFlag(firstClientReq, FIRST_CLIENT_REQ_FLAG_MASK);
     }
 
-
     /**
-     * @return {@code True} if this last prepare request for node.
+     * @return {@code True} if first optimistic tx prepare request sent from client node.
      */
-    public boolean last() {
-        return last;
+    public final boolean firstClientRequest() {
+        return isFlag(FIRST_CLIENT_REQ_FLAG_MASK);
     }
 
     /**
      * @return {@code True} if mapping is for near-enabled caches.
      */
-    public boolean near() {
-        return near;
+    public final boolean near() {
+        return isFlag(NEAR_FLAG_MASK);
     }
 
     /**
@@ -203,24 +199,17 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
     }
 
     /**
-     * @return Whether return value is requested.
-     */
-    public boolean returnValue() {
-        return retVal;
-    }
-
-    /**
      * @return Implicit single flag.
      */
-    public boolean implicitSingle() {
-        return implicitSingle;
+    public final boolean implicitSingle() {
+        return isFlag(IMPLICIT_SINGLE_FLAG_MASK);
     }
 
     /**
      * @return Explicit lock flag.
      */
-    public boolean explicitLock() {
-        return explicitLock;
+    public final boolean explicitLock() {
+        return isFlag(EXPLICIT_LOCK_FLAG_MASK);
     }
 
     /**
@@ -269,6 +258,26 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
         return true;
     }
 
+    /**
+     * Sets flag mask.
+     *
+     * @param flag Set or clear.
+     * @param mask Mask.
+     */
+    private void setFlag(boolean flag, int mask) {
+        flags = flag ? (byte)(flags | mask) : (byte)(flags & ~mask);
+    }
+
+    /**
+     * Reags flag mask.
+     *
+     * @param mask Mask to read.
+     * @return Flag value.
+     */
+    private boolean isFlag(int mask) {
+        return (flags & mask) != 0;
+    }
+
     /** {@inheritDoc} */
     @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {
         writer.setBuffer(buf);
@@ -284,73 +293,43 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
         }
 
         switch (writer.state()) {
-            case 23:
-                if (!writer.writeBoolean("explicitLock", explicitLock))
+            case 20:
+                if (!writer.writeByte("flags", flags))
                     return false;
 
                 writer.incrementState();
 
-            case 24:
-                if (!writer.writeBoolean("firstClientReq", firstClientReq))
-                    return false;
-
-                writer.incrementState();
-
-            case 25:
+            case 21:
                 if (!writer.writeIgniteUuid("futId", futId))
                     return false;
 
                 writer.incrementState();
 
-            case 26:
-                if (!writer.writeBoolean("implicitSingle", implicitSingle))
-                    return false;
-
-                writer.incrementState();
-
-            case 27:
-                if (!writer.writeBoolean("last", last))
-                    return false;
-
-                writer.incrementState();
-
-            case 28:
+            case 22:
                 if (!writer.writeCollection("lastBackups", lastBackups, MessageCollectionItemType.UUID))
                     return false;
 
                 writer.incrementState();
 
-            case 29:
+            case 23:
                 if (!writer.writeIgniteUuid("miniId", miniId))
                     return false;
 
                 writer.incrementState();
 
-            case 30:
-                if (!writer.writeBoolean("near", near))
-                    return false;
-
-                writer.incrementState();
-
-            case 31:
-                if (!writer.writeBoolean("retVal", retVal))
-                    return false;
-
-                writer.incrementState();
-
-            case 32:
+            case 24:
                 if (!writer.writeUuid("subjId", subjId))
                     return false;
 
                 writer.incrementState();
 
-            case 33:
+            case 25:
                 if (!writer.writeInt("taskNameHash", taskNameHash))
                     return false;
 
                 writer.incrementState();
 
-            case 34:
+            case 26:
                 if (!writer.writeMessage("topVer", topVer))
                     return false;
 
@@ -372,23 +351,15 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
             return false;
 
         switch (reader.state()) {
-            case 23:
-                explicitLock = reader.readBoolean("explicitLock");
+            case 20:
+                flags = reader.readByte("flags");
 
                 if (!reader.isLastRead())
                     return false;
 
                 reader.incrementState();
 
-            case 24:
-                firstClientReq = reader.readBoolean("firstClientReq");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 25:
+            case 21:
                 futId = reader.readIgniteUuid("futId");
 
                 if (!reader.isLastRead())
@@ -396,23 +367,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 26:
-                implicitSingle = reader.readBoolean("implicitSingle");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 27:
-                last = reader.readBoolean("last");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 28:
+            case 22:
                 lastBackups = reader.readCollection("lastBackups", MessageCollectionItemType.UUID);
 
                 if (!reader.isLastRead())
@@ -420,7 +375,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 29:
+            case 23:
                 miniId = reader.readIgniteUuid("miniId");
 
                 if (!reader.isLastRead())
@@ -428,23 +383,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 30:
-                near = reader.readBoolean("near");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 31:
-                retVal = reader.readBoolean("retVal");
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
-            case 32:
+            case 24:
                 subjId = reader.readUuid("subjId");
 
                 if (!reader.isLastRead())
@@ -452,7 +391,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 33:
+            case 25:
                 taskNameHash = reader.readInt("taskNameHash");
 
                 if (!reader.isLastRead())
@@ -460,7 +399,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
                 reader.incrementState();
 
-            case 34:
+            case 26:
                 topVer = reader.readMessage("topVer");
 
                 if (!reader.isLastRead())
@@ -480,7 +419,7 @@ public class GridNearTxPrepareRequest extends GridDistributedTxPrepareRequest {
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 35;
+        return 27;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
index be78868..c32a844 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearUnlockRequest.java
@@ -62,14 +62,6 @@ public class GridNearUnlockRequest extends GridDistributedUnlockRequest {
             writer.onHeaderWritten();
         }
 
-        switch (writer.state()) {
-            case 8:
-                if (!writer.writeCollection("partIds", partIds, MessageCollectionItemType.INT))
-                    return false;
-
-                writer.incrementState();
-        }
-
         return true;
     }
 
@@ -83,16 +75,6 @@ public class GridNearUnlockRequest extends GridDistributedUnlockRequest {
         if (!super.readFrom(buf, reader))
             return false;
 
-        switch (reader.state()) {
-            case 8:
-                partIds = reader.readCollection("partIds", MessageCollectionItemType.INT);
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-        }
-
         return reader.afterMessageRead(GridNearUnlockRequest.class);
     }
 
@@ -103,7 +85,7 @@ public class GridNearUnlockRequest extends GridDistributedUnlockRequest {
 
     /** {@inheritDoc} */
     @Override public byte fieldsCount() {
-        return 9;
+        return 8;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index 1691fd7..4e56e7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -99,9 +99,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
     /** Cache ID. */
     private int cacheId;
 
-    /** Partition ID. */
-    private int partId = -1;
-
     /** Transient tx key. */
     @GridDirectTransient
     private IgniteTxKey txKey;
@@ -261,7 +258,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
         keepBinary(keepBinary);
 
         key = entry.key();
-        partId = entry.key().partition();
 
         cacheId = entry.context().cacheId();
     }
@@ -314,7 +310,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
             addEntryProcessor(entryProcessor, invokeArgs);
 
         key = entry.key();
-        partId = entry.key().partition();
 
         cacheId = entry.context().cacheId();
     }
@@ -348,7 +343,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
         IgniteTxEntry cp = new IgniteTxEntry();
 
         cp.key = key;
-        cp.partId = partId;
         cp.cacheId = cacheId;
         cp.ctx = ctx;
 
@@ -935,8 +929,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
 
         key.finishUnmarshal(context().cacheObjectContext(), clsLdr);
 
-        key.partition(partId);
-
         val.unmarshal(this.ctx, clsLdr);
 
         if (expiryPlcBytes != null && expiryPlc == null)
@@ -1090,12 +1082,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
 
                 writer.incrementState();
 
-            case 12:
-                if (!writer.writeInt("partId", partId))
-                    return false;
-
-                writer.incrementState();
-
             case 13:
                 if (!writer.writeMessage("oldVal", oldVal))
                     return false;
@@ -1210,14 +1196,6 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
 
                 reader.incrementState();
 
-            case 12:
-                partId = reader.readInt("partId", -1);
-
-                if (!reader.isLastRead())
-                    return false;
-
-                reader.incrementState();
-
             case 13:
                 oldVal = reader.readMessage("oldVal");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index 1b135d7..21c2649 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -457,7 +457,7 @@ public class IgniteTxHandler {
                 tx.onePhaseCommit(true);
             }
 
-            if (req.returnValue())
+            if (req.needReturnValue())
                 tx.needReturnValue(true);
 
             IgniteInternalFuture<GridNearTxPrepareResponse> fut = tx.prepareAsync(

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index 9f37f6e..dbd8ea1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -231,8 +231,8 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
                 cctx.affinity().partition(obj, false) :
                 ctx.kernalContext().affinity().partition0(ctx.cacheName(), obj, null);
         }
-        catch (IgniteCheckedException ignored) {
-            U.error(log, "Failed to get partition");
+        catch (IgniteCheckedException e) {
+            U.error(log, "Failed to get partition", e);
 
             return  -1;
         }
@@ -327,13 +327,7 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
 
         /**
          * @param key Key.
-         */
-        UserKeyCacheObjectImpl(Object key) {
-            this(key, -1);
-        }
-
-        /**
-         * @param key Key.
+         * @param part Partition.
          */
         UserKeyCacheObjectImpl(Object key, int part) {
             super(key, null, part);
@@ -341,6 +335,8 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
 
         /**
          * @param key Key.
+         * @param valBytes Marshalled key.
+         * @param part Partition.
          */
         UserKeyCacheObjectImpl(Object key, byte[] valBytes, int part) {
             super(key, valBytes, part);
@@ -366,10 +362,10 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
 
                     Object val = ctx.processor().unmarshal(ctx, valBytes, ldr);
 
-                    return new KeyCacheObjectImpl(val, valBytes);
+                    return new KeyCacheObjectImpl(val, valBytes, partition());
                 }
 
-                return new KeyCacheObjectImpl(val, valBytes);
+                return new KeyCacheObjectImpl(val, valBytes, partition());
             }
             catch (IgniteCheckedException e) {
                 throw new IgniteException("Failed to marshal object: " + val, e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java
index 66d727c..519a989 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryImmutableEntryTest.java
@@ -132,7 +132,7 @@ public class IgniteCacheContinuousQueryImmutableEntryTest extends GridCommonAbst
         CacheContinuousQueryEntry e0 = new CacheContinuousQueryEntry(
             1,
             EventType.UPDATED,
-            new KeyCacheObjectImpl(1, new byte[] {0, 0, 0, 1}),
+            new KeyCacheObjectImpl(1, new byte[] {0, 0, 0, 1}, 1),
             new CacheObjectImpl(2, new byte[] {0, 0, 0, 2}),
             new CacheObjectImpl(2, new byte[] {0, 0, 0, 3}),
             true,

http://git-wip-us.apache.org/repos/asf/ignite/blob/ca67537f/modules/core/src/test/java/org/apache/ignite/spi/swapspace/file/GridFileSwapSpaceSpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/swapspace/file/GridFileSwapSpaceSpiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/swapspace/file/GridFileSwapSpaceSpiSelfTest.java
index ab21165..a59b6d1 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/swapspace/file/GridFileSwapSpaceSpiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/swapspace/file/GridFileSwapSpaceSpiSelfTest.java
@@ -118,7 +118,7 @@ public class GridFileSwapSpaceSpiSelfTest extends GridSwapSpaceSpiAbstractSelfTe
      * @return Swap key.
      */
     private SwapKey key(int i) {
-        return new SwapKey(new KeyCacheObjectImpl(i, U.intToBytes(i)), i % 11, U.intToBytes(i));
+        return new SwapKey(new KeyCacheObjectImpl(i, U.intToBytes(i), i), i % 11, U.intToBytes(i));
     }
 
     /**


Mime
View raw message