You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vk...@apache.org on 2014/12/23 00:39:55 UTC

[01/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-61 [created] 9b7fea2d3


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
index abd0d3b..a5df710 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
@@ -10,15 +10,13 @@
 package org.gridgain.grid.util.direct;
 
 import org.apache.ignite.lang.*;
+import org.apache.ignite.portables.*;
 import org.gridgain.grid.kernal.processors.cache.*;
 import org.gridgain.grid.kernal.processors.cache.distributed.dht.preloader.*;
 import org.gridgain.grid.kernal.processors.clock.*;
 import org.gridgain.grid.util.*;
-import org.gridgain.grid.util.nio.*;
-import org.gridgain.grid.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
 import sun.misc.*;
-import sun.nio.ch.*;
 
 import java.nio.*;
 import java.util.*;
@@ -37,225 +35,19 @@ public class GridTcpCommunicationMessageState {
     private static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
 
     /** */
-    private static final long SHORT_ARR_OFF = UNSAFE.arrayBaseOffset(short[].class);
+    private static final int FIELD_HDR_LEN = 9;
 
     /** */
-    private static final long INT_ARR_OFF = UNSAFE.arrayBaseOffset(int[].class);
+    private final GridPortableByteBufferStream stream = new GridPortableByteBufferStream();
 
     /** */
-    private static final long LONG_ARR_OFF = UNSAFE.arrayBaseOffset(long[].class);
+    private final PortableWriter writer = null;//new org.gridgain.grid.util.portable.GridPortableWriterImpl();
 
     /** */
-    private static final long FLOAT_ARR_OFF = UNSAFE.arrayBaseOffset(float[].class);
+    private final PortableReader reader = null;//new org.gridgain.grid.util.portable.GridPortableReaderImpl();
 
     /** */
-    private static final long DOUBLE_ARR_OFF = UNSAFE.arrayBaseOffset(double[].class);
-
-    /** */
-    private static final long CHAR_ARR_OFF = UNSAFE.arrayBaseOffset(char[].class);
-
-    /** */
-    private static final long BOOLEAN_ARR_OFF = UNSAFE.arrayBaseOffset(boolean[].class);
-
-    /** */
-    private static final byte[] BYTE_ARR_EMPTY = new byte[0];
-
-    /** */
-    private static final short[] SHORT_ARR_EMPTY = new short[0];
-
-    /** */
-    private static final int[] INT_ARR_EMPTY = new int[0];
-
-    /** */
-    private static final long[] LONG_ARR_EMPTY = new long[0];
-
-    /** */
-    private static final float[] FLOAT_ARR_EMPTY = new float[0];
-
-    /** */
-    private static final double[] DOUBLE_ARR_EMPTY = new double[0];
-
-    /** */
-    private static final char[] CHAR_ARR_EMPTY = new char[0];
-
-    /** */
-    private static final boolean[] BOOLEAN_ARR_EMPTY = new boolean[0];
-
-    /** */
-    private static final byte[] EMPTY_UUID_BYTES = new byte[16];
-
-    /** */
-    private static final ArrayCreator<byte[]> BYTE_ARR_CREATOR = new ArrayCreator<byte[]>() {
-        @Override public byte[] create(int len) {
-            switch (len) {
-                case -1:
-                    return BYTE_ARR_NOT_READ;
-
-                case 0:
-                    return BYTE_ARR_EMPTY;
-
-                default:
-                    return new byte[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<short[]> SHORT_ARR_CREATOR = new ArrayCreator<short[]>() {
-        @Override public short[] create(int len) {
-            switch (len) {
-                case -1:
-                    return SHORT_ARR_NOT_READ;
-
-                case 0:
-                    return SHORT_ARR_EMPTY;
-
-                default:
-                    return new short[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<int[]> INT_ARR_CREATOR = new ArrayCreator<int[]>() {
-        @Override public int[] create(int len) {
-            switch (len) {
-                case -1:
-                    return INT_ARR_NOT_READ;
-
-                case 0:
-                    return INT_ARR_EMPTY;
-
-                default:
-                    return new int[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<long[]> LONG_ARR_CREATOR = new ArrayCreator<long[]>() {
-        @Override public long[] create(int len) {
-            switch (len) {
-                case -1:
-                    return LONG_ARR_NOT_READ;
-
-                case 0:
-                    return LONG_ARR_EMPTY;
-
-                default:
-                    return new long[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<float[]> FLOAT_ARR_CREATOR = new ArrayCreator<float[]>() {
-        @Override public float[] create(int len) {
-            switch (len) {
-                case -1:
-                    return FLOAT_ARR_NOT_READ;
-
-                case 0:
-                    return FLOAT_ARR_EMPTY;
-
-                default:
-                    return new float[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<double[]> DOUBLE_ARR_CREATOR = new ArrayCreator<double[]>() {
-        @Override public double[] create(int len) {
-            switch (len) {
-                case -1:
-                    return DOUBLE_ARR_NOT_READ;
-
-                case 0:
-                    return DOUBLE_ARR_EMPTY;
-
-                default:
-                    return new double[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<char[]> CHAR_ARR_CREATOR = new ArrayCreator<char[]>() {
-        @Override public char[] create(int len) {
-            switch (len) {
-                case -1:
-                    return CHAR_ARR_NOT_READ;
-
-                case 0:
-                    return CHAR_ARR_EMPTY;
-
-                default:
-                    return new char[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<boolean[]> BOOLEAN_ARR_CREATOR = new ArrayCreator<boolean[]>() {
-        @Override public boolean[] create(int len) {
-            switch (len) {
-                case -1:
-                    return BOOLEAN_ARR_NOT_READ;
-
-                case 0:
-                    return BOOLEAN_ARR_EMPTY;
-
-                default:
-                    return new boolean[len];
-            }
-        }
-    };
-
-    /** */
-    private GridNioMessageWriter msgWriter;
-
-    /** */
-    private GridNioMessageReader msgReader;
-
-    /** */
-    private UUID nodeId;
-
-    /** */
-    private ByteBuffer buf;
-
-    /** */
-    private byte[] heapArr;
-
-    /** */
-    private long baseOff;
-
-    /** */
-    private boolean arrHdrDone;
-
-    /** */
-    private int arrOff;
-
-    /** */
-    private Object tmpArr;
-
-    /** */
-    private int tmpArrOff;
-
-    /** */
-    private int tmpArrBytes;
-
-    /** */
-    private boolean msgNotNull;
-
-    /** */
-    private boolean msgNotNullDone;
-
-    /** */
-    private boolean msgTypeDone;
-
-    /** */
-    private GridTcpCommunicationMessageAdapter msg;
+    private boolean hdrDone;
 
     /** */
     public int idx;
@@ -279,494 +71,562 @@ public class GridTcpCommunicationMessageState {
     public int readItems;
 
     /**
-     * @param msgWriter Message writer.
-     * @param nodeId Node ID (provided only if versions are different).
-     */
-    public void messageWriter(GridNioMessageWriter msgWriter, @Nullable UUID nodeId) {
-        assert msgWriter != null;
-
-        this.msgWriter = msgWriter;
-        this.nodeId = nodeId;
-    }
-
-    /**
-     * @param msgReader Message reader.
-     * @param nodeId Node ID (provided only if versions are different).
-     */
-    public void messageReader(GridNioMessageReader msgReader, @Nullable UUID nodeId) {
-        assert msgReader != null;
-
-        this.msgReader = msgReader;
-        this.nodeId = nodeId;
-    }
-
-    /**
      * @param buf Buffer.
      */
     public final void setBuffer(ByteBuffer buf) {
         assert buf != null;
-
-        if (this.buf != buf) {
-            this.buf = buf;
-
-            heapArr = buf.isDirect() ? null : buf.array();
-            baseOff = buf.isDirect() ? ((DirectBuffer)buf).address() : BYTE_ARR_OFF;
-        }
     }
 
     /**
+     * @param name Field name.
      * @param b Byte value.
      * @return Whether value was written.
      */
-    public final boolean putByte(byte b) {
-        assert buf != null;
-
-        if (!buf.hasRemaining())
+    public final boolean putByte(String name, byte b) {
+        if (stream.remaining() < FIELD_HDR_LEN + 1)
             return false;
 
-        int pos = buf.position();
-
-        UNSAFE.putByte(heapArr, baseOff + pos, b);
-
-        buf.position(pos + 1);
+        writer.writeByte(name, b);
 
         return true;
     }
 
     /**
+     * @param name Field name.
      * @return Byte value.
      */
-    public final byte getByte() {
-        assert buf != null;
-        assert buf.hasRemaining();
-
-        int pos = buf.position();
-
-        buf.position(pos + 1);
-
-        return UNSAFE.getByte(heapArr, baseOff + pos);
+    public final byte getByte(String name) {
+        return reader.readByte(name);
     }
 
     /**
+     * @param name Field name.
      * @param s Short value.
      * @return Whether value was written.
      */
-    public final boolean putShort(short s) {
-        assert buf != null;
-
-        if (buf.remaining() < 2)
+    public final boolean putShort(String name, short s) {
+        if (stream.remaining() < FIELD_HDR_LEN + 2)
             return false;
 
-        int pos = buf.position();
-
-        UNSAFE.putShort(heapArr, baseOff + pos, s);
-
-        buf.position(pos + 2);
+        writer.writeShort(name, s);
 
         return true;
     }
 
     /**
+     * @param name Field name.
      * @return Short value.
      */
-    public final short getShort() {
-        assert buf != null;
-        assert buf.remaining() >= 2;
-
-        int pos = buf.position();
-
-        buf.position(pos + 2);
-
-        return UNSAFE.getShort(heapArr, baseOff + pos);
+    public final short getShort(String name) {
+        return reader.readShort(name);
     }
 
     /**
+     * @param name Field name.
      * @param i Integer value.
      * @return Whether value was written.
      */
-    public final boolean putInt(int i) {
-        assert buf != null;
-
-        if (buf.remaining() < 4)
+    public final boolean putInt(String name, int i) {
+        if (stream.remaining() < FIELD_HDR_LEN + 4)
             return false;
 
-        int pos = buf.position();
-
-        UNSAFE.putInt(heapArr, baseOff + pos, i);
-
-        buf.position(pos + 4);
+        writer.writeInt(name, i);
 
         return true;
     }
 
     /**
+     * @param name Field name.
      * @return Integer value.
      */
-    public final int getInt() {
-        assert buf != null;
-        assert buf.remaining() >= 4;
-
-        int pos = buf.position();
-
-        buf.position(pos + 4);
-
-        return UNSAFE.getInt(heapArr, baseOff + pos);
+    public final int getInt(String name) {
+        return reader.readInt(name);
     }
 
     /**
+     * @param name Field name.
      * @param l Long value.
      * @return Whether value was written.
      */
-    public final boolean putLong(long l) {
-        assert buf != null;
-
-        if (buf.remaining() < 8)
+    public final boolean putLong(String name, long l) {
+        if (stream.remaining() < FIELD_HDR_LEN + 8)
             return false;
 
-        int pos = buf.position();
-
-        UNSAFE.putLong(heapArr, baseOff + pos, l);
-
-        buf.position(pos + 8);
+        writer.writeLong(name, l);
 
         return true;
     }
 
     /**
+     * @param name Field name.
      * @return Long value.
      */
-    public final long getLong() {
-        assert buf != null;
-        assert buf.remaining() >= 8;
-
-        int pos = buf.position();
-
-        buf.position(pos + 8);
-
-        return UNSAFE.getLong(heapArr, baseOff + pos);
+    public final long getLong(String name) {
+        return reader.readLong(name);
     }
 
     /**
+     * @param name Field name.
      * @param f Float value.
      * @return Whether value was written.
      */
-    public final boolean putFloat(float f) {
-        assert buf != null;
-
-        if (buf.remaining() < 4)
+    public final boolean putFloat(String name, float f) {
+        if (stream.remaining() < FIELD_HDR_LEN + 4)
             return false;
 
-        int pos = buf.position();
-
-        UNSAFE.putFloat(heapArr, baseOff + pos, f);
-
-        buf.position(pos + 4);
+        writer.writeFloat(name, f);
 
         return true;
     }
 
     /**
+     * @param name Field name.
      * @return Float value.
      */
-    public final float getFloat() {
-        assert buf != null;
-        assert buf.remaining() >= 4;
-
-        int pos = buf.position();
-
-        buf.position(pos + 4);
-
-        return UNSAFE.getFloat(heapArr, baseOff + pos);
+    public final float getFloat(String name) {
+        return reader.readFloat(name);
     }
 
     /**
+     * @param name Field name.
      * @param d Double value.
      * @return Whether value was written.
      */
-    public final boolean putDouble(double d) {
-        assert buf != null;
-
-        if (buf.remaining() < 8)
+    public final boolean putDouble(String name, double d) {
+        if (stream.remaining() < FIELD_HDR_LEN + 8)
             return false;
 
-        int pos = buf.position();
-
-        UNSAFE.putDouble(heapArr, baseOff + pos, d);
-
-        buf.position(pos + 8);
+        writer.writeDouble(name, d);
 
         return true;
     }
 
     /**
+     * @param name Field name.
      * @return Double value.
      */
-    public final double getDouble() {
-        assert buf != null;
-        assert buf.remaining() >= 8;
-
-        int pos = buf.position();
-
-        buf.position(pos + 8);
-
-        return UNSAFE.getDouble(heapArr, baseOff + pos);
+    public final double getDouble(String name) {
+        return reader.readDouble(name);
     }
 
     /**
+     * @param name Field name.
      * @param c Char value.
      * @return Whether value was written.
      */
-    public final boolean putChar(char c) {
-        assert buf != null;
-
-        if (buf.remaining() < 2)
+    public final boolean putChar(String name, char c) {
+        if (stream.remaining() < FIELD_HDR_LEN + 2)
             return false;
 
-        int pos = buf.position();
-
-        UNSAFE.putChar(heapArr, baseOff + pos, c);
-
-        buf.position(pos + 2);
+        writer.writeChar(name, c);
 
         return true;
     }
 
     /**
+     * @param name Field name.
      * @return Char value.
      */
-    public final char getChar() {
-        assert buf != null;
-        assert buf.remaining() >= 2;
-
-        int pos = buf.position();
-
-        buf.position(pos + 2);
-
-        return UNSAFE.getChar(heapArr, baseOff + pos);
+    public final char getChar(String name) {
+        return reader.readChar(name);
     }
 
     /**
+     * @param name Field name.
      * @param b Boolean value.
      * @return Whether value was written.
      */
-    public final boolean putBoolean(boolean b) {
-        assert buf != null;
-
-        if (buf.remaining() < 1)
+    public final boolean putBoolean(String name, boolean b) {
+        if (stream.remaining() < FIELD_HDR_LEN + 1)
             return false;
 
-        int pos = buf.position();
-
-        UNSAFE.putBoolean(heapArr, baseOff + pos, b);
-
-        buf.position(pos + 1);
+        writer.writeBoolean(name, b);
 
         return true;
     }
 
     /**
+     * @param name Field name.
      * @return Boolean value.
      */
-    public final boolean getBoolean() {
-        assert buf != null;
-        assert buf.hasRemaining();
-
-        int pos = buf.position();
-
-        buf.position(pos + 1);
-
-        return UNSAFE.getBoolean(heapArr, baseOff + pos);
+    public final boolean getBoolean(String name) {
+        return reader.readBoolean(name);
     }
 
     /**
+     * @param name Field name.
      * @param arr Byte array.
      * @return Whether array was fully written.
      */
-    public final boolean putByteArray(@Nullable byte[] arr) {
-        assert buf != null;
+    public final boolean putByteArray(String name, @Nullable byte[] arr) {
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return false;
+
+            writer.writeByteArray(name, arr);
 
-        int len = arr != null ? arr.length : 0;
+            hdrDone = true;
+        }
+        else
+            stream.writeByteArray(arr);
 
-        return putArray(arr, BYTE_ARR_OFF, len, len);
+        return lastWritten();
     }
 
     /**
+     * @param name Field name.
      * @return Byte array or special
      *      {@link GridTcpCommunicationMessageAdapter#BYTE_ARR_NOT_READ}
      *      value if it was not fully read.
      */
-    public final byte[] getByteArray() {
-        assert buf != null;
+    public final byte[] getByteArray(String name) {
+        byte[] arr;
+
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return BYTE_ARR_NOT_READ;
+
+            arr = reader.readByteArray(name);
+
+            hdrDone = true;
+        }
+        else
+            arr = stream.readByteArray(-1);
 
-        return getArray(BYTE_ARR_CREATOR, 0, BYTE_ARR_OFF);
+        if (arr != BYTE_ARR_NOT_READ)
+            hdrDone = false;
+
+        return arr;
     }
 
     /**
+     * @param name Field name.
      * @param arr Short array.
      * @return Whether array was fully written.
      */
-    public final boolean putShortArray(short[] arr) {
-        assert buf != null;
+    public final boolean putShortArray(String name, short[] arr) {
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return false;
 
-        int len = arr != null ? arr.length : 0;
+            writer.writeShortArray(name, arr);
 
-        return putArray(arr, SHORT_ARR_OFF, len, len << 1);
+            hdrDone = true;
+        }
+        else
+            stream.writeShortArray(arr);
+
+        return lastWritten();
     }
 
     /**
+     * @param name Field name.
      * @return Short array or special
      *      {@link GridTcpCommunicationMessageAdapter#SHORT_ARR_NOT_READ}
      *      value if it was not fully read.
      */
-    public final short[] getShortArray() {
-        assert buf != null;
+    public final short[] getShortArray(String name) {
+        short[] arr;
 
-        return getArray(SHORT_ARR_CREATOR, 1, SHORT_ARR_OFF);
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return SHORT_ARR_NOT_READ;
+
+            arr = reader.readShortArray(name);
+
+            hdrDone = true;
+        }
+        else
+            arr = stream.readShortArray(-1);
+
+        if (arr != SHORT_ARR_NOT_READ)
+            hdrDone = false;
+
+        return arr;
     }
 
     /**
+     * @param name Field name.
      * @param arr Integer array.
      * @return Whether array was fully written.
      */
-    public final boolean putIntArray(int[] arr) {
-        assert buf != null;
+    public final boolean putIntArray(String name, int[] arr) {
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return false;
 
-        int len = arr != null ? arr.length : 0;
+            writer.writeIntArray(name, arr);
 
-        return putArray(arr, INT_ARR_OFF, len, len << 2);
+            hdrDone = true;
+        }
+        else
+            stream.writeIntArray(arr);
+
+        return lastWritten();
     }
 
     /**
+     * @param name Field name.
      * @return Integer array or special
      *      {@link GridTcpCommunicationMessageAdapter#INT_ARR_NOT_READ}
      *      value if it was not fully read.
      */
-    public final int[] getIntArray() {
-        assert buf != null;
+    public final int[] getIntArray(String name) {
+        int[] arr;
+
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return INT_ARR_NOT_READ;
+
+            arr = reader.readIntArray(name);
+
+            hdrDone = true;
+        }
+        else
+            arr = stream.readIntArray(-1);
 
-        return getArray(INT_ARR_CREATOR, 2, INT_ARR_OFF);
+        if (arr != INT_ARR_NOT_READ)
+            hdrDone = false;
+
+        return arr;
     }
 
     /**
+     * @param name Field name.
      * @param arr Long array.
      * @return Whether array was fully written.
      */
-    public final boolean putLongArray(long[] arr) {
-        assert buf != null;
+    public final boolean putLongArray(String name, long[] arr) {
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return false;
+
+            writer.writeLongArray(name, arr);
 
-        int len = arr != null ? arr.length : 0;
+            hdrDone = true;
+        }
+        else
+            stream.writeLongArray(arr);
 
-        return putArray(arr, LONG_ARR_OFF, len, len << 3);
+        return lastWritten();
     }
 
     /**
+     * @param name Field name.
      * @return Long array or special
      *      {@link GridTcpCommunicationMessageAdapter#LONG_ARR_NOT_READ}
      *      value if it was not fully read.
      */
-    public final long[] getLongArray() {
-        assert buf != null;
+    public final long[] getLongArray(String name) {
+        long[] arr;
+
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return LONG_ARR_NOT_READ;
+
+            arr = reader.readLongArray(name);
+
+            hdrDone = true;
+        }
+        else
+            arr = stream.readLongArray(-1);
+
+        if (arr != LONG_ARR_NOT_READ)
+            hdrDone = false;
 
-        return getArray(LONG_ARR_CREATOR, 3, LONG_ARR_OFF);
+        return arr;
     }
 
     /**
+     * @param name Field name.
      * @param arr Float array.
      * @return Whether array was fully written.
      */
-    public final boolean putFloatArray(float[] arr) {
-        assert buf != null;
+    public final boolean putFloatArray(String name, float[] arr) {
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return false;
 
-        int len = arr != null ? arr.length : 0;
+            writer.writeFloatArray(name, arr);
+
+            hdrDone = true;
+        }
+        else
+            stream.writeFloatArray(arr);
 
-        return putArray(arr, FLOAT_ARR_OFF, len, len << 2);
+        return lastWritten();
     }
 
     /**
+     * @param name Field name.
      * @return Float array or special
      *      {@link GridTcpCommunicationMessageAdapter#FLOAT_ARR_NOT_READ}
      *      value if it was not fully read.
      */
-    public final float[] getFloatArray() {
-        assert buf != null;
+    public final float[] getFloatArray(String name) {
+        float[] arr;
+
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return FLOAT_ARR_NOT_READ;
+
+            arr = reader.readFloatArray(name);
 
-        return getArray(FLOAT_ARR_CREATOR, 2, FLOAT_ARR_OFF);
+            hdrDone = true;
+        }
+        else
+            arr = stream.readFloatArray(-1);
+
+        if (arr != FLOAT_ARR_NOT_READ)
+            hdrDone = false;
+
+        return arr;
     }
 
     /**
+     * @param name Field name.
      * @param arr Double array.
      * @return Whether array was fully written.
      */
-    public final boolean putDoubleArray(double[] arr) {
-        assert buf != null;
+    public final boolean putDoubleArray(String name, double[] arr) {
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return false;
+
+            writer.writeDoubleArray(name, arr);
 
-        int len = arr != null ? arr.length : 0;
+            hdrDone = true;
+        }
+        else
+            stream.writeDoubleArray(arr);
 
-        return putArray(arr, DOUBLE_ARR_OFF, len, len << 3);
+        return lastWritten();
     }
 
     /**
+     * @param name Field name.
      * @return Double array or special
      *      {@link GridTcpCommunicationMessageAdapter#DOUBLE_ARR_NOT_READ}
      *      value if it was not fully read.
      */
-    public final double[] getDoubleArray() {
-        assert buf != null;
+    public final double[] getDoubleArray(String name) {
+        double[] arr;
+
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return DOUBLE_ARR_NOT_READ;
+
+            arr = reader.readDoubleArray(name);
+
+            hdrDone = true;
+        }
+        else
+            arr = stream.readDoubleArray(-1);
 
-        return getArray(DOUBLE_ARR_CREATOR, 3, DOUBLE_ARR_OFF);
+        if (arr != DOUBLE_ARR_NOT_READ)
+            hdrDone = false;
+
+        return arr;
     }
 
     /**
+     * @param name Field name.
      * @param arr Char array.
      * @return Whether array was fully written.
      */
-    public final boolean putCharArray(char[] arr) {
-        assert buf != null;
+    public final boolean putCharArray(String name, char[] arr) {
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return false;
 
-        int len = arr != null ? arr.length : 0;
+            writer.writeCharArray(name, arr);
 
-        return putArray(arr, CHAR_ARR_OFF, len, len << 1);
+            hdrDone = true;
+        }
+        else
+            stream.writeCharArray(arr);
+
+        return lastWritten();
     }
 
     /**
+     * @param name Field name.
      * @return Char array or special
      *      {@link GridTcpCommunicationMessageAdapter#CHAR_ARR_NOT_READ}
      *      value if it was not fully read.
      */
-    public final char[] getCharArray() {
-        assert buf != null;
+    public final char[] getCharArray(String name) {
+        char[] arr;
 
-        return getArray(CHAR_ARR_CREATOR, 1, CHAR_ARR_OFF);
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return CHAR_ARR_NOT_READ;
+
+            arr = reader.readCharArray(name);
+
+            hdrDone = true;
+        }
+        else
+            arr = stream.readCharArray(-1);
+
+        if (arr != CHAR_ARR_NOT_READ)
+            hdrDone = false;
+
+        return arr;
     }
 
     /**
+     * @param name Field name.
      * @param arr Boolean array.
      * @return Whether array was fully written.
      */
-    public final boolean putBooleanArray(boolean[] arr) {
-        assert buf != null;
+    public final boolean putBooleanArray(String name, boolean[] arr) {
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return false;
 
-        int len = arr != null ? arr.length : 0;
+            writer.writeBooleanArray(name, arr);
 
-        return putArray(arr, BOOLEAN_ARR_OFF, len, len);
+            hdrDone = true;
+        }
+        else
+            stream.writeBooleanArray(arr);
+
+        return lastWritten();
     }
 
     /**
+     * @param name Field name.
      * @return Boolean array or special
      *      {@link GridTcpCommunicationMessageAdapter#BOOLEAN_ARR_NOT_READ}
      *      value if it was not fully read.
      */
-    public final boolean[] getBooleanArray() {
-        assert buf != null;
+    public final boolean[] getBooleanArray(String name) {
+        boolean[] arr;
+
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN + 4)
+                return BOOLEAN_ARR_NOT_READ;
+
+            arr = reader.readBooleanArray(name);
+
+            hdrDone = true;
+        }
+        else
+            arr = stream.readBooleanArray(-1);
 
-        return getArray(BOOLEAN_ARR_CREATOR, 0, BOOLEAN_ARR_OFF);
+        if (arr != BOOLEAN_ARR_NOT_READ)
+            hdrDone = false;
+
+        return arr;
     }
 
     /**
+     * @param name Field name.
      * @param uuid {@link UUID}.
      * @return Whether value was fully written.
      */
-    public final boolean putUuid(@Nullable UUID uuid) {
+    public final boolean putUuid(String name, @Nullable UUID uuid) {
         byte[] arr = null;
 
         if (uuid != null) {
@@ -776,16 +636,17 @@ public class GridTcpCommunicationMessageState {
             UNSAFE.putLong(arr, BYTE_ARR_OFF + 8, uuid.getLeastSignificantBits());
         }
 
-        return putByteArray(arr);
+        return putByteArray(name, arr);
     }
 
     /**
+     * @param name Field name.
      * @return {@link UUID} or special
      *      {@link GridTcpCommunicationMessageAdapter#UUID_NOT_READ}
      *      value if it was not fully read.
      */
-    public final UUID getUuid() {
-        byte[] arr = getByteArray();
+    public final UUID getUuid(String name) {
+        byte[] arr = getByteArray(name);
 
         if (arr == BYTE_ARR_NOT_READ)
             return UUID_NOT_READ;
@@ -800,10 +661,11 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
-     * @param uuid {@link org.apache.ignite.lang.IgniteUuid}.
+     * @param name Field name.
+     * @param uuid {@link IgniteUuid}.
      * @return Whether value was fully written.
      */
-    public final boolean putGridUuid(@Nullable IgniteUuid uuid) {
+    public final boolean putGridUuid(String name, @Nullable IgniteUuid uuid) {
         byte[] arr = null;
 
         if (uuid != null) {
@@ -814,16 +676,17 @@ public class GridTcpCommunicationMessageState {
             UNSAFE.putLong(arr, BYTE_ARR_OFF + 16, uuid.localId());
         }
 
-        return putByteArray(arr);
+        return putByteArray(name, arr);
     }
 
     /**
+     * @param name Field name.
      * @return {@link org.apache.ignite.lang.IgniteUuid} or special
      *      {@link GridTcpCommunicationMessageAdapter#GRID_UUID_NOT_READ}
      *      value if it was not fully read.
      */
-    public final IgniteUuid getGridUuid() {
-        byte[] arr = getByteArray();
+    public final IgniteUuid getGridUuid(String name) {
+        byte[] arr = getByteArray(name);
 
         if (arr == BYTE_ARR_NOT_READ)
             return GRID_UUID_NOT_READ;
@@ -839,10 +702,11 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param name Field name.
      * @param ver {@link GridClockDeltaVersion}.
      * @return Whether value was fully written.
      */
-    public final boolean putClockDeltaVersion(@Nullable GridClockDeltaVersion ver) {
+    public final boolean putClockDeltaVersion(String name, @Nullable GridClockDeltaVersion ver) {
         byte[] arr = null;
 
         if (ver != null) {
@@ -852,16 +716,17 @@ public class GridTcpCommunicationMessageState {
             UNSAFE.putLong(arr, BYTE_ARR_OFF + 8, ver.topologyVersion());
         }
 
-        return putByteArray(arr);
+        return putByteArray(name, arr);
     }
 
     /**
+     * @param name Field name.
      * @return {@link GridClockDeltaVersion} or special
      *      {@link GridTcpCommunicationMessageAdapter#CLOCK_DELTA_VER_NOT_READ}
      *      value if it was not fully read.
      */
-    public final GridClockDeltaVersion getClockDeltaVersion() {
-        byte[] arr = getByteArray();
+    public final GridClockDeltaVersion getClockDeltaVersion(String name) {
+        byte[] arr = getByteArray(name);
 
         if (arr == BYTE_ARR_NOT_READ)
             return CLOCK_DELTA_VER_NOT_READ;
@@ -876,24 +741,23 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param name Field name.
      * @param list {@link GridByteArrayList}.
      * @return Whether value was fully written.
      */
-    public final boolean putByteArrayList(@Nullable GridByteArrayList list) {
-        byte[] arr = list != null ? list.internalArray() : null;
-        int size = list != null ? list.size() : 0;
-
-        return putArray(arr, BYTE_ARR_OFF, size, size);
+    public final boolean putByteArrayList(String name, @Nullable GridByteArrayList list) {
+        return putByteArray(name, list != null ? list.array() : null);
     }
 
     /**
+     * @param name Field name.
      * @return {@link GridByteArrayList} or special
      *      {@link GridTcpCommunicationMessageAdapter#BYTE_ARR_LIST_NOT_READ}
      *      value if it was not fully read.
      */
     @SuppressWarnings("IfMayBeConditional")
-    public final GridByteArrayList getByteArrayList() {
-        byte[] arr = getByteArray();
+    public final GridByteArrayList getByteArrayList(String name) {
+        byte[] arr = getByteArray(name);
 
         if (arr == BYTE_ARR_NOT_READ)
             return BYTE_ARR_LIST_NOT_READ;
@@ -904,24 +768,23 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param name Field name.
      * @param list {@link GridLongList}.
      * @return Whether value was fully written.
      */
-    public final boolean putLongList(@Nullable GridLongList list) {
-        long[] arr = list != null ? list.internalArray() : null;
-        int size = list != null ? list.size() : 0;
-
-        return putArray(arr, LONG_ARR_OFF, size, size << 3);
+    public final boolean putLongList(String name, @Nullable GridLongList list) {
+        return putLongArray(name, list != null ? list.array() : null);
     }
 
     /**
+     * @param name Field name.
      * @return {@link GridLongList} or special
      *      {@link GridTcpCommunicationMessageAdapter#LONG_LIST_NOT_READ}
      *      value if it was not fully read.
      */
     @SuppressWarnings("IfMayBeConditional")
-    public final GridLongList getLongList() {
-        long[] arr = getLongArray();
+    public final GridLongList getLongList(String name) {
+        long[] arr = getLongArray(name);
 
         if (arr == LONG_ARR_NOT_READ)
             return LONG_LIST_NOT_READ;
@@ -932,10 +795,11 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param name Field name.
      * @param ver {@link GridCacheVersion}.
      * @return Whether value was fully written.
      */
-    public final boolean putCacheVersion(@Nullable GridCacheVersion ver) {
+    public final boolean putCacheVersion(String name, @Nullable GridCacheVersion ver) {
         byte[] arr = null;
 
         if (ver != null) {
@@ -947,16 +811,17 @@ public class GridTcpCommunicationMessageState {
             UNSAFE.putLong(arr, BYTE_ARR_OFF + 16, ver.order());
         }
 
-        return putByteArray(arr);
+        return putByteArray(name, arr);
     }
 
     /**
+     * @param name Field name.
      * @return {@link GridCacheVersion} or special
      *      {@link GridTcpCommunicationMessageAdapter#CACHE_VER_NOT_READ}
      *      value if it was not fully read.
      */
-    public final GridCacheVersion getCacheVersion() {
-        byte[] arr = getByteArray();
+    public final GridCacheVersion getCacheVersion(String name) {
+        byte[] arr = getByteArray(name);
 
         if (arr == BYTE_ARR_NOT_READ)
             return CACHE_VER_NOT_READ;
@@ -973,10 +838,11 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param name Field name.
      * @param id {@link GridDhtPartitionExchangeId}.
      * @return Whether value was fully written.
      */
-    public final boolean putDhtPartitionExchangeId(@Nullable GridDhtPartitionExchangeId id) {
+    public final boolean putDhtPartitionExchangeId(String name, @Nullable GridDhtPartitionExchangeId id) {
         byte[] arr = null;
 
         if (id != null) {
@@ -988,16 +854,17 @@ public class GridTcpCommunicationMessageState {
             UNSAFE.putLong(arr, BYTE_ARR_OFF + 20, id.topologyVersion());
         }
 
-        return putByteArray(arr);
+        return putByteArray(name, arr);
     }
 
     /**
+     * @param name Field name.
      * @return {@link GridDhtPartitionExchangeId} or special
      *      {@link GridTcpCommunicationMessageAdapter#DHT_PART_EXCHANGE_ID_NOT_READ}
      *      value if it was not fully read.
      */
-    public final GridDhtPartitionExchangeId getDhtPartitionExchangeId() {
-        byte[] arr = getByteArray();
+    public final GridDhtPartitionExchangeId getDhtPartitionExchangeId(String name) {
+        byte[] arr = getByteArray(name);
 
         if (arr == BYTE_ARR_NOT_READ)
             return DHT_PART_EXCHANGE_ID_NOT_READ;
@@ -1014,20 +881,23 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param name Field name.
      * @param bytes {@link GridCacheValueBytes}.
      * @return Whether value was fully written.
      */
-    public final boolean putValueBytes(@Nullable GridCacheValueBytes bytes) {
+    public final boolean putValueBytes(String name, @Nullable GridCacheValueBytes bytes) {
         byte[] arr = null;
 
         if (bytes != null) {
-            if (bytes.get() != null) {
-                int len = bytes.get().length;
+            byte[] bytes0 = bytes.get();
+
+            if (bytes0 != null) {
+                int len = bytes0.length;
 
                 arr = new byte[len + 2];
 
                 UNSAFE.putBoolean(arr, BYTE_ARR_OFF, true);
-                UNSAFE.copyMemory(bytes.get(), BYTE_ARR_OFF, arr, BYTE_ARR_OFF + 1, len);
+                UNSAFE.copyMemory(bytes0, BYTE_ARR_OFF, arr, BYTE_ARR_OFF + 1, len);
                 UNSAFE.putBoolean(arr, BYTE_ARR_OFF + 1 + len, bytes.isPlain());
             }
             else {
@@ -1037,16 +907,17 @@ public class GridTcpCommunicationMessageState {
             }
         }
 
-        return putByteArray(arr);
+        return putByteArray(name, arr);
     }
 
     /**
+     * @param name Field name.
      * @return {@link GridCacheValueBytes} or special
      *      {@link GridTcpCommunicationMessageAdapter#VAL_BYTES_NOT_READ}
      *      value if it was not fully read.
      */
-    public final GridCacheValueBytes getValueBytes() {
-        byte[] arr = getByteArray();
+    public final GridCacheValueBytes getValueBytes(String name) {
+        byte[] arr = getByteArray(name);
 
         if (arr == BYTE_ARR_NOT_READ)
             return VAL_BYTES_NOT_READ;
@@ -1074,20 +945,22 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param name Field name.
      * @param str {@link String}.
      * @return Whether value was fully written.
      */
-    public final boolean putString(@Nullable String str) {
-        return putByteArray(str != null ? str.getBytes() : null);
+    public final boolean putString(String name, @Nullable String str) {
+        return putByteArray(name, str != null ? str.getBytes() : null);
     }
 
     /**
+     * @param name Field name.
      * @return {@link String} or special {@link GridTcpCommunicationMessageAdapter#STR_NOT_READ}
      *      value if it was not fully read.
      */
     @SuppressWarnings("IfMayBeConditional")
-    public final String getString() {
-        byte[] arr = getByteArray();
+    public final String getString(String name) {
+        byte[] arr = getByteArray(name);
 
         if (arr == BYTE_ARR_NOT_READ)
             return STR_NOT_READ;
@@ -1098,20 +971,22 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param name Field name.
      * @param bits {@link BitSet}.
      * @return Whether value was fully written.
      */
-    public final boolean putBitSet(@Nullable BitSet bits) {
-        return putLongArray(bits != null ? bits.toLongArray() : null);
+    public final boolean putBitSet(String name, @Nullable BitSet bits) {
+        return putLongArray(name, bits != null ? bits.toLongArray() : null);
     }
 
     /**
+     * @param name Field name.
      * @return {@link BitSet} or special {@link GridTcpCommunicationMessageAdapter#BIT_SET_NOT_READ}
      *      value if it was not fully read.
      */
     @SuppressWarnings("IfMayBeConditional")
-    public final BitSet getBitSet() {
-        long[] arr = getLongArray();
+    public final BitSet getBitSet(String name) {
+        long[] arr = getLongArray(name);
 
         if (arr == LONG_ARR_NOT_READ)
             return BIT_SET_NOT_READ;
@@ -1122,469 +997,69 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param name Field name.
      * @param e Enum.
      * @return Whether value was fully written.
      */
-    public final boolean putEnum(@Nullable Enum<?> e) {
-        return putByte(e != null ? (byte)e.ordinal() : -1);
+    public final boolean putEnum(String name, @Nullable Enum<?> e) {
+        return putByte(name, e != null ? (byte)e.ordinal() : -1);
     }
 
     /**
+     * @param name Field name.
      * @param msg {@link GridTcpCommunicationMessageAdapter}.
      * @return Whether value was fully written.
      */
-    public final boolean putMessage(@Nullable GridTcpCommunicationMessageAdapter msg) {
-        assert buf != null;
-
-        if (!msgNotNullDone) {
-            if (!putBoolean(msg != null))
+    public final boolean putMessage(String name, @Nullable GridTcpCommunicationMessageAdapter msg) {
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN)
                 return false;
 
-            msgNotNullDone = true;
-        }
-
-        if (msg != null) {
-            if (!msgWriter.write(nodeId, msg, buf))
-                return false;
+            writer.writeObject(name, msg);
 
-            msgNotNullDone = false;
+            hdrDone = true;
         }
+        else
+            stream.writeMessage(msg);
 
-        return true;
+        return lastWritten();
     }
 
     /**
+     * @param name Field name.
      * @return {@link GridTcpCommunicationMessageAdapter} or special
-     * {@link GridTcpCommunicationMessageAdapter#MSG_NOT_READ}
+     *      {@link GridTcpCommunicationMessageAdapter#MSG_NOT_READ}
      *      value if it was not fully read.
      */
-    public final GridTcpCommunicationMessageAdapter getMessage() {
-        assert buf != null;
+    public final GridTcpCommunicationMessageAdapter getMessage(String name) {
+        GridTcpCommunicationMessageAdapter msg;
 
-        if (!msgNotNullDone) {
-            if (!buf.hasRemaining())
+        if (!hdrDone) {
+            if (stream.remaining() < FIELD_HDR_LEN)
                 return MSG_NOT_READ;
 
-            msgNotNull = getBoolean();
-
-            msgNotNullDone = true;
-        }
-
-        if (msgNotNull) {
-            if (!msgTypeDone) {
-                if (!buf.hasRemaining())
-                    return MSG_NOT_READ;
-
-                GridTcpMessageFactory factory = msgReader.messageFactory();
-
-                byte type = getByte();
-
-                msg = factory != null ? factory.create(type) : GridTcpCommunicationMessageFactory.create(type);
-
-                msgTypeDone = true;
-            }
-
-            if (msgReader.read(nodeId, msg, buf)) {
-                GridTcpCommunicationMessageAdapter msg0 = msg;
+            msg = reader.readObject(name);
 
-                msgNotNullDone = false;
-                msgTypeDone = false;
-                msg = null;
-
-                return msg0;
-            }
-            else
-                return MSG_NOT_READ;
+            hdrDone = true;
         }
         else
-            return null;
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param len Length.
-     * @param bytes Length in bytes.
-     * @return Whether array was fully written
-     */
-    private boolean putArray(@Nullable Object arr, long off, int len, int bytes) {
-        assert off > 0;
-        assert len >= 0;
-        assert bytes >= 0;
-        assert bytes >= arrOff;
-
-        if (!buf.hasRemaining())
-            return false;
-
-        int pos = buf.position();
-
-        if (arr != null) {
-            assert arr.getClass().isArray() && arr.getClass().getComponentType().isPrimitive();
-
-            if (!arrHdrDone) {
-                if (buf.remaining() < 5)
-                    return false;
-
-                UNSAFE.putBoolean(heapArr, baseOff + pos++, true);
-                UNSAFE.putInt(heapArr, baseOff + pos, len);
-
-                pos += 4;
-
-                buf.position(pos);
-
-                arrHdrDone = true;
-            }
-
-            if (!buf.hasRemaining())
-                return false;
-
-            int left = bytes - arrOff;
-            int remaining = buf.remaining();
-
-            if (left <= remaining) {
-                UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, left);
-
-                pos += left;
-
-                buf.position(pos);
-
-                arrHdrDone = false;
-                arrOff = 0;
-            }
-            else {
-                UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, remaining);
-
-                pos += remaining;
-
-                buf.position(pos);
-
-                arrOff += remaining;
-
-                return false;
-            }
-        }
-        else {
-            UNSAFE.putBoolean(heapArr, baseOff + pos++, false);
-
-            buf.position(pos);
-        }
-
-        return true;
-    }
-
-    /**
-     * @param creator Array creator.
-     * @param lenShift Array length shift size.
-     * @param off Base offset.
-     * @return Array or special value if it was not fully read.
-     */
-    private <T> T getArray(ArrayCreator<T> creator, int lenShift, long off) {
-        assert creator != null;
-        assert lenShift >= 0;
-
-        if (!arrHdrDone) {
-            if (!buf.hasRemaining())
-                return creator.create(-1);
-
-            if (!getBoolean())
-                return null;
-
-            arrHdrDone = true;
-        }
-
-        if (tmpArr == null) {
-            if (buf.remaining() < 4)
-                return creator.create(-1);
-
-            int len = getInt();
-
-            if (len == 0) {
-                arrHdrDone = false;
-
-                return creator.create(0);
-            }
-
-            tmpArr = creator.create(len);
-            tmpArrBytes = len << lenShift;
-        }
-
-        int toRead = tmpArrBytes - tmpArrOff;
-        int remaining = buf.remaining();
-        int pos = buf.position();
-
-        if (remaining < toRead) {
-            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, remaining);
-
-            buf.position(pos + remaining);
-
-            tmpArrOff += remaining;
-
-            return creator.create(-1);
-        }
-        else {
-            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, toRead);
-
-            buf.position(pos + toRead);
-
-            T arr = (T)tmpArr;
-
-            arrHdrDone = false;
-            tmpArr = null;
-            tmpArrBytes = 0;
-            tmpArrOff = 0;
-
-            return arr;
-        }
-    }
-
-    /**
-     * @param i Integer value.
-     * @return Whether value was written.
-     */
-    public final boolean putIntClient(int i) {
-        assert buf != null;
-
-        if (buf.remaining() < 4)
-            return false;
-
-        putByte((byte)(0xFF & (i >>> 24)));
-        putByte((byte)(0xFF & (i >>> 16)));
-        putByte((byte)(0xFF & (i >>> 8)));
-        putByte((byte)(0xFF & i));
-
-        return true;
-    }
-
-    /**
-     * @return Integer value.
-     */
-    public final int getIntClient() {
-        assert buf != null;
-        assert buf.remaining() >= 4;
-
-        int val = 0;
-
-        val |= (0xFF & getByte()) << 24;
-        val |= (0xFF & getByte()) << 16;
-        val |= (0xFF & getByte()) << 8;
-        val |= (0xFF & getByte());
-
-        return val;
-    }
-
-    /**
-     * @param val Long value.
-     * @return Whether value was written.
-     */
-    public final boolean putLongClient(long val) {
-        assert buf != null;
-
-        if (buf.remaining() < 8)
-            return false;
-
-        putByte((byte)(val >>> 56));
-        putByte((byte)(0xFFL & (val >>> 48)));
-        putByte((byte)(0xFFL & (val >>> 40)));
-        putByte((byte)(0xFFL & (val >>> 32)));
-        putByte((byte)(0xFFL & (val >>> 24)));
-        putByte((byte)(0xFFL & (val >>> 16)));
-        putByte((byte)(0xFFL & (val >>> 8)));
-        putByte((byte) (0xFFL & val));
-
-        return true;
-    }
-
-    /**
-     * @return Long value.
-     */
-    public final long getLongClient() {
-        assert buf != null;
-        assert buf.remaining() >= 8;
-
-        long x = 0;
-
-        x |= (0xFFL & getByte()) << 56;
-        x |= (0xFFL & getByte()) << 48;
-        x |= (0xFFL & getByte()) << 40;
-        x |= (0xFFL & getByte()) << 32;
-        x |= (0xFFL & getByte()) << 24;
-        x |= (0xFFL & getByte()) << 16;
-        x |= (0xFFL & getByte()) << 8;
-        x |= (0xFFL & getByte());
-
-        return x;
-    }
-
-    /**
-     * @param uuid {@link UUID}.
-     * @return Whether value was fully written.
-     */
-    public final boolean putUuidClient(@Nullable UUID uuid) {
-        byte[] arr = uuid != null ? U.uuidToBytes(uuid) : EMPTY_UUID_BYTES;
-
-        return putByteArrayClient(arr);
-    }
-
-    /**
-     * @param arr Byte array.
-     * @return Whether array was fully written.
-     */
-    public final boolean putByteArrayClient(byte[] arr) {
-        assert buf != null;
-        assert arr != null;
-
-        return putArrayClient(arr, BYTE_ARR_OFF, arr.length, arr.length);
-    }
-
-    /**
-     * @param src Buffer.
-     * @return Whether array was fully written
-     */
-    public boolean putByteBufferClient(ByteBuffer src) {
-        assert src != null;
-        assert src.hasArray();
+            msg = stream.readMessage();
 
-        return putArrayClient(src.array(), BYTE_ARR_OFF + src.position(), src.remaining(), src.remaining());
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param len Length.
-     * @param bytes Length in bytes.
-     * @return Whether array was fully written
-     */
-    private boolean putArrayClient(Object arr, long off, int len, int bytes) {
-        assert off > 0;
-        assert len >= 0;
-        assert bytes >= 0;
-        assert bytes >= arrOff;
-        assert arr != null;
-
-        if (!buf.hasRemaining())
-            return false;
-
-        int pos = buf.position();
-
-        assert arr.getClass().isArray() && arr.getClass().getComponentType().isPrimitive();
-
-        if (!arrHdrDone)
-            arrHdrDone = true;
-
-        if (!buf.hasRemaining())
-            return false;
-
-        int left = bytes - arrOff;
-        int remaining = buf.remaining();
-
-        if (left <= remaining) {
-            UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, left);
-
-            pos += left;
-
-            buf.position(pos);
-
-            arrHdrDone = false;
-            arrOff = 0;
-        }
-        else {
-            UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, remaining);
-
-            pos += remaining;
-
-            buf.position(pos);
-
-            arrOff += remaining;
-
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * @param len Array length.
-     * @return Byte array or special {@link GridTcpCommunicationMessageAdapter#BYTE_ARR_NOT_READ}
-     *      value if it was not fully read.
-     */
-    public final byte[] getByteArrayClient(int len) {
-        assert buf != null;
+        if (msg != MSG_NOT_READ)
+            hdrDone = false;
 
-        return getArrayClient(BYTE_ARR_CREATOR, BYTE_ARR_OFF, len);
+        return msg;
     }
 
     /**
-     * @return {@link UUID} or special
-     *      {@link GridTcpCommunicationMessageAdapter#UUID_NOT_READ}
-     *      value if it was not fully read.
+     * @return Whether last array was fully written.
      */
-    public final UUID getUuidClient() {
-        byte[] arr = getByteArrayClient(16);
-
-        assert arr != null;
-
-        return arr == BYTE_ARR_NOT_READ ? UUID_NOT_READ : U.bytesToUuid(arr, 0);
-    }
-
-    /**
-     * @param creator Array creator.
-     * @param off Base offset.
-     * @param len Length.
-     * @return Array or special value if it was not fully read.
-     */
-    private <T> T getArrayClient(ArrayCreator<T> creator, long off, int len) {
-        assert creator != null;
-
-        if (tmpArr == null) {
-            tmpArr = creator.create(len);
-            tmpArrBytes = len;
-        }
-
-        int toRead = tmpArrBytes - tmpArrOff;
-        int remaining = buf.remaining();
-        int pos = buf.position();
-
-        if (remaining < toRead) {
-            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, remaining);
-
-            buf.position(pos + remaining);
+    private boolean lastWritten() {
+        boolean written = stream.lastWritten();
 
-            tmpArrOff += remaining;
+        if (written)
+            hdrDone = false;
 
-            return creator.create(-1);
-        }
-        else {
-            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, toRead);
-
-            buf.position(pos + toRead);
-
-            T arr = (T)tmpArr;
-
-            arrHdrDone = false;
-            tmpArr = null;
-            tmpArrBytes = 0;
-            tmpArrOff = 0;
-
-            return arr;
-        }
-    }
-
-    /**
-     * Array creator.
-     */
-    private static interface ArrayCreator<T> {
-        /**
-         * @param len Array length or {@code -1} if array was not fully read.
-         * @return New array.
-         */
-        public T create(int len);
-    }
-
-    /**
-     * Dummy enum.
-     */
-    private enum DummyEnum {
-        /** */
-        DUMMY
+        return written;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/ipc/GridIpcToNioAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/ipc/GridIpcToNioAdapter.java b/modules/core/src/main/java/org/gridgain/grid/util/ipc/GridIpcToNioAdapter.java
index 0222add..3f02666 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/ipc/GridIpcToNioAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/ipc/GridIpcToNioAdapter.java
@@ -10,9 +10,9 @@
 package org.gridgain.grid.util.ipc;
 
 import org.apache.ignite.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.util.direct.*;
 import org.gridgain.grid.util.nio.*;
+import org.gridgain.grid.util.typedef.internal.*;
 
 import java.io.*;
 import java.nio.*;
@@ -45,25 +45,19 @@ public class GridIpcToNioAdapter<T> {
     /** */
     private final GridNioMetricsListener metricsLsnr;
 
-    /** */
-    private final GridNioMessageWriter msgWriter;
-
     /**
      * @param metricsLsnr Metrics listener.
      * @param log Log.
      * @param endp Endpoint.
-     * @param msgWriter Message writer.
      * @param lsnr Listener.
      * @param filters Filters.
      */
     public GridIpcToNioAdapter(GridNioMetricsListener metricsLsnr, IgniteLogger log, GridIpcEndpoint endp,
-        GridNioMessageWriter msgWriter, GridNioServerListener<T> lsnr, GridNioFilter... filters) {
+        GridNioServerListener<T> lsnr, GridNioFilter... filters) {
         assert metricsLsnr != null;
-        assert msgWriter != null;
 
         this.metricsLsnr = metricsLsnr;
         this.endp = endp;
-        this.msgWriter = msgWriter;
 
         chain = new GridNioFilterChain<>(log, lsnr, new HeadFilter(), filters);
         ses = new GridNioSessionImpl(chain, null, null, true);
@@ -145,10 +139,7 @@ public class GridIpcToNioAdapter<T> {
         assert writeBuf.hasArray();
 
         try {
-            // This method is called only on handshake,
-            // so we don't need to provide node ID for
-            // rolling updates support.
-            int cnt = msgWriter.writeFully(null, msg, endp.outputStream(), writeBuf);
+            int cnt = U.writeMessageFully(msg, endp.outputStream(), writeBuf);
 
             metricsLsnr.onBytesSent(cnt);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridDirectParser.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridDirectParser.java b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridDirectParser.java
index 2a87162..cacb980 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridDirectParser.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridDirectParser.java
@@ -16,7 +16,6 @@ import org.jetbrains.annotations.*;
 
 import java.io.*;
 import java.nio.*;
-import java.util.*;
 
 /**
  * Parser for direct messages.
@@ -25,9 +24,6 @@ public class GridDirectParser implements GridNioParser {
     /** Message metadata key. */
     private static final int MSG_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
 
-    /** Message reader. */
-    private final GridNioMessageReader msgReader;
-
     /** */
     private IgniteSpiAdapter spi;
 
@@ -35,11 +31,9 @@ public class GridDirectParser implements GridNioParser {
     private GridTcpMessageFactory msgFactory;
 
     /**
-     * @param msgReader Message reader.
      * @param spi Spi.
      */
-    public GridDirectParser(GridNioMessageReader msgReader, IgniteSpiAdapter spi) {
-        this.msgReader = msgReader;
+    public GridDirectParser(IgniteSpiAdapter spi) {
         this.spi = spi;
     }
 
@@ -49,7 +43,6 @@ public class GridDirectParser implements GridNioParser {
             msgFactory = spi.getSpiContext().messageFactory();
 
         GridTcpCommunicationMessageAdapter msg = ses.removeMeta(MSG_META_KEY);
-        UUID nodeId = ses.meta(GridNioServer.DIFF_VER_NODE_ID_META_KEY);
 
         if (msg == null && buf.hasRemaining())
             msg = msgFactory.create(buf.get());
@@ -57,7 +50,7 @@ public class GridDirectParser implements GridNioParser {
         boolean finished = false;
 
         if (buf.hasRemaining())
-            finished = msgReader.read(nodeId, msg, buf);
+            finished = msg.readFrom(buf);
 
         if (finished)
             return msg;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioMessageReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioMessageReader.java b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioMessageReader.java
deleted file mode 100644
index 1d9529e..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioMessageReader.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.util.nio;
-
-import org.gridgain.grid.util.direct.*;
-import org.jetbrains.annotations.*;
-
-import java.nio.*;
-import java.util.*;
-
-/**
- * Message reader.
- */
-public interface GridNioMessageReader {
-    /**
-     * @param nodeId Node ID.
-     * @param msg Message to read.
-     * @param buf Buffer.
-     * @return Whether message was fully read.
-     */
-    public boolean read(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, ByteBuffer buf);
-
-    /**
-     * @return Optional message factory.
-     */
-    @Nullable public GridTcpMessageFactory messageFactory();
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioMessageWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioMessageWriter.java b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioMessageWriter.java
deleted file mode 100644
index 4271d77..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioMessageWriter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.util.nio;
-
-import org.gridgain.grid.util.direct.*;
-import org.jetbrains.annotations.*;
-
-import java.io.*;
-import java.nio.*;
-import java.util.*;
-
-/**
- * Message writer.
- */
-public interface GridNioMessageWriter {
-    /**
-     * @param nodeId Node ID.
-     * @param msg Message to write.
-     * @param buf Buffer.
-     * @return Whether message was fully written.
-     */
-    public boolean write(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, ByteBuffer buf);
-
-    /**
-     * @param nodeId Node ID.
-     * @param msg Message to write.
-     * @param out Output stream to write to.
-     * @param buf Buffer.
-     * @return Number of bytes written.
-     * @throws IOException In case of error.
-     */
-    public int writeFully(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, OutputStream out,
-        ByteBuffer buf) throws IOException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioServer.java b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioServer.java
index b0279ef..03c3763 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridNioServer.java
@@ -59,12 +59,9 @@ public class GridNioServer<T> {
     /** Buffer metadata key. */
     private static final int BUF_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
 
-    /** SSL sysmtem data buffer metadata key. */
+    /** SSL system data buffer metadata key. */
     private static final int BUF_SSL_SYSTEM_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
 
-    /** Node ID meta key (set only if versions are different). */
-    public static final int DIFF_VER_NODE_ID_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
-
     /** Accept worker thread. */
     @GridToStringExclude
     private final IgniteThread acceptThread;
@@ -126,9 +123,6 @@ public class GridNioServer<T> {
     /** Metrics listener. */
     private final GridNioMetricsListener metricsLsnr;
 
-    /** Message writer. */
-    private final GridNioMessageWriter msgWriter;
-
     /** Sessions. */
     private final GridConcurrentHashSet<GridSelectorNioSessionImpl> sessions = new GridConcurrentHashSet<>();
 
@@ -162,7 +156,6 @@ public class GridNioServer<T> {
      * @param directMode Whether direct mode is used.
      * @param daemon Daemon flag to create threads.
      * @param metricsLsnr Metrics listener.
-     * @param msgWriter Message writer.
      * @param filters Filters for this server.
      * @throws IgniteCheckedException If failed.
      */
@@ -182,7 +175,6 @@ public class GridNioServer<T> {
         boolean directMode,
         boolean daemon,
         GridNioMetricsListener metricsLsnr,
-        GridNioMessageWriter msgWriter,
         GridNioFilter... filters
     ) throws IgniteCheckedException {
         A.notNull(addr, "addr");
@@ -247,7 +239,6 @@ public class GridNioServer<T> {
 
         this.directMode = directMode;
         this.metricsLsnr = metricsLsnr;
-        this.msgWriter = msgWriter;
     }
 
     /**
@@ -855,7 +846,6 @@ public class GridNioServer<T> {
 
                 ByteBuffer buf = ses.writeBuffer();
                 NioOperationFuture<?> req = ses.removeMeta(NIO_OPERATION.ordinal());
-                UUID nodeId = ses.meta(DIFF_VER_NODE_ID_META_KEY);
 
                 List<NioOperationFuture<?>> doneFuts = null;
 
@@ -877,9 +867,8 @@ public class GridNioServer<T> {
                         msg = req.directMessage();
 
                         assert msg != null;
-                        assert msgWriter != null;
 
-                        finished = msgWriter.write(nodeId, msg, buf);
+                        finished = msg.writeTo(buf);
                     }
 
                     // Fill up as many messages as possible to write buffer.
@@ -897,9 +886,8 @@ public class GridNioServer<T> {
                         msg = req.directMessage();
 
                         assert msg != null;
-                        assert msgWriter != null;
 
-                        finished = msgWriter.write(nodeId, msg, buf);
+                        finished = msg.writeTo(buf);
                     }
 
                     buf.flip();
@@ -995,7 +983,6 @@ public class GridNioServer<T> {
             GridSelectorNioSessionImpl ses = (GridSelectorNioSessionImpl)key.attachment();
             ByteBuffer buf = ses.writeBuffer();
             NioOperationFuture<?> req = ses.removeMeta(NIO_OPERATION.ordinal());
-            UUID nodeId = ses.meta(DIFF_VER_NODE_ID_META_KEY);
 
             List<NioOperationFuture<?>> doneFuts = null;
 
@@ -1017,9 +1004,8 @@ public class GridNioServer<T> {
                     msg = req.directMessage();
 
                     assert msg != null;
-                    assert msgWriter != null;
 
-                    finished = msgWriter.write(nodeId, msg, buf);
+                    finished = msg.writeTo(buf);
                 }
 
                 // Fill up as many messages as possible to write buffer.
@@ -1037,9 +1023,8 @@ public class GridNioServer<T> {
                     msg = req.directMessage();
 
                     assert msg != null;
-                    assert msgWriter != null;
 
-                    finished = msgWriter.write(nodeId, msg, buf);
+                    finished = msg.writeTo(buf);
                 }
 
                 buf.flip();
@@ -2053,9 +2038,6 @@ public class GridNioServer<T> {
         /** Metrics listener. */
         private GridNioMetricsListener metricsLsnr;
 
-        /** Message writer. */
-        private GridNioMessageWriter msgWriter;
-
         /** NIO filters. */
         private GridNioFilter[] filters;
 
@@ -2091,7 +2073,6 @@ public class GridNioServer<T> {
                 directMode,
                 daemon,
                 metricsLsnr,
-                msgWriter,
                 filters != null ? Arrays.copyOf(filters, filters.length) : EMPTY_FILTERS
             );
 
@@ -2246,16 +2227,6 @@ public class GridNioServer<T> {
         }
 
         /**
-         * @param msgWriter Message writer.
-         * @return This for chaining.
-         */
-        public Builder<T> messageWriter(GridNioMessageWriter msgWriter) {
-            this.msgWriter = msgWriter;
-
-            return this;
-        }
-
-        /**
          * @param filters NIO filters.
          * @return This for chaining.
          */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridShmemCommunicationClient.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridShmemCommunicationClient.java b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridShmemCommunicationClient.java
index 501e7ee..56bbc94 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridShmemCommunicationClient.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridShmemCommunicationClient.java
@@ -10,12 +10,11 @@
 package org.gridgain.grid.util.nio;
 
 import org.apache.ignite.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.util.direct.*;
-import org.gridgain.grid.util.typedef.internal.*;
 import org.gridgain.grid.util.ipc.shmem.*;
-import org.jetbrains.annotations.*;
 import org.gridgain.grid.util.lang.*;
+import org.gridgain.grid.util.typedef.internal.*;
+import org.jetbrains.annotations.*;
 
 import java.io.*;
 import java.nio.*;
@@ -31,31 +30,23 @@ public class GridShmemCommunicationClient extends GridAbstractCommunicationClien
     /** */
     private final ByteBuffer writeBuf;
 
-    /** */
-    private final GridNioMessageWriter msgWriter;
-
     /**
      * @param metricsLsnr Metrics listener.
      * @param port Shared memory IPC server port.
      * @param connTimeout Connection timeout.
      * @param log Logger.
-     * @param msgWriter Message writer.
      * @throws IgniteCheckedException If failed.
      */
-    public GridShmemCommunicationClient(GridNioMetricsListener metricsLsnr, int port, long connTimeout, IgniteLogger log,
-        GridNioMessageWriter msgWriter)
-        throws IgniteCheckedException {
+    public GridShmemCommunicationClient(GridNioMetricsListener metricsLsnr, int port, long connTimeout,
+        IgniteLogger log) throws IgniteCheckedException {
         super(metricsLsnr);
 
         assert metricsLsnr != null;
-        assert msgWriter != null;
         assert port > 0 && port < 0xffff;
         assert connTimeout >= 0;
 
         shmem = new GridIpcSharedMemoryClientEndpoint(port, (int)connTimeout, log);
 
-        this.msgWriter = msgWriter;
-
         writeBuf = ByteBuffer.allocate(8 << 10);
 
         writeBuf.order(ByteOrder.nativeOrder());
@@ -111,7 +102,7 @@ public class GridShmemCommunicationClient extends GridAbstractCommunicationClien
         assert writeBuf.hasArray();
 
         try {
-            int cnt = msgWriter.writeFully(nodeId, msg, shmem.outputStream(), writeBuf);
+            int cnt = U.writeMessageFully(msg, shmem.outputStream(), writeBuf);
 
             metricsLsnr.onBytesSent(cnt);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridTcpCommunicationClient.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridTcpCommunicationClient.java b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridTcpCommunicationClient.java
index 632ce35..379e87e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/nio/GridTcpCommunicationClient.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/nio/GridTcpCommunicationClient.java
@@ -38,14 +38,10 @@ public class GridTcpCommunicationClient extends GridAbstractCommunicationClient
     private final double bufSizeRatio;
 
     /** */
-    private final GridNioMessageWriter msgWriter;
-
-    /** */
     private final ByteBuffer writeBuf;
 
     /**
      * @param metricsLsnr Metrics listener.
-     * @param msgWriter Message writer.
      * @param addr Address.
      * @param locHost Local address.
      * @param connTimeout Connect timeout.
@@ -59,7 +55,6 @@ public class GridTcpCommunicationClient extends GridAbstractCommunicationClient
      */
     public GridTcpCommunicationClient(
         GridNioMetricsListener metricsLsnr,
-        GridNioMessageWriter msgWriter,
         InetSocketAddress addr,
         InetAddress locHost,
         long connTimeout,
@@ -73,7 +68,6 @@ public class GridTcpCommunicationClient extends GridAbstractCommunicationClient
         super(metricsLsnr);
 
         assert metricsLsnr != null;
-        assert msgWriter != null;
         assert addr != null;
         assert locHost != null;
         assert connTimeout >= 0;
@@ -84,7 +78,6 @@ public class GridTcpCommunicationClient extends GridAbstractCommunicationClient
         A.ensure(bufSizeRatio > 0 && bufSizeRatio < 1,
             "Value of bufSizeRatio property must be between 0 and 1 (exclusive).");
 
-        this.msgWriter = msgWriter;
         this.minBufferedMsgCnt = minBufferedMsgCnt;
         this.bufSizeRatio = bufSizeRatio;
 
@@ -190,7 +183,7 @@ public class GridTcpCommunicationClient extends GridAbstractCommunicationClient
         assert writeBuf.hasArray();
 
         try {
-            int cnt = msgWriter.writeFully(nodeId, msg, out, writeBuf);
+            int cnt = U.writeMessageFully(msg, out, writeBuf);
 
             metricsLsnr.onBytesSent(cnt);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java
index 58cb184..a82aecc 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java
@@ -111,7 +111,7 @@ public class GridTestMessage extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -119,25 +119,25 @@ public class GridTestMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putUuid(srcNodeId))
+                if (!commState.putUuid(null, srcNodeId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putLong(msgId))
+                if (!commState.putLong(null, msgId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(resId))
+                if (!commState.putLong(null, resId))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putByteArray(payload))
+                if (!commState.putByteArray(null, payload))
                     return false;
 
                 commState.idx++;
@@ -153,7 +153,7 @@ public class GridTestMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                srcNodeId = commState.getUuid();
+                srcNodeId = commState.getUuid(null);
 
                 if (srcNodeId == UUID_NOT_READ)
                     return false;
@@ -164,7 +164,7 @@ public class GridTestMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 8)
                     return false;
 
-                msgId = commState.getLong();
+                msgId = commState.getLong(null);
 
                 commState.idx++;
 
@@ -172,12 +172,12 @@ public class GridTestMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 8)
                     return false;
 
-                resId = commState.getLong();
+                resId = commState.getLong(null);
 
                 commState.idx++;
 
             case 3:
-                payload = commState.getByteArray();
+                payload = commState.getByteArray(null);
 
                 if (payload == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/test/java/org/gridgain/grid/kernal/managers/communication/GridCommunicationSendMessageSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/managers/communication/GridCommunicationSendMessageSelfTest.java b/modules/core/src/test/java/org/gridgain/grid/kernal/managers/communication/GridCommunicationSendMessageSelfTest.java
index 5c3e2ab..e398d9f 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/managers/communication/GridCommunicationSendMessageSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/managers/communication/GridCommunicationSendMessageSelfTest.java
@@ -149,7 +149,7 @@ public class GridCommunicationSendMessageSelfTest extends GridCommonAbstractTest
         @Override public boolean writeTo(ByteBuffer buf) {
             commState.setBuffer(buf);
 
-            return commState.putByte(directType());
+            return commState.putByte(null, directType());
         }
 
         /** {@inheritDoc} */


[12/20] incubator-ignite git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-61

Posted by vk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-61


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

Branch: refs/heads/ignite-61
Commit: 469f3651cf7bd16163acfdae5b5abb77d6dd0e2d
Parents: 1767ba5 47cf475
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Fri Dec 19 14:59:17 2014 +0300
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Fri Dec 19 14:59:17 2014 +0300

----------------------------------------------------------------------
 ipc/shmem/ggshmem/Makefile.am                   |     2 +-
 ipc/shmem/ggshmem/Makefile.in                   |     2 +-
 .../java/META-INF/native/linux32/libggshmem.so  |   Bin 136714 -> 0 bytes
 .../java/META-INF/native/linux64/libggshmem.so  |   Bin 145904 -> 161925 bytes
 .../java/META-INF/native/osx/libggshmem.dylib   |   Bin 29312 -> 32940 bytes
 .../optimized-classnames.previous.properties    | 30621 -----------------
 .../optimized/optimized-classnames.properties   | 30621 -----------------
 .../grid/kernal/visor/cache/VisorCache.java     |     4 +-
 .../cache/VisorCacheAggregatedMetrics.java      |   417 +-
 .../kernal/visor/cache/VisorCacheMetrics.java   |   176 +-
 .../kernal/visor/cache/VisorCacheMetrics2.java  |   218 -
 .../cache/VisorCacheMetricsCollectorTask.java   |   104 +-
 .../cache/VisorCacheQueryAggregatedMetrics.java |   129 -
 .../visor/cache/VisorCacheQueryMetrics.java     |    44 +-
 .../visor/node/VisorGridConfiguration.java      |     2 +-
 .../VisorNodeConfigurationCollectorJob.java     |     2 +-
 .../grid/kernal/visor/util/VisorTaskUtils.java  |    42 +
 .../core/src/main/resources/gridgain.properties |     2 +-
 .../commands/cache/VisorCacheCommand.scala      |   127 +-
 .../visor/commands/vvm/VisorVvmCommand.scala    |     9 +-
 20 files changed, 454 insertions(+), 62068 deletions(-)
----------------------------------------------------------------------



[19/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
IGNITE-61 - Portable format in direct marshalling


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

Branch: refs/heads/ignite-61
Commit: f5b3f26e4ff9f8dbcbd1089aa9ddd309e462edc6
Parents: d0ecc3f
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Dec 22 14:39:29 2014 -0800
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Dec 22 14:39:29 2014 -0800

----------------------------------------------------------------------
 .../jobstealing/JobStealingRequest.java         | 12 +--
 .../grid/kernal/GridJobCancelRequest.java       | 12 +--
 .../grid/kernal/GridJobExecuteRequest.java      | 80 ++++++++---------
 .../grid/kernal/GridJobExecuteRequestV2.java    |  4 +-
 .../grid/kernal/GridJobExecuteResponse.java     | 28 +++---
 .../grid/kernal/GridJobSiblingsRequest.java     |  8 +-
 .../grid/kernal/GridJobSiblingsResponse.java    |  4 +-
 .../grid/kernal/GridTaskCancelRequest.java      |  4 +-
 .../grid/kernal/GridTaskSessionRequest.java     | 12 +--
 .../checkpoint/GridCheckpointRequest.java       | 12 +--
 .../managers/communication/GridIoMessage.java   | 28 +++---
 .../communication/GridIoUserMessage.java        | 26 +++---
 .../deployment/GridDeploymentInfoBean.java      | 18 ++--
 .../deployment/GridDeploymentRequest.java       | 16 ++--
 .../deployment/GridDeploymentResponse.java      | 12 +--
 .../eventstorage/GridEventStorageMessage.java   | 34 ++++----
 .../cache/GridCacheEvictionRequest.java         | 12 +--
 .../cache/GridCacheEvictionResponse.java        |  8 +-
 .../processors/cache/GridCacheMessage.java      | 12 +--
 ...idCacheOptimisticCheckPreparedTxRequest.java | 16 ++--
 ...dCacheOptimisticCheckPreparedTxResponse.java | 12 +--
 ...CachePessimisticCheckCommittedTxRequest.java | 24 +++---
 ...achePessimisticCheckCommittedTxResponse.java | 12 +--
 .../distributed/GridDistributedBaseMessage.java | 12 +--
 .../distributed/GridDistributedLockRequest.java | 56 ++++++------
 .../GridDistributedLockResponse.java            |  8 +-
 .../GridDistributedTxFinishRequest.java         | 90 ++++++++++----------
 .../GridDistributedTxFinishResponse.java        |  8 +-
 .../GridDistributedTxPrepareRequest.java        | 44 +++++-----
 .../GridDistributedTxPrepareResponse.java       |  8 +-
 .../dht/GridDhtAffinityAssignmentRequest.java   |  4 +-
 .../dht/GridDhtAffinityAssignmentResponse.java  |  8 +-
 .../distributed/dht/GridDhtLockRequest.java     | 28 +++---
 .../distributed/dht/GridDhtLockResponse.java    |  4 +-
 .../distributed/dht/GridDhtTxFinishRequest.java | 36 ++++----
 .../dht/GridDhtTxFinishResponse.java            |  4 +-
 .../dht/GridDhtTxPrepareRequest.java            | 44 +++++-----
 .../dht/GridDhtTxPrepareResponse.java           |  8 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  | 44 +++++-----
 .../dht/atomic/GridDhtAtomicUpdateResponse.java | 12 +--
 .../dht/atomic/GridNearAtomicUpdateRequest.java | 56 ++++++------
 .../atomic/GridNearAtomicUpdateResponse.java    | 28 +++---
 .../dht/preloader/GridDhtForceKeysRequest.java  | 12 +--
 .../dht/preloader/GridDhtForceKeysResponse.java | 12 +--
 .../GridDhtPartitionDemandMessage.java          | 20 ++---
 .../GridDhtPartitionSupplyMessage.java          | 16 ++--
 .../GridDhtPartitionsAbstractMessage.java       |  8 +-
 .../preloader/GridDhtPartitionsFullMessage.java | 12 +--
 .../GridDhtPartitionsSingleMessage.java         |  4 +-
 .../distributed/near/GridNearGetRequest.java    | 28 +++---
 .../distributed/near/GridNearGetResponse.java   | 24 +++---
 .../distributed/near/GridNearLockRequest.java   | 32 +++----
 .../distributed/near/GridNearLockResponse.java  |  8 +-
 .../near/GridNearTxFinishRequest.java           | 20 ++---
 .../near/GridNearTxFinishResponse.java          | 12 +--
 .../near/GridNearTxPrepareRequest.java          | 29 ++++---
 .../near/GridNearTxPrepareResponse.java         | 12 +--
 .../cache/query/GridCacheQueryRequest.java      | 76 ++++++++---------
 .../cache/query/GridCacheQueryResponse.java     | 16 ++--
 .../clock/GridClockDeltaSnapshotMessage.java    |  6 +-
 .../continuous/GridContinuousMessage.java       | 18 ++--
 .../dataload/GridDataLoadRequest.java           | 46 +++++-----
 .../dataload/GridDataLoadResponse.java          | 12 +--
 .../processors/ggfs/GridGgfsAckMessage.java     | 12 +--
 .../processors/ggfs/GridGgfsBlockKey.java       | 16 ++--
 .../processors/ggfs/GridGgfsBlocksMessage.java  | 10 +--
 .../processors/ggfs/GridGgfsDeleteMessage.java  |  8 +-
 .../ggfs/GridGgfsFileAffinityRange.java         | 20 ++---
 .../ggfs/GridGgfsFragmentizerRequest.java       |  4 +-
 .../ggfs/GridGgfsFragmentizerResponse.java      |  4 +-
 .../processors/ggfs/GridGgfsSyncMessage.java    |  8 +-
 .../GridClientHandshakeRequestWrapper.java      | 14 +--
 .../GridClientHandshakeResponseWrapper.java     | 20 +++++
 .../message/GridClientMessageWrapper.java       | 56 ++++++------
 .../message/GridClientPingPacketWrapper.java    | 17 +++-
 .../handlers/task/GridTaskResultRequest.java    |  8 +-
 .../handlers/task/GridTaskResultResponse.java   | 16 ++--
 .../tcp/GridMemcachedMessageWrapper.java        | 19 ++++-
 .../streamer/GridStreamerCancelRequest.java     |  4 +-
 .../streamer/GridStreamerExecutionRequest.java  | 26 +++---
 .../streamer/GridStreamerResponse.java          |  8 +-
 .../GridTcpCommunicationMessageState.java       | 27 ++++++
 82 files changed, 852 insertions(+), 776 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
index 0c4e968..a6c3346 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
@@ -69,15 +69,15 @@ public class JobStealingRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-//            if (!commState.writeByte(directType()))
-//                return false;
-//
-//            commState.typeWritten = true;
+            if (!commState.putByte(null, directType()))
+                return false;
+
+            commState.typeWritten = true;
         }
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putInt(null, delta))
+                if (!commState.putInt("delta", delta))
                     return false;
 
                 commState.idx++;
@@ -97,7 +97,7 @@ public class JobStealingRequest extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 4)
                     return false;
 
-                delta = commState.getInt(null);
+                delta = commState.getInt("delta");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java
index 1c0e1a4..00fc2e5 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java
@@ -134,19 +134,19 @@ public class GridJobCancelRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, jobId))
+                if (!commState.putGridUuid("jobId", jobId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, sesId))
+                if (!commState.putGridUuid("sesId", sesId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(null, sys))
+                if (!commState.putBoolean("sys", sys))
                     return false;
 
                 commState.idx++;
@@ -163,7 +163,7 @@ public class GridJobCancelRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid jobId0 = commState.getGridUuid(null);
+                IgniteUuid jobId0 = commState.getGridUuid("jobId");
 
                 if (jobId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -173,7 +173,7 @@ public class GridJobCancelRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                IgniteUuid sesId0 = commState.getGridUuid(null);
+                IgniteUuid sesId0 = commState.getGridUuid("sesId");
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -186,7 +186,7 @@ public class GridJobCancelRequest extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                sys = commState.getBoolean(null);
+                sys = commState.getBoolean("sys");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java
index 2e3eba7..c7e3bcc 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java
@@ -432,8 +432,8 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
         _clone.cpSpi = cpSpi;
         _clone.siblings = siblings;
         _clone.siblingsBytes = siblingsBytes;
-        _clone.createTime = createTime;
         _clone.createTime0 = createTime0;
+        _clone.createTime = createTime;
         _clone.clsLdrId = clsLdrId;
         _clone.depMode = depMode;
         _clone.dynamicSiblings = dynamicSiblings;
@@ -457,61 +457,61 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, clsLdrId))
+                if (!commState.putGridUuid("clsLdrId", clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putString(null, cpSpi))
+                if (!commState.putString("cpSpi", cpSpi))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(null, createTime))
+                if (!commState.putLong("createTime", createTime))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putEnum(null, depMode))
+                if (!commState.putEnum("depMode", depMode))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putBoolean(null, dynamicSiblings))
+                if (!commState.putBoolean("dynamicSiblings", dynamicSiblings))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putBoolean(null, forceLocDep))
+                if (!commState.putBoolean("forceLocDep", forceLocDep))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putBoolean(null, internal))
+                if (!commState.putBoolean("internal", internal))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putByteArray(null, jobAttrsBytes))
+                if (!commState.putByteArray("jobAttrsBytes", jobAttrsBytes))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putByteArray(null, jobBytes))
+                if (!commState.putByteArray("jobBytes", jobBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(null, jobId))
+                if (!commState.putGridUuid("jobId", jobId))
                     return false;
 
                 commState.idx++;
@@ -555,49 +555,49 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 11:
-                if (!commState.putByteArray(null, sesAttrsBytes))
+                if (!commState.putByteArray("sesAttrsBytes", sesAttrsBytes))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(null, sesFullSup))
+                if (!commState.putBoolean("sesFullSup", sesFullSup))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putGridUuid(null, sesId))
+                if (!commState.putGridUuid("sesId", sesId))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putByteArray(null, siblingsBytes))
+                if (!commState.putByteArray("siblingsBytes", siblingsBytes))
                     return false;
 
                 commState.idx++;
 
             case 15:
-                if (!commState.putLong(null, startTaskTime))
+                if (!commState.putLong("startTaskTime", startTaskTime))
                     return false;
 
                 commState.idx++;
 
             case 16:
-                if (!commState.putString(null, taskClsName))
+                if (!commState.putString("taskClsName", taskClsName))
                     return false;
 
                 commState.idx++;
 
             case 17:
-                if (!commState.putString(null, taskName))
+                if (!commState.putString("taskName", taskName))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putLong(null, timeout))
+                if (!commState.putLong("timeout", timeout))
                     return false;
 
                 commState.idx++;
@@ -630,7 +630,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 20:
-                if (!commState.putString(null, userVer))
+                if (!commState.putString("userVer", userVer))
                     return false;
 
                 commState.idx++;
@@ -647,7 +647,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
+                IgniteUuid clsLdrId0 = commState.getGridUuid("clsLdrId");
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -657,7 +657,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 1:
-                String cpSpi0 = commState.getString(null);
+                String cpSpi0 = commState.getString("cpSpi");
 
                 if (cpSpi0 == STR_NOT_READ)
                     return false;
@@ -670,7 +670,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 8)
                     return false;
 
-                createTime = commState.getLong(null);
+                createTime = commState.getLong("createTime");
 
                 commState.idx++;
 
@@ -678,7 +678,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte(null);
+                byte depMode0 = commState.getByte("depMode");
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -688,7 +688,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                dynamicSiblings = commState.getBoolean(null);
+                dynamicSiblings = commState.getBoolean("dynamicSiblings");
 
                 commState.idx++;
 
@@ -696,7 +696,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                forceLocDep = commState.getBoolean(null);
+                forceLocDep = commState.getBoolean("forceLocDep");
 
                 commState.idx++;
 
@@ -704,12 +704,12 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                internal = commState.getBoolean(null);
+                internal = commState.getBoolean("internal");
 
                 commState.idx++;
 
             case 7:
-                byte[] jobAttrsBytes0 = commState.getByteArray(null);
+                byte[] jobAttrsBytes0 = commState.getByteArray("jobAttrsBytes");
 
                 if (jobAttrsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -719,7 +719,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 8:
-                byte[] jobBytes0 = commState.getByteArray(null);
+                byte[] jobBytes0 = commState.getByteArray("jobBytes");
 
                 if (jobBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -729,7 +729,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 9:
-                IgniteUuid jobId0 = commState.getGridUuid(null);
+                IgniteUuid jobId0 = commState.getGridUuid("jobId");
 
                 if (jobId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -748,7 +748,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
 
                 if (commState.readSize >= 0) {
                     if (ldrParticipants == null)
-                        ldrParticipants = U.newHashMap(commState.readSize);
+                        ldrParticipants = new HashMap<>(commState.readSize, 1.0f);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
@@ -781,7 +781,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 11:
-                byte[] sesAttrsBytes0 = commState.getByteArray(null);
+                byte[] sesAttrsBytes0 = commState.getByteArray("sesAttrsBytes");
 
                 if (sesAttrsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -794,12 +794,12 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                sesFullSup = commState.getBoolean(null);
+                sesFullSup = commState.getBoolean("sesFullSup");
 
                 commState.idx++;
 
             case 13:
-                IgniteUuid sesId0 = commState.getGridUuid(null);
+                IgniteUuid sesId0 = commState.getGridUuid("sesId");
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -809,7 +809,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 14:
-                byte[] siblingsBytes0 = commState.getByteArray(null);
+                byte[] siblingsBytes0 = commState.getByteArray("siblingsBytes");
 
                 if (siblingsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -822,12 +822,12 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 8)
                     return false;
 
-                startTaskTime = commState.getLong(null);
+                startTaskTime = commState.getLong("startTaskTime");
 
                 commState.idx++;
 
             case 16:
-                String taskClsName0 = commState.getString(null);
+                String taskClsName0 = commState.getString("taskClsName");
 
                 if (taskClsName0 == STR_NOT_READ)
                     return false;
@@ -837,7 +837,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 17:
-                String taskName0 = commState.getString(null);
+                String taskName0 = commState.getString("taskName");
 
                 if (taskName0 == STR_NOT_READ)
                     return false;
@@ -850,7 +850,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong(null);
+                timeout = commState.getLong("timeout");
 
                 commState.idx++;
 
@@ -884,7 +884,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 20:
-                String userVer0 = commState.getString(null);
+                String userVer0 = commState.getString("userVer");
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java
index cf70842..9e3e583 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java
@@ -137,7 +137,7 @@ public class GridJobExecuteRequestV2 extends GridJobExecuteRequest {
 
         switch (commState.idx) {
             case 21:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
@@ -156,7 +156,7 @@ public class GridJobExecuteRequestV2 extends GridJobExecuteRequest {
 
         switch (commState.idx) {
             case 21:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java
index 88e7483..2ef82d8 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java
@@ -229,43 +229,43 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, gridExBytes))
+                if (!commState.putByteArray("gridExBytes", gridExBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(null, isCancelled))
+                if (!commState.putBoolean("isCancelled", isCancelled))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putByteArray(null, jobAttrsBytes))
+                if (!commState.putByteArray("jobAttrsBytes", jobAttrsBytes))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putGridUuid(null, jobId))
+                if (!commState.putGridUuid("jobId", jobId))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putUuid(null, nodeId))
+                if (!commState.putUuid("nodeId", nodeId))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putByteArray(null, resBytes))
+                if (!commState.putByteArray("resBytes", resBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putGridUuid(null, sesId))
+                if (!commState.putGridUuid("sesId", sesId))
                     return false;
 
                 commState.idx++;
@@ -282,7 +282,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                byte[] gridExBytes0 = commState.getByteArray(null);
+                byte[] gridExBytes0 = commState.getByteArray("gridExBytes");
 
                 if (gridExBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -295,12 +295,12 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 if (buf.remaining() < 1)
                     return false;
 
-                isCancelled = commState.getBoolean(null);
+                isCancelled = commState.getBoolean("isCancelled");
 
                 commState.idx++;
 
             case 2:
-                byte[] jobAttrsBytes0 = commState.getByteArray(null);
+                byte[] jobAttrsBytes0 = commState.getByteArray("jobAttrsBytes");
 
                 if (jobAttrsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -310,7 +310,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 3:
-                IgniteUuid jobId0 = commState.getGridUuid(null);
+                IgniteUuid jobId0 = commState.getGridUuid("jobId");
 
                 if (jobId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -320,7 +320,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 4:
-                UUID nodeId0 = commState.getUuid(null);
+                UUID nodeId0 = commState.getUuid("nodeId");
 
                 if (nodeId0 == UUID_NOT_READ)
                     return false;
@@ -330,7 +330,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 5:
-                byte[] resBytes0 = commState.getByteArray(null);
+                byte[] resBytes0 = commState.getByteArray("resBytes");
 
                 if (resBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -340,7 +340,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 6:
-                IgniteUuid sesId0 = commState.getGridUuid(null);
+                IgniteUuid sesId0 = commState.getGridUuid("sesId");
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java
index a852d23..31bf8e0 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java
@@ -108,13 +108,13 @@ public class GridJobSiblingsRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, sesId))
+                if (!commState.putGridUuid("sesId", sesId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putByteArray(null, topicBytes))
+                if (!commState.putByteArray("topicBytes", topicBytes))
                     return false;
 
                 commState.idx++;
@@ -131,7 +131,7 @@ public class GridJobSiblingsRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid sesId0 = commState.getGridUuid(null);
+                IgniteUuid sesId0 = commState.getGridUuid("sesId");
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -141,7 +141,7 @@ public class GridJobSiblingsRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                byte[] topicBytes0 = commState.getByteArray(null);
+                byte[] topicBytes0 = commState.getByteArray("topicBytes");
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java
index 55e17f5..81821b1 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java
@@ -100,7 +100,7 @@ public class GridJobSiblingsResponse extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, siblingsBytes))
+                if (!commState.putByteArray("siblingsBytes", siblingsBytes))
                     return false;
 
                 commState.idx++;
@@ -117,7 +117,7 @@ public class GridJobSiblingsResponse extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                byte[] siblingsBytes0 = commState.getByteArray(null);
+                byte[] siblingsBytes0 = commState.getByteArray("siblingsBytes");
 
                 if (siblingsBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java
index 15ae1ad..d1ae101 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java
@@ -83,7 +83,7 @@ public class GridTaskCancelRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, sesId))
+                if (!commState.putGridUuid("sesId", sesId))
                     return false;
 
                 commState.idx++;
@@ -100,7 +100,7 @@ public class GridTaskCancelRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid sesId0 = commState.getGridUuid(null);
+                IgniteUuid sesId0 = commState.getGridUuid("sesId");
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java
index 86457da..8c9c63e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java
@@ -123,19 +123,19 @@ public class GridTaskSessionRequest extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, attrsBytes))
+                if (!commState.putByteArray("attrsBytes", attrsBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, jobId))
+                if (!commState.putGridUuid("jobId", jobId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putGridUuid(null, sesId))
+                if (!commState.putGridUuid("sesId", sesId))
                     return false;
 
                 commState.idx++;
@@ -152,7 +152,7 @@ public class GridTaskSessionRequest extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                byte[] attrsBytes0 = commState.getByteArray(null);
+                byte[] attrsBytes0 = commState.getByteArray("attrsBytes");
 
                 if (attrsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -162,7 +162,7 @@ public class GridTaskSessionRequest extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 1:
-                IgniteUuid jobId0 = commState.getGridUuid(null);
+                IgniteUuid jobId0 = commState.getGridUuid("jobId");
 
                 if (jobId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -172,7 +172,7 @@ public class GridTaskSessionRequest extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 2:
-                IgniteUuid sesId0 = commState.getGridUuid(null);
+                IgniteUuid sesId0 = commState.getGridUuid("sesId");
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java
index c7ca93c..8932cc3 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java
@@ -108,19 +108,19 @@ public class GridCheckpointRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putString(null, cpSpi))
+                if (!commState.putString("cpSpi", cpSpi))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putString(null, key))
+                if (!commState.putString("key", key))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putGridUuid(null, sesId))
+                if (!commState.putGridUuid("sesId", sesId))
                     return false;
 
                 commState.idx++;
@@ -137,7 +137,7 @@ public class GridCheckpointRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                String cpSpi0 = commState.getString(null);
+                String cpSpi0 = commState.getString("cpSpi");
 
                 if (cpSpi0 == STR_NOT_READ)
                     return false;
@@ -147,7 +147,7 @@ public class GridCheckpointRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                String key0 = commState.getString(null);
+                String key0 = commState.getString("key");
 
                 if (key0 == STR_NOT_READ)
                     return false;
@@ -157,7 +157,7 @@ public class GridCheckpointRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 2:
-                IgniteUuid sesId0 = commState.getGridUuid(null);
+                IgniteUuid sesId0 = commState.getGridUuid("sesId");
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java
index d9c11a5..098f52a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java
@@ -222,43 +222,43 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putMessage(null, msg))
+                if (!commState.putMessage("msg", msg))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putLong(null, msgId))
+                if (!commState.putLong("msgId", msgId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putEnum(null, plc))
+                if (!commState.putEnum("plc", plc))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putBoolean(null, skipOnTimeout))
+                if (!commState.putBoolean("skipOnTimeout", skipOnTimeout))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(null, timeout))
+                if (!commState.putLong("timeout", timeout))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putByteArray(null, topicBytes))
+                if (!commState.putByteArray("topicBytes", topicBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putInt(null, topicOrd))
+                if (!commState.putInt("topicOrd", topicOrd))
                     return false;
 
                 commState.idx++;
@@ -275,7 +275,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                Object msg0 = commState.getMessage(null);
+                Object msg0 = commState.getMessage("msg");
 
                 if (msg0 == MSG_NOT_READ)
                     return false;
@@ -288,7 +288,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 8)
                     return false;
 
-                msgId = commState.getLong(null);
+                msgId = commState.getLong("msgId");
 
                 commState.idx++;
 
@@ -296,7 +296,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                byte plc0 = commState.getByte(null);
+                byte plc0 = commState.getByte("plc");
 
                 plc = GridIoPolicy.fromOrdinal(plc0);
 
@@ -306,7 +306,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                skipOnTimeout = commState.getBoolean(null);
+                skipOnTimeout = commState.getBoolean("skipOnTimeout");
 
                 commState.idx++;
 
@@ -314,12 +314,12 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong(null);
+                timeout = commState.getLong("timeout");
 
                 commState.idx++;
 
             case 5:
-                byte[] topicBytes0 = commState.getByteArray(null);
+                byte[] topicBytes0 = commState.getByteArray("topicBytes");
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -332,7 +332,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 4)
                     return false;
 
-                topicOrd = commState.getInt(null);
+                topicOrd = commState.getInt("topicOrd");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java
index 2859016..3c5c459 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java
@@ -234,25 +234,25 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, bodyBytes))
+                if (!commState.putByteArray("bodyBytes", bodyBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, clsLdrId))
+                if (!commState.putGridUuid("clsLdrId", clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putString(null, depClsName))
+                if (!commState.putString("depClsName", depClsName))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putEnum(null, depMode))
+                if (!commState.putEnum("depMode", depMode))
                     return false;
 
                 commState.idx++;
@@ -296,13 +296,13 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 5:
-                if (!commState.putByteArray(null, topicBytes))
+                if (!commState.putByteArray("topicBytes", topicBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putString(null, userVer))
+                if (!commState.putString("userVer", userVer))
                     return false;
 
                 commState.idx++;
@@ -319,7 +319,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                byte[] bodyBytes0 = commState.getByteArray(null);
+                byte[] bodyBytes0 = commState.getByteArray("bodyBytes");
 
                 if (bodyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -329,7 +329,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
+                IgniteUuid clsLdrId0 = commState.getGridUuid("clsLdrId");
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -339,7 +339,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 2:
-                String depClsName0 = commState.getString(null);
+                String depClsName0 = commState.getString("depClsName");
 
                 if (depClsName0 == STR_NOT_READ)
                     return false;
@@ -352,7 +352,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte(null);
+                byte depMode0 = commState.getByte("depMode");
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -368,7 +368,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
 
                 if (commState.readSize >= 0) {
                     if (ldrParties == null)
-                        ldrParties = U.newHashMap(commState.readSize);
+                        ldrParties = new HashMap<>(commState.readSize, 1.0f);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
@@ -401,7 +401,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 5:
-                byte[] topicBytes0 = commState.getByteArray(null);
+                byte[] topicBytes0 = commState.getByteArray("topicBytes");
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -411,7 +411,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 6:
-                String userVer0 = commState.getString(null);
+                String userVer0 = commState.getString("userVer");
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java
index c294a8c..f9d1d85 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java
@@ -164,19 +164,19 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, clsLdrId))
+                if (!commState.putGridUuid("clsLdrId", clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putEnum(null, depMode))
+                if (!commState.putEnum("depMode", depMode))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(null, locDepOwner))
+                if (!commState.putBoolean("locDepOwner", locDepOwner))
                     return false;
 
                 commState.idx++;
@@ -220,7 +220,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 4:
-                if (!commState.putString(null, userVer))
+                if (!commState.putString("userVer", userVer))
                     return false;
 
                 commState.idx++;
@@ -237,7 +237,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
+                IgniteUuid clsLdrId0 = commState.getGridUuid("clsLdrId");
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -250,7 +250,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte(null);
+                byte depMode0 = commState.getByte("depMode");
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -260,7 +260,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                 if (buf.remaining() < 1)
                     return false;
 
-                locDepOwner = commState.getBoolean(null);
+                locDepOwner = commState.getBoolean("locDepOwner");
 
                 commState.idx++;
 
@@ -274,7 +274,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
 
                 if (commState.readSize >= 0) {
                     if (participants == null)
-                        participants = U.newHashMap(commState.readSize);
+                        participants = new HashMap<>(commState.readSize, 1.0f);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
@@ -307,7 +307,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 4:
-                String userVer0 = commState.getString(null);
+                String userVer0 = commState.getString("userVer");
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java
index ffcd805..3dcc483 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java
@@ -183,13 +183,13 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putBoolean(null, isUndeploy))
+                if (!commState.putBoolean("isUndeploy", isUndeploy))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, ldrId))
+                if (!commState.putGridUuid("ldrId", ldrId))
                     return false;
 
                 commState.idx++;
@@ -222,13 +222,13 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 3:
-                if (!commState.putByteArray(null, resTopicBytes))
+                if (!commState.putByteArray("resTopicBytes", resTopicBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putString(null, rsrcName))
+                if (!commState.putString("rsrcName", rsrcName))
                     return false;
 
                 commState.idx++;
@@ -248,12 +248,12 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                isUndeploy = commState.getBoolean(null);
+                isUndeploy = commState.getBoolean("isUndeploy");
 
                 commState.idx++;
 
             case 1:
-                IgniteUuid ldrId0 = commState.getGridUuid(null);
+                IgniteUuid ldrId0 = commState.getGridUuid("ldrId");
 
                 if (ldrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -292,7 +292,7 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 3:
-                byte[] resTopicBytes0 = commState.getByteArray(null);
+                byte[] resTopicBytes0 = commState.getByteArray("resTopicBytes");
 
                 if (resTopicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -302,7 +302,7 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 4:
-                String rsrcName0 = commState.getString(null);
+                String rsrcName0 = commState.getString("rsrcName");
 
                 if (rsrcName0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java
index 3d8e7ac..bf0a4b6 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java
@@ -131,19 +131,19 @@ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArrayList(null, byteSrc))
+                if (!commState.putByteArrayList("byteSrc", byteSrc))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putString(null, errMsg))
+                if (!commState.putString("errMsg", errMsg))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(null, success))
+                if (!commState.putBoolean("success", success))
                     return false;
 
                 commState.idx++;
@@ -160,7 +160,7 @@ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                GridByteArrayList byteSrc0 = commState.getByteArrayList(null);
+                GridByteArrayList byteSrc0 = commState.getByteArrayList("byteSrc");
 
                 if (byteSrc0 == BYTE_ARR_LIST_NOT_READ)
                     return false;
@@ -170,7 +170,7 @@ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                String errMsg0 = commState.getString(null);
+                String errMsg0 = commState.getString("errMsg");
 
                 if (errMsg0 == STR_NOT_READ)
                     return false;
@@ -183,7 +183,7 @@ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                success = commState.getBoolean(null);
+                success = commState.getBoolean("success");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java
index f80707a..4b5543c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java
@@ -294,37 +294,37 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, clsLdrId))
+                if (!commState.putGridUuid("clsLdrId", clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putEnum(null, depMode))
+                if (!commState.putEnum("depMode", depMode))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putByteArray(null, evtsBytes))
+                if (!commState.putByteArray("evtsBytes", evtsBytes))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putByteArray(null, exBytes))
+                if (!commState.putByteArray("exBytes", exBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(null, filter))
+                if (!commState.putByteArray("filter", filter))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putString(null, filterClsName))
+                if (!commState.putString("filterClsName", filterClsName))
                     return false;
 
                 commState.idx++;
@@ -368,13 +368,13 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 7:
-                if (!commState.putByteArray(null, resTopicBytes))
+                if (!commState.putByteArray("resTopicBytes", resTopicBytes))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putString(null, userVer))
+                if (!commState.putString("userVer", userVer))
                     return false;
 
                 commState.idx++;
@@ -391,7 +391,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
+                IgniteUuid clsLdrId0 = commState.getGridUuid("clsLdrId");
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -404,14 +404,14 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte(null);
+                byte depMode0 = commState.getByte("depMode");
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
                 commState.idx++;
 
             case 2:
-                byte[] evtsBytes0 = commState.getByteArray(null);
+                byte[] evtsBytes0 = commState.getByteArray("evtsBytes");
 
                 if (evtsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -421,7 +421,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 3:
-                byte[] exBytes0 = commState.getByteArray(null);
+                byte[] exBytes0 = commState.getByteArray("exBytes");
 
                 if (exBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -431,7 +431,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 4:
-                byte[] filter0 = commState.getByteArray(null);
+                byte[] filter0 = commState.getByteArray("filter");
 
                 if (filter0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -441,7 +441,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 5:
-                String filterClsName0 = commState.getString(null);
+                String filterClsName0 = commState.getString("filterClsName");
 
                 if (filterClsName0 == STR_NOT_READ)
                     return false;
@@ -460,7 +460,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
 
                 if (commState.readSize >= 0) {
                     if (ldrParties == null)
-                        ldrParties = U.newHashMap(commState.readSize);
+                        ldrParties = new HashMap<>(commState.readSize, 1.0f);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
@@ -493,7 +493,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 7:
-                byte[] resTopicBytes0 = commState.getByteArray(null);
+                byte[] resTopicBytes0 = commState.getByteArray("resTopicBytes");
 
                 if (resTopicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -503,7 +503,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 8:
-                String userVer0 = commState.getString(null);
+                String userVer0 = commState.getString("userVer");
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java
index 8a1f0b9..3c3bd83 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java
@@ -169,19 +169,19 @@ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> imple
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(null, entriesBytes))
+                if (!commState.putByteArray("entriesBytes", entriesBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(null, futId))
+                if (!commState.putLong("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
@@ -201,7 +201,7 @@ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> imple
 
         switch (commState.idx) {
             case 3:
-                byte[] entriesBytes0 = commState.getByteArray(null);
+                byte[] entriesBytes0 = commState.getByteArray("entriesBytes");
 
                 if (entriesBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -214,7 +214,7 @@ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> imple
                 if (buf.remaining() < 8)
                     return false;
 
-                futId = commState.getLong(null);
+                futId = commState.getLong("futId");
 
                 commState.idx++;
 
@@ -222,7 +222,7 @@ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> imple
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java
index 203b99d..a14604a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java
@@ -159,13 +159,13 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putBoolean(null, err))
+                if (!commState.putBoolean("err", err))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(null, futId))
+                if (!commState.putLong("futId", futId))
                     return false;
 
                 commState.idx++;
@@ -215,7 +215,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
                 if (buf.remaining() < 1)
                     return false;
 
-                err = commState.getBoolean(null);
+                err = commState.getBoolean("err");
 
                 commState.idx++;
 
@@ -223,7 +223,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
                 if (buf.remaining() < 8)
                     return false;
 
-                futId = commState.getLong(null);
+                futId = commState.getLong("futId");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java
index ea7987d..8d6986b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java
@@ -594,19 +594,19 @@ public abstract class GridCacheMessage<K, V> extends GridTcpCommunicationMessage
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putInt(null, cacheId))
+                if (!commState.putInt("cacheId", cacheId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putMessage(null, depInfo))
+                if (!commState.putMessage("depInfo", depInfo))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(null, msgId))
+                if (!commState.putLong("msgId", msgId))
                     return false;
 
                 commState.idx++;
@@ -626,12 +626,12 @@ public abstract class GridCacheMessage<K, V> extends GridTcpCommunicationMessage
                 if (buf.remaining() < 4)
                     return false;
 
-                cacheId = commState.getInt(null);
+                cacheId = commState.getInt("cacheId");
 
                 commState.idx++;
 
             case 1:
-                Object depInfo0 = commState.getMessage(null);
+                Object depInfo0 = commState.getMessage("depInfo");
 
                 if (depInfo0 == MSG_NOT_READ)
                     return false;
@@ -644,7 +644,7 @@ public abstract class GridCacheMessage<K, V> extends GridTcpCommunicationMessage
                 if (buf.remaining() < 8)
                     return false;
 
-                msgId = commState.getLong(null);
+                msgId = commState.getLong("msgId");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
index 88c087f..93f8653 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
@@ -126,25 +126,25 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putCacheVersion(null, nearXidVer))
+                if (!commState.putCacheVersion("nearXidVer", nearXidVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putInt(null, txNum))
+                if (!commState.putInt("txNum", txNum))
                     return false;
 
                 commState.idx++;
@@ -164,7 +164,7 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
 
         switch (commState.idx) {
             case 8:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -174,7 +174,7 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
                 commState.idx++;
 
             case 9:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -184,7 +184,7 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
                 commState.idx++;
 
             case 10:
-                GridCacheVersion nearXidVer0 = commState.getCacheVersion(null);
+                GridCacheVersion nearXidVer0 = commState.getCacheVersion("nearXidVer");
 
                 if (nearXidVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -197,7 +197,7 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
                 if (buf.remaining() < 4)
                     return false;
 
-                txNum = commState.getInt(null);
+                txNum = commState.getInt("txNum");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
index 1baa17a..4bfda3d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
@@ -114,19 +114,19 @@ public class GridCacheOptimisticCheckPreparedTxResponse<K, V> extends GridDistri
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putBoolean(null, success))
+                if (!commState.putBoolean("success", success))
                     return false;
 
                 commState.idx++;
@@ -146,7 +146,7 @@ public class GridCacheOptimisticCheckPreparedTxResponse<K, V> extends GridDistri
 
         switch (commState.idx) {
             case 8:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -156,7 +156,7 @@ public class GridCacheOptimisticCheckPreparedTxResponse<K, V> extends GridDistri
                 commState.idx++;
 
             case 9:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -169,7 +169,7 @@ public class GridCacheOptimisticCheckPreparedTxResponse<K, V> extends GridDistri
                 if (buf.remaining() < 1)
                     return false;
 
-                success = commState.getBoolean(null);
+                success = commState.getBoolean("success");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java
index 89b1a4b..f25317a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java
@@ -161,37 +161,37 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putCacheVersion(null, nearXidVer))
+                if (!commState.putCacheVersion("nearXidVer", nearXidVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putUuid(null, originatingNodeId))
+                if (!commState.putUuid("originatingNodeId", originatingNodeId))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putLong(null, originatingThreadId))
+                if (!commState.putLong("originatingThreadId", originatingThreadId))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putBoolean(null, nearOnlyCheck))
+                if (!commState.putBoolean("nearOnlyCheck", nearOnlyCheck))
                     return false;
 
                 commState.idx++;
@@ -211,7 +211,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
 
         switch (commState.idx) {
             case 8:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -221,7 +221,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 commState.idx++;
 
             case 9:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -231,7 +231,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 commState.idx++;
 
             case 10:
-                GridCacheVersion nearXidVer0 = commState.getCacheVersion(null);
+                GridCacheVersion nearXidVer0 = commState.getCacheVersion("nearXidVer");
 
                 if (nearXidVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -241,7 +241,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 commState.idx++;
 
             case 11:
-                UUID originatingNodeId0 = commState.getUuid(null);
+                UUID originatingNodeId0 = commState.getUuid("originatingNodeId");
 
                 if (originatingNodeId0 == UUID_NOT_READ)
                     return false;
@@ -254,7 +254,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 if (buf.remaining() < 8)
                     return false;
 
-                originatingThreadId = commState.getLong(null);
+                originatingThreadId = commState.getLong("originatingThreadId");
 
                 commState.idx++;
 
@@ -262,7 +262,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 if (buf.remaining() < 1)
                     return false;
 
-                nearOnlyCheck = commState.getBoolean(null);
+                nearOnlyCheck = commState.getBoolean("nearOnlyCheck");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java
index 88f354b..19cfbb8 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java
@@ -145,19 +145,19 @@ public class GridCachePessimisticCheckCommittedTxResponse<K, V> extends GridDist
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putByteArray(null, committedTxInfoBytes))
+                if (!commState.putByteArray("committedTxInfoBytes", committedTxInfoBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
@@ -177,7 +177,7 @@ public class GridCachePessimisticCheckCommittedTxResponse<K, V> extends GridDist
 
         switch (commState.idx) {
             case 8:
-                byte[] committedTxInfoBytes0 = commState.getByteArray(null);
+                byte[] committedTxInfoBytes0 = commState.getByteArray("committedTxInfoBytes");
 
                 if (committedTxInfoBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -187,7 +187,7 @@ public class GridCachePessimisticCheckCommittedTxResponse<K, V> extends GridDist
                 commState.idx++;
 
             case 9:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -197,7 +197,7 @@ public class GridCachePessimisticCheckCommittedTxResponse<K, V> extends GridDist
                 commState.idx++;
 
             case 10:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java
index 3a0a86f..3709cd9 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java
@@ -263,13 +263,13 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(null, candsByIdxBytes))
+                if (!commState.putByteArray("candsByIdxBytes", candsByIdxBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(null, candsByKeyBytes))
+                if (!commState.putByteArray("candsByKeyBytes", candsByKeyBytes))
                     return false;
 
                 commState.idx++;
@@ -329,7 +329,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                 commState.idx++;
 
             case 7:
-                if (!commState.putCacheVersion(null, ver))
+                if (!commState.putCacheVersion("ver", ver))
                     return false;
 
                 commState.idx++;
@@ -349,7 +349,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
 
         switch (commState.idx) {
             case 3:
-                byte[] candsByIdxBytes0 = commState.getByteArray(null);
+                byte[] candsByIdxBytes0 = commState.getByteArray("candsByIdxBytes");
 
                 if (candsByIdxBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -359,7 +359,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                 commState.idx++;
 
             case 4:
-                byte[] candsByKeyBytes0 = commState.getByteArray(null);
+                byte[] candsByKeyBytes0 = commState.getByteArray("candsByKeyBytes");
 
                 if (candsByKeyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -427,7 +427,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                 commState.idx++;
 
             case 7:
-                GridCacheVersion ver0 = commState.getCacheVersion(null);
+                GridCacheVersion ver0 = commState.getCacheVersion("ver");
 
                 if (ver0 == CACHE_VER_NOT_READ)
                     return false;


[02/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java
index 77d188b..46975bb 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java
@@ -281,7 +281,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -289,31 +289,31 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(affKey))
+                if (!commState.putGridUuid(null, affKey))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(done))
+                if (!commState.putBoolean(null, done))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(endOff))
+                if (!commState.putLong(null, endOff))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putLong(startOff))
+                if (!commState.putLong(null, startOff))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putInt(status))
+                if (!commState.putInt(null, status))
                     return false;
 
                 commState.idx++;
@@ -330,7 +330,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid affKey0 = commState.getGridUuid();
+                IgniteUuid affKey0 = commState.getGridUuid(null);
 
                 if (affKey0 == GRID_UUID_NOT_READ)
                     return false;
@@ -343,7 +343,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 1)
                     return false;
 
-                done = commState.getBoolean();
+                done = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -351,7 +351,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 8)
                     return false;
 
-                endOff = commState.getLong();
+                endOff = commState.getLong(null);
 
                 commState.idx++;
 
@@ -359,7 +359,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 8)
                     return false;
 
-                startOff = commState.getLong();
+                startOff = commState.getLong(null);
 
                 commState.idx++;
 
@@ -367,7 +367,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 4)
                     return false;
 
-                status = commState.getInt();
+                status = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java
index d6329cc..80b4621 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java
@@ -99,7 +99,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -107,7 +107,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(fileId))
+                if (!commState.putGridUuid(null, fileId))
                     return false;
 
                 commState.idx++;
@@ -115,7 +115,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
             case 1:
                 if (fragmentRanges != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(fragmentRanges.size()))
+                        if (!commState.putInt(null, fragmentRanges.size()))
                             return false;
 
                         commState.it = fragmentRanges.iterator();
@@ -125,7 +125,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putMessage((GridGgfsFileAffinityRange)commState.cur))
+                        if (!commState.putMessage(null, (GridGgfsFileAffinityRange)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -133,7 +133,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -154,7 +154,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid fileId0 = commState.getGridUuid();
+                IgniteUuid fileId0 = commState.getGridUuid(null);
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -168,7 +168,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -176,7 +176,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
                         fragmentRanges = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        Object _val = commState.getMessage();
+                        Object _val = commState.getMessage(null);
 
                         if (_val == MSG_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java
index 18024b3..9d71c9c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java
@@ -74,7 +74,7 @@ public class GridGgfsFragmentizerResponse extends GridGgfsCommunicationMessage {
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -82,7 +82,7 @@ public class GridGgfsFragmentizerResponse extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(fileId))
+                if (!commState.putGridUuid(null, fileId))
                     return false;
 
                 commState.idx++;
@@ -102,7 +102,7 @@ public class GridGgfsFragmentizerResponse extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid fileId0 = commState.getGridUuid();
+                IgniteUuid fileId0 = commState.getGridUuid(null);
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java
index f1ab657..06fbcef 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java
@@ -92,7 +92,7 @@ public class GridGgfsSyncMessage extends GridGgfsCommunicationMessage {
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -100,13 +100,13 @@ public class GridGgfsSyncMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putLong(order))
+                if (!commState.putLong(null, order))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(res))
+                if (!commState.putBoolean(null, res))
                     return false;
 
                 commState.idx++;
@@ -129,7 +129,7 @@ public class GridGgfsSyncMessage extends GridGgfsCommunicationMessage {
                 if (buf.remaining() < 8)
                     return false;
 
-                order = commState.getLong();
+                order = commState.getLong(null);
 
                 commState.idx++;
 
@@ -137,7 +137,7 @@ public class GridGgfsSyncMessage extends GridGgfsCommunicationMessage {
                 if (buf.remaining() < 1)
                     return false;
 
-                res = commState.getBoolean();
+                res = commState.getBoolean(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/portable/GridPortableOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/portable/GridPortableOutputStream.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/portable/GridPortableOutputStream.java
index c72ddd7..a71be26 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/portable/GridPortableOutputStream.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/portable/GridPortableOutputStream.java
@@ -151,13 +151,6 @@ public interface GridPortableOutputStream extends GridPortableStream, AutoClosea
     public void write(long addr, int cnt);
 
     /**
-     * Ensure capacity.
-     *
-     * @param cnt Required byte count.
-     */
-    public void ensureCapacity(int cnt);
-
-    /**
      * Close the stream releasing resources.
      */
     @Override public void close();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java
index 7adca40..601428c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java
@@ -54,7 +54,7 @@ public class GridClientHandshakeRequestWrapper extends GridTcpCommunicationMessa
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -62,7 +62,7 @@ public class GridClientHandshakeRequestWrapper extends GridTcpCommunicationMessa
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArrayClient(bytes))
+                if (!commState.putByteArray(null, bytes))
                     return false;
 
                 commState.idx++;
@@ -78,12 +78,12 @@ public class GridClientHandshakeRequestWrapper extends GridTcpCommunicationMessa
 
         switch (commState.idx) {
             case 0:
-                byte[] bytes0 = commState.getByteArrayClient(GridClientHandshakeRequest.PACKET_SIZE);
-
-                if (bytes0 == BYTE_ARR_NOT_READ)
-                    return false;
-
-                bytes = bytes0;
+//                byte[] bytes0 = commState.getByteArray(null, GridClientHandshakeRequest.PACKET_SIZE);
+//
+//                if (bytes0 == BYTE_ARR_NOT_READ)
+//                    return false;
+//
+//                bytes = bytes0;
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java
index bc5b7af..c77964b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java
@@ -43,7 +43,7 @@ public class GridClientHandshakeResponseWrapper extends GridTcpCommunicationMess
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java
index 99e1306..4779afb 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java
@@ -125,7 +125,7 @@ public class GridClientMessageWrapper extends GridTcpCommunicationMessageAdapter
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -133,32 +133,32 @@ public class GridClientMessageWrapper extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putIntClient(msgSize))
+                if (!commState.putInt(null, msgSize))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putLongClient(reqId))
+                if (!commState.putLong(null, reqId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putUuidClient(clientId))
+                if (!commState.putUuid(null, clientId))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putUuidClient(destId))
+                if (!commState.putUuid(null, destId))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteBufferClient(msg))
-                    return false;
+//                if (!commState.putByteBuffer(null, msg))
+//                    return false;
 
                 commState.idx++;
 
@@ -176,7 +176,7 @@ public class GridClientMessageWrapper extends GridTcpCommunicationMessageAdapter
                 if (buf.remaining() < 4)
                     return false;
 
-                msgSize = commState.getIntClient();
+                msgSize = commState.getInt(null);
 
                 if (msgSize == 0) // Ping message.
                     return true;
@@ -187,12 +187,12 @@ public class GridClientMessageWrapper extends GridTcpCommunicationMessageAdapter
                 if (buf.remaining() < 8)
                     return false;
 
-                reqId = commState.getLongClient();
+                reqId = commState.getLong(null);
 
                 commState.idx++;
 
             case 2:
-                UUID clientId0 = commState.getUuidClient();
+                UUID clientId0 = commState.getUuid(null);
 
                 if (clientId0 == UUID_NOT_READ)
                     return false;
@@ -202,7 +202,7 @@ public class GridClientMessageWrapper extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 3:
-                UUID destId0 = commState.getUuidClient();
+                UUID destId0 = commState.getUuid(null);
 
                 if (destId0 == UUID_NOT_READ)
                     return false;
@@ -212,14 +212,14 @@ public class GridClientMessageWrapper extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 4:
-                byte[] msg0 = commState.getByteArrayClient(msgSize - 40);
-
-                if (msg0 == BYTE_ARR_NOT_READ)
-                    return false;
-
-                msg = ByteBuffer.wrap(msg0);
-
-                commState.idx++;
+//                byte[] msg0 = commState.getByteArray(null, msgSize - 40);
+//
+//                if (msg0 == BYTE_ARR_NOT_READ)
+//                    return false;
+//
+//                msg = ByteBuffer.wrap(msg0);
+//
+//                commState.idx++;
         }
 
         return true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java
index 517b804..b719531 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java
@@ -29,7 +29,7 @@ public class GridClientPingPacketWrapper extends GridTcpCommunicationMessageAdap
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -37,7 +37,7 @@ public class GridClientPingPacketWrapper extends GridTcpCommunicationMessageAdap
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putIntClient(size))
+                if (!commState.putInt(null, size))
                     return false;
 
                 commState.idx++;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java
index 0485f3f..2b66ef6 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java
@@ -115,7 +115,7 @@ public class GridTaskResultRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -123,13 +123,13 @@ public class GridTaskResultRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(taskId))
+                if (!commState.putGridUuid(null, taskId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putByteArray(topicBytes))
+                if (!commState.putByteArray(null, topicBytes))
                     return false;
 
                 commState.idx++;
@@ -146,7 +146,7 @@ public class GridTaskResultRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid taskId0 = commState.getGridUuid();
+                IgniteUuid taskId0 = commState.getGridUuid(null);
 
                 if (taskId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -156,7 +156,7 @@ public class GridTaskResultRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                byte[] topicBytes0 = commState.getByteArray();
+                byte[] topicBytes0 = commState.getByteArray(null);
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java
index 91cb28f..ad9e42f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java
@@ -135,7 +135,7 @@ public class GridTaskResultResponse extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -143,25 +143,25 @@ public class GridTaskResultResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putString(err))
+                if (!commState.putString(null, err))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(finished))
+                if (!commState.putBoolean(null, finished))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(found))
+                if (!commState.putBoolean(null, found))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putByteArray(resBytes))
+                if (!commState.putByteArray(null, resBytes))
                     return false;
 
                 commState.idx++;
@@ -178,7 +178,7 @@ public class GridTaskResultResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                String err0 = commState.getString();
+                String err0 = commState.getString(null);
 
                 if (err0 == STR_NOT_READ)
                     return false;
@@ -191,7 +191,7 @@ public class GridTaskResultResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                finished = commState.getBoolean();
+                finished = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -199,12 +199,12 @@ public class GridTaskResultResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                found = commState.getBoolean();
+                found = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 3:
-                byte[] resBytes0 = commState.getByteArray();
+                byte[] resBytes0 = commState.getByteArray(null);
 
                 if (resBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java
index 40c0331..077aa93 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java
@@ -58,7 +58,7 @@ public class GridMemcachedMessageWrapper extends GridTcpCommunicationMessageAdap
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -66,7 +66,7 @@ public class GridMemcachedMessageWrapper extends GridTcpCommunicationMessageAdap
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArrayClient(bytes))
+                if (!commState.putByteArray(null, bytes))
                     return false;
 
                 commState.idx++;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestDirectParser.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestDirectParser.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestDirectParser.java
index d42c762..99dcd44 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestDirectParser.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestDirectParser.java
@@ -38,20 +38,16 @@ public class GridTcpRestDirectParser implements GridNioParser {
     /** Protocol handler. */
     private final GridTcpRestProtocol proto;
 
-    /** Message reader. */
-    private final GridNioMessageReader msgReader;
-
     /**
      * @param proto Protocol handler.
-     * @param msgReader Message reader.
      */
-    public GridTcpRestDirectParser(GridTcpRestProtocol proto, GridNioMessageReader msgReader) {
+    public GridTcpRestDirectParser(GridTcpRestProtocol proto) {
         this.proto = proto;
-        this.msgReader = msgReader;
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public Object decode(GridNioSession ses, ByteBuffer buf) throws IOException, IgniteCheckedException {
+    @Nullable @Override public Object decode(GridNioSession ses, ByteBuffer buf)
+        throws IOException, IgniteCheckedException {
         ParserState state = ses.removeMeta(PARSER_STATE.ordinal());
 
         if (state != null) {
@@ -100,7 +96,7 @@ public class GridTcpRestDirectParser implements GridNioParser {
         boolean finished = false;
 
         if (buf.hasRemaining())
-            finished = msgReader.read(null, msg, buf);
+            finished = msg.readFrom(buf);
 
         if (finished) {
             if (msg instanceof GridClientMessageWrapper) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestProtocol.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
index 24e259f..1974347 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
@@ -22,7 +22,6 @@ import org.gridgain.grid.kernal.*;
 import org.gridgain.grid.kernal.processors.rest.*;
 import org.gridgain.grid.kernal.processors.rest.client.message.*;
 import org.gridgain.grid.kernal.processors.rest.protocols.*;
-import org.gridgain.grid.util.direct.*;
 import org.gridgain.grid.util.nio.*;
 import org.gridgain.grid.util.nio.ssl.*;
 import org.gridgain.grid.util.typedef.internal.*;
@@ -49,59 +48,6 @@ public class GridTcpRestProtocol extends GridRestProtocolAdapter {
     /** NIO server listener. */
     private GridTcpRestNioListener lsnr;
 
-    /** Message reader. */
-    private final GridNioMessageReader msgReader = new GridNioMessageReader() {
-        @Override public boolean read(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, ByteBuffer buf) {
-            assert msg != null;
-            assert buf != null;
-
-            msg.messageReader(this, nodeId);
-
-            return msg.readFrom(buf);
-        }
-
-        @Nullable @Override public GridTcpMessageFactory messageFactory() {
-            return null;
-        }
-    };
-
-    /** Message writer. */
-    private final GridNioMessageWriter msgWriter = new GridNioMessageWriter() {
-        @Override public boolean write(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, ByteBuffer buf) {
-            assert msg != null;
-            assert buf != null;
-
-            msg.messageWriter(this, nodeId);
-
-            return msg.writeTo(buf);
-        }
-
-        @Override public int writeFully(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, OutputStream out,
-            ByteBuffer buf) throws IOException {
-            assert msg != null;
-            assert out != null;
-            assert buf != null;
-            assert buf.hasArray();
-
-            msg.messageWriter(this, nodeId);
-
-            boolean finished = false;
-            int cnt = 0;
-
-            while (!finished) {
-                finished = msg.writeTo(buf);
-
-                out.write(buf.array(), 0, buf.position());
-
-                cnt += buf.position();
-
-                buf.clear();
-            }
-
-            return cnt;
-        }
-    };
-
     /** @param ctx Context. */
     public GridTcpRestProtocol(GridKernalContext ctx) {
         super(ctx);
@@ -152,7 +98,7 @@ public class GridTcpRestProtocol extends GridRestProtocolAdapter {
 
         lsnr = new GridTcpRestNioListener(log, this, hnd, ctx);
 
-        GridNioParser parser = new GridTcpRestDirectParser(this, msgReader);
+        GridNioParser parser = new GridTcpRestDirectParser(this);
 
         try {
             host = resolveRestTcpHost(ctx.config());
@@ -291,7 +237,6 @@ public class GridTcpRestProtocol extends GridRestProtocolAdapter {
                 .sendQueueLimit(cfg.getRestTcpSendQueueLimit())
                 .filters(filters)
                 .directMode(true)
-                .messageWriter(msgWriter)
                 .build();
 
             srv.idleTimeout(cfg.getRestIdleTimeout());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java
index be602db..cc56dc8 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java
@@ -69,7 +69,7 @@ public class GridStreamerCancelRequest extends GridTcpCommunicationMessageAdapte
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -77,7 +77,7 @@ public class GridStreamerCancelRequest extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(cancelledFutId))
+                if (!commState.putGridUuid(null, cancelledFutId))
                     return false;
 
                 commState.idx++;
@@ -94,7 +94,7 @@ public class GridStreamerCancelRequest extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid cancelledFutId0 = commState.getGridUuid();
+                IgniteUuid cancelledFutId0 = commState.getGridUuid(null);
 
                 if (cancelledFutId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java
index 40e8d5a..39c8cf2 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java
@@ -170,7 +170,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -178,25 +178,25 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(batchBytes))
+                if (!commState.putByteArray(null, batchBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(clsLdrId))
+                if (!commState.putGridUuid(null, clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putEnum(depMode))
+                if (!commState.putEnum(null, depMode))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putBoolean(forceLocDep))
+                if (!commState.putBoolean(null, forceLocDep))
                     return false;
 
                 commState.idx++;
@@ -204,7 +204,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
             case 4:
                 if (ldrParticipants != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(ldrParticipants.size()))
+                        if (!commState.putInt(null, ldrParticipants.size()))
                             return false;
 
                         commState.it = ldrParticipants.entrySet().iterator();
@@ -217,13 +217,13 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                         Map.Entry<UUID, IgniteUuid> e = (Map.Entry<UUID, IgniteUuid>)commState.cur;
 
                         if (!commState.keyDone) {
-                            if (!commState.putUuid(e.getKey()))
+                            if (!commState.putUuid(null, e.getKey()))
                                 return false;
 
                             commState.keyDone = true;
                         }
 
-                        if (!commState.putGridUuid(e.getValue()))
+                        if (!commState.putGridUuid(null, e.getValue()))
                             return false;
 
                         commState.keyDone = false;
@@ -233,20 +233,20 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putString(sampleClsName))
+                if (!commState.putString(null, sampleClsName))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putString(userVer))
+                if (!commState.putString(null, userVer))
                     return false;
 
                 commState.idx++;
@@ -263,7 +263,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
 
         switch (commState.idx) {
             case 0:
-                byte[] batchBytes0 = commState.getByteArray();
+                byte[] batchBytes0 = commState.getByteArray(null);
 
                 if (batchBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -273,7 +273,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 commState.idx++;
 
             case 1:
-                IgniteUuid clsLdrId0 = commState.getGridUuid();
+                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -286,7 +286,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte();
+                byte depMode0 = commState.getByte(null);
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -296,7 +296,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 if (buf.remaining() < 1)
                     return false;
 
-                forceLocDep = commState.getBoolean();
+                forceLocDep = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -305,7 +305,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -314,7 +314,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
-                            UUID _val = commState.getUuid();
+                            UUID _val = commState.getUuid(null);
 
                             if (_val == UUID_NOT_READ)
                                 return false;
@@ -323,7 +323,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                             commState.keyDone = true;
                         }
 
-                        IgniteUuid _val = commState.getGridUuid();
+                        IgniteUuid _val = commState.getGridUuid(null);
 
                         if (_val == GRID_UUID_NOT_READ)
                             return false;
@@ -343,7 +343,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 commState.idx++;
 
             case 5:
-                String sampleClsName0 = commState.getString();
+                String sampleClsName0 = commState.getString(null);
 
                 if (sampleClsName0 == STR_NOT_READ)
                     return false;
@@ -353,7 +353,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 commState.idx++;
 
             case 6:
-                String userVer0 = commState.getString();
+                String userVer0 = commState.getString(null);
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java
index 2933e45..fc3cfcb 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java
@@ -90,7 +90,7 @@ public class GridStreamerResponse extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -98,13 +98,13 @@ public class GridStreamerResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
@@ -121,7 +121,7 @@ public class GridStreamerResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -131,7 +131,7 @@ public class GridStreamerResponse extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/GridLongList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/GridLongList.java b/modules/core/src/main/java/org/gridgain/grid/util/GridLongList.java
index f740ad9..857f80a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/GridLongList.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/GridLongList.java
@@ -369,10 +369,14 @@ public class GridLongList implements Externalizable {
     }
 
     /**
-     * @return Internal array.
+     * @return Array copy.
      */
-    public long[] internalArray() {
-        return arr;
+    public long[] array() {
+        long[] res = new long[idx];
+
+        System.arraycopy(arr, 0, res, 0, idx);
+
+        return res;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/GridUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/GridUtils.java b/modules/core/src/main/java/org/gridgain/grid/util/GridUtils.java
index 803badd..3e9f61c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/GridUtils.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/GridUtils.java
@@ -27,6 +27,7 @@ import org.gridgain.grid.kernal.managers.deployment.*;
 import org.gridgain.grid.kernal.processors.cache.*;
 import org.gridgain.grid.kernal.processors.streamer.*;
 import org.apache.ignite.spi.discovery.*;
+import org.gridgain.grid.util.direct.*;
 import org.gridgain.grid.util.io.*;
 import org.gridgain.grid.util.lang.*;
 import org.gridgain.grid.util.typedef.*;
@@ -9027,4 +9028,37 @@ public abstract class GridUtils {
 
         return list;
     }
+
+    /**
+     * Fully writes communication message to provided stream.
+     *
+     * @param msg Message.
+     * @param out Stream to write to.
+     * @param buf Byte buffer that will be passed to {@link GridTcpCommunicationMessageAdapter#writeTo(ByteBuffer)}
+     *            method.
+     * @return Number of written bytes.
+     * @throws IOException In case of error.
+     */
+    public static int writeMessageFully(GridTcpCommunicationMessageAdapter msg, OutputStream out, ByteBuffer buf)
+        throws IOException {
+        assert msg != null;
+        assert out != null;
+        assert buf != null;
+        assert buf.hasArray();
+
+        boolean finished = false;
+        int cnt = 0;
+
+        while (!finished) {
+            finished = msg.writeTo(buf);
+
+            out.write(buf.array(), 0, buf.position());
+
+            cnt += buf.position();
+
+            buf.clear();
+        }
+
+        return cnt;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridPortableByteBufferStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridPortableByteBufferStream.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridPortableByteBufferStream.java
new file mode 100644
index 0000000..4433cbf
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridPortableByteBufferStream.java
@@ -0,0 +1,726 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.gridgain.grid.util.direct;
+
+import org.gridgain.grid.kernal.processors.portable.*;
+import org.gridgain.grid.util.*;
+import sun.misc.*;
+import sun.nio.ch.*;
+
+import java.nio.*;
+
+import static org.gridgain.grid.util.direct.GridTcpCommunicationMessageAdapter.*;
+
+/**
+ * Portable stream based on {@link ByteBuffer}.
+ */
+public class GridPortableByteBufferStream implements GridPortableOutputStream, GridPortableInputStream {
+    /** */
+    private static final Unsafe UNSAFE = GridUnsafe.unsafe();
+
+    /** */
+    private static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
+
+    /** */
+    private static final long SHORT_ARR_OFF = UNSAFE.arrayBaseOffset(short[].class);
+
+    /** */
+    private static final long INT_ARR_OFF = UNSAFE.arrayBaseOffset(int[].class);
+
+    /** */
+    private static final long LONG_ARR_OFF = UNSAFE.arrayBaseOffset(long[].class);
+
+    /** */
+    private static final long FLOAT_ARR_OFF = UNSAFE.arrayBaseOffset(float[].class);
+
+    /** */
+    private static final long DOUBLE_ARR_OFF = UNSAFE.arrayBaseOffset(double[].class);
+
+    /** */
+    private static final long CHAR_ARR_OFF = UNSAFE.arrayBaseOffset(char[].class);
+
+    /** */
+    private static final long BOOLEAN_ARR_OFF = UNSAFE.arrayBaseOffset(boolean[].class);
+
+    /** */
+    private static final byte[] BYTE_ARR_EMPTY = new byte[0];
+
+    /** */
+    private static final short[] SHORT_ARR_EMPTY = new short[0];
+
+    /** */
+    private static final int[] INT_ARR_EMPTY = new int[0];
+
+    /** */
+    private static final long[] LONG_ARR_EMPTY = new long[0];
+
+    /** */
+    private static final float[] FLOAT_ARR_EMPTY = new float[0];
+
+    /** */
+    private static final double[] DOUBLE_ARR_EMPTY = new double[0];
+
+    /** */
+    private static final char[] CHAR_ARR_EMPTY = new char[0];
+
+    /** */
+    private static final boolean[] BOOLEAN_ARR_EMPTY = new boolean[0];
+
+    /** */
+    private static final ArrayCreator<byte[]> BYTE_ARR_CREATOR = new ArrayCreator<byte[]>() {
+        @Override public byte[] create(int len) {
+            switch (len) {
+                case -1:
+                    return BYTE_ARR_NOT_READ;
+
+                case 0:
+                    return BYTE_ARR_EMPTY;
+
+                default:
+                    return new byte[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<short[]> SHORT_ARR_CREATOR = new ArrayCreator<short[]>() {
+        @Override public short[] create(int len) {
+            switch (len) {
+                case -1:
+                    return SHORT_ARR_NOT_READ;
+
+                case 0:
+                    return SHORT_ARR_EMPTY;
+
+                default:
+                    return new short[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<int[]> INT_ARR_CREATOR = new ArrayCreator<int[]>() {
+        @Override public int[] create(int len) {
+            switch (len) {
+                case -1:
+                    return INT_ARR_NOT_READ;
+
+                case 0:
+                    return INT_ARR_EMPTY;
+
+                default:
+                    return new int[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<long[]> LONG_ARR_CREATOR = new ArrayCreator<long[]>() {
+        @Override public long[] create(int len) {
+            switch (len) {
+                case -1:
+                    return LONG_ARR_NOT_READ;
+
+                case 0:
+                    return LONG_ARR_EMPTY;
+
+                default:
+                    return new long[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<float[]> FLOAT_ARR_CREATOR = new ArrayCreator<float[]>() {
+        @Override public float[] create(int len) {
+            switch (len) {
+                case -1:
+                    return FLOAT_ARR_NOT_READ;
+
+                case 0:
+                    return FLOAT_ARR_EMPTY;
+
+                default:
+                    return new float[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<double[]> DOUBLE_ARR_CREATOR = new ArrayCreator<double[]>() {
+        @Override public double[] create(int len) {
+            switch (len) {
+                case -1:
+                    return DOUBLE_ARR_NOT_READ;
+
+                case 0:
+                    return DOUBLE_ARR_EMPTY;
+
+                default:
+                    return new double[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<char[]> CHAR_ARR_CREATOR = new ArrayCreator<char[]>() {
+        @Override public char[] create(int len) {
+            switch (len) {
+                case -1:
+                    return CHAR_ARR_NOT_READ;
+
+                case 0:
+                    return CHAR_ARR_EMPTY;
+
+                default:
+                    return new char[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<boolean[]> BOOLEAN_ARR_CREATOR = new ArrayCreator<boolean[]>() {
+        @Override public boolean[] create(int len) {
+            switch (len) {
+                case -1:
+                    return BOOLEAN_ARR_NOT_READ;
+
+                case 0:
+                    return BOOLEAN_ARR_EMPTY;
+
+                default:
+                    return new boolean[len];
+            }
+        }
+    };
+
+    /** */
+    private ByteBuffer buf;
+
+    /** */
+    private byte[] heapArr;
+
+    /** */
+    private long baseOff;
+
+    /** */
+    private int arrOff;
+
+    /** */
+    private Object tmpArr;
+
+    /** */
+    private int tmpArrOff;
+
+    /** */
+    private int tmpArrBytes;
+
+    /** */
+    private boolean msgTypeDone;
+
+    /** */
+    private GridTcpCommunicationMessageAdapter msg;
+
+    /** */
+    private boolean lastWritten;
+
+    /**
+     * @param buf Buffer.
+     */
+    public final void setBuffer(ByteBuffer buf) {
+        assert buf != null;
+
+        if (this.buf != buf) {
+            this.buf = buf;
+
+            heapArr = buf.isDirect() ? null : buf.array();
+            baseOff = buf.isDirect() ? ((DirectBuffer)buf).address() : BYTE_ARR_OFF;
+        }
+    }
+
+    /**
+     * @return Whether last object was fully written.
+     */
+    public boolean lastWritten() {
+        boolean lastWritten0 = lastWritten;
+
+        lastWritten = false;
+
+        return lastWritten0;
+    }
+
+    /**
+     * @param msg Message.
+     */
+    public void writeMessage(GridTcpCommunicationMessageAdapter msg) {
+        assert msg != null;
+
+        lastWritten = msg.writeTo(buf);
+    }
+
+    /**
+     * @return Message.
+     */
+    public GridTcpCommunicationMessageAdapter readMessage() {
+        if (!msgTypeDone) {
+            if (!buf.hasRemaining())
+                return MSG_NOT_READ;
+
+            byte type = readByte();
+
+            msg = GridTcpCommunicationMessageFactory.create(type);
+
+            msgTypeDone = true;
+        }
+
+        if (msg.readFrom(buf)) {
+            GridTcpCommunicationMessageAdapter msg0 = msg;
+
+            msgTypeDone = false;
+            msg = null;
+
+            return msg0;
+        }
+        else
+            return MSG_NOT_READ;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeByte(byte val) {
+        int pos = buf.position();
+
+        UNSAFE.putByte(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 1);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeByteArray(byte[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, BYTE_ARR_OFF, val.length);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBoolean(boolean val) {
+        int pos = buf.position();
+
+        UNSAFE.putBoolean(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 1);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBooleanArray(boolean[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, BOOLEAN_ARR_OFF, val.length);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeShort(short val) {
+        int pos = buf.position();
+
+        UNSAFE.putShort(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeShortArray(short[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, SHORT_ARR_OFF, val.length << 1);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeChar(char val) {
+        int pos = buf.position();
+
+        UNSAFE.putChar(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeCharArray(char[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, CHAR_ARR_OFF, val.length << 1);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeInt(int val) {
+        int pos = buf.position();
+
+        UNSAFE.putInt(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 4);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeInt(int pos, int val) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeIntArray(int[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, INT_ARR_OFF, val.length << 2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeFloat(float val) {
+        int pos = buf.position();
+
+        UNSAFE.putFloat(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 4);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeFloatArray(float[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, FLOAT_ARR_OFF, val.length << 2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeLong(long val) {
+        int pos = buf.position();
+
+        UNSAFE.putLong(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 8);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeLongArray(long[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, LONG_ARR_OFF, val.length << 3);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDouble(double val) {
+        int pos = buf.position();
+
+        UNSAFE.putDouble(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 8);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDoubleArray(double[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, DOUBLE_ARR_OFF, val.length << 3);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void write(byte[] arr, int off, int len) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void write(long addr, int cnt) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte readByte() {
+        assert buf.hasRemaining();
+
+        int pos = buf.position();
+
+        buf.position(pos + 1);
+
+        return UNSAFE.getByte(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] readByteArray(int cnt) {
+        return readArray(BYTE_ARR_CREATOR, cnt, 0, BYTE_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean readBoolean() {
+        assert buf.hasRemaining();
+
+        int pos = buf.position();
+
+        buf.position(pos + 1);
+
+        return UNSAFE.getBoolean(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean[] readBooleanArray(int cnt) {
+        return readArray(BOOLEAN_ARR_CREATOR, cnt, 0, BOOLEAN_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public short readShort() {
+        assert buf.remaining() >= 2;
+
+        int pos = buf.position();
+
+        buf.position(pos + 2);
+
+        return UNSAFE.getShort(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public short[] readShortArray(int cnt) {
+        return readArray(SHORT_ARR_CREATOR, cnt, 1, SHORT_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public char readChar() {
+        assert buf.remaining() >= 2;
+
+        int pos = buf.position();
+
+        buf.position(pos + 2);
+
+        return UNSAFE.getChar(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public char[] readCharArray(int cnt) {
+        return readArray(CHAR_ARR_CREATOR, cnt, 1, CHAR_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int readInt() {
+        assert buf.remaining() >= 4;
+
+        int pos = buf.position();
+
+        buf.position(pos + 4);
+
+        return UNSAFE.getInt(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int readInt(int pos) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int[] readIntArray(int cnt) {
+        return readArray(INT_ARR_CREATOR, cnt, 2, INT_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public float readFloat() {
+        assert buf.remaining() >= 4;
+
+        int pos = buf.position();
+
+        buf.position(pos + 4);
+
+        return UNSAFE.getFloat(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public float[] readFloatArray(int cnt) {
+        return readArray(FLOAT_ARR_CREATOR, cnt, 2, FLOAT_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public long readLong() {
+        assert buf.remaining() >= 8;
+
+        int pos = buf.position();
+
+        buf.position(pos + 8);
+
+        return UNSAFE.getLong(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public long[] readLongArray(int cnt) {
+        return readArray(LONG_ARR_CREATOR, cnt, 3, LONG_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public double readDouble() {
+        assert buf.remaining() >= 8;
+
+        int pos = buf.position();
+
+        buf.position(pos + 8);
+
+        return UNSAFE.getDouble(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public double[] readDoubleArray(int cnt) {
+        return readArray(DOUBLE_ARR_CREATOR, cnt, 3, DOUBLE_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int read(byte[] arr, int off, int len) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int read(long addr, int len) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int position() {
+        return buf.position();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void position(int pos) {
+        buf.position(pos);
+    }
+
+    /** {@inheritDoc} */
+    public int remaining() {
+        return buf.remaining();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void close() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] array() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] arrayCopy() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long offheapPointer() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasArray() {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param bytes Length in bytes.
+     * @return Whether array was fully written
+     */
+    private boolean writeArray(Object arr, long off, int bytes) {
+        assert arr != null;
+        assert arr.getClass().isArray() && arr.getClass().getComponentType().isPrimitive();
+        assert off > 0;
+        assert bytes >= 0;
+        assert bytes >= arrOff;
+
+        if (!buf.hasRemaining())
+            return false;
+
+        int toWrite = bytes - arrOff;
+        int pos = buf.position();
+        int remaining = buf.remaining();
+
+        if (toWrite <= remaining) {
+            UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, toWrite);
+
+            pos += toWrite;
+
+            buf.position(pos);
+
+            arrOff = 0;
+
+            return true;
+        }
+        else {
+            UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, remaining);
+
+            pos += remaining;
+
+            buf.position(pos);
+
+            arrOff += remaining;
+
+            return false;
+        }
+    }
+
+    /**
+     * @param creator Array creator.
+     * @param len Array Array length.
+     * @param lenShift Array length shift size.
+     * @param off Base offset.
+     * @return Array or special value if it was not fully read.
+     */
+    private <T> T readArray(ArrayCreator<T> creator, int len, int lenShift, long off) {
+        assert creator != null;
+
+        if (tmpArr == null) {
+            assert len >= 0;
+
+            switch (len) {
+                case 0:
+                    return creator.create(0);
+
+                default:
+                    tmpArr = creator.create(len);
+                    tmpArrBytes = len << lenShift;
+            }
+        }
+
+        int toRead = tmpArrBytes - tmpArrOff;
+        int remaining = buf.remaining();
+        int pos = buf.position();
+
+        if (remaining < toRead) {
+            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, remaining);
+
+            buf.position(pos + remaining);
+
+            tmpArrOff += remaining;
+
+            return creator.create(-1);
+        }
+        else {
+            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, toRead);
+
+            buf.position(pos + toRead);
+
+            T arr = (T)tmpArr;
+
+            tmpArr = null;
+            tmpArrBytes = 0;
+            tmpArrOff = 0;
+
+            return arr;
+        }
+    }
+
+    /**
+     * Array creator.
+     */
+    private static interface ArrayCreator<T> {
+        /**
+         * @param len Array length or {@code -1} if array was not fully read.
+         * @return New array.
+         */
+        public T create(int len);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
index af63a2f..8961688 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
@@ -14,8 +14,6 @@ import org.gridgain.grid.kernal.processors.cache.*;
 import org.gridgain.grid.kernal.processors.cache.distributed.dht.preloader.*;
 import org.gridgain.grid.kernal.processors.clock.*;
 import org.gridgain.grid.util.*;
-import org.gridgain.grid.util.nio.*;
-import org.jetbrains.annotations.*;
 
 import java.io.*;
 import java.nio.*;
@@ -120,26 +118,6 @@ public abstract class GridTcpCommunicationMessageAdapter implements Serializable
     protected final GridTcpCommunicationMessageState commState = new GridTcpCommunicationMessageState();
 
     /**
-     * @param msgWriter Message writer.
-     * @param nodeId Node ID (provided only if versions are different).
-     */
-    public void messageWriter(GridNioMessageWriter msgWriter, @Nullable UUID nodeId) {
-        assert msgWriter != null;
-
-        commState.messageWriter(msgWriter, nodeId);
-    }
-
-    /**
-     * @param msgReader Message reader.
-     * @param nodeId Node ID (provided only if versions are different).
-     */
-    public void messageReader(GridNioMessageReader msgReader, @Nullable UUID nodeId) {
-        assert msgReader != null;
-
-        commState.messageReader(msgReader, nodeId);
-    }
-
-    /**
      * @param buf Byte buffer.
      * @return Whether message was fully written.
      */


[06/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java
index ae0436a..f80707a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/eventstorage/GridEventStorageMessage.java
@@ -286,7 +286,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -294,37 +294,37 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(clsLdrId))
+                if (!commState.putGridUuid(null, clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putEnum(depMode))
+                if (!commState.putEnum(null, depMode))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putByteArray(evtsBytes))
+                if (!commState.putByteArray(null, evtsBytes))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putByteArray(exBytes))
+                if (!commState.putByteArray(null, exBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(filter))
+                if (!commState.putByteArray(null, filter))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putString(filterClsName))
+                if (!commState.putString(null, filterClsName))
                     return false;
 
                 commState.idx++;
@@ -332,7 +332,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
             case 6:
                 if (ldrParties != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(ldrParties.size()))
+                        if (!commState.putInt(null, ldrParties.size()))
                             return false;
 
                         commState.it = ldrParties.entrySet().iterator();
@@ -345,13 +345,13 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                         Map.Entry<UUID, IgniteUuid> e = (Map.Entry<UUID, IgniteUuid>)commState.cur;
 
                         if (!commState.keyDone) {
-                            if (!commState.putUuid(e.getKey()))
+                            if (!commState.putUuid(null, e.getKey()))
                                 return false;
 
                             commState.keyDone = true;
                         }
 
-                        if (!commState.putGridUuid(e.getValue()))
+                        if (!commState.putGridUuid(null, e.getValue()))
                             return false;
 
                         commState.keyDone = false;
@@ -361,20 +361,20 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putByteArray(resTopicBytes))
+                if (!commState.putByteArray(null, resTopicBytes))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putString(userVer))
+                if (!commState.putString(null, userVer))
                     return false;
 
                 commState.idx++;
@@ -391,7 +391,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid clsLdrId0 = commState.getGridUuid();
+                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -404,14 +404,14 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte();
+                byte depMode0 = commState.getByte(null);
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
                 commState.idx++;
 
             case 2:
-                byte[] evtsBytes0 = commState.getByteArray();
+                byte[] evtsBytes0 = commState.getByteArray(null);
 
                 if (evtsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -421,7 +421,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 3:
-                byte[] exBytes0 = commState.getByteArray();
+                byte[] exBytes0 = commState.getByteArray(null);
 
                 if (exBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -431,7 +431,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 4:
-                byte[] filter0 = commState.getByteArray();
+                byte[] filter0 = commState.getByteArray(null);
 
                 if (filter0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -441,7 +441,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 5:
-                String filterClsName0 = commState.getString();
+                String filterClsName0 = commState.getString(null);
 
                 if (filterClsName0 == STR_NOT_READ)
                     return false;
@@ -455,7 +455,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -464,7 +464,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
-                            UUID _val = commState.getUuid();
+                            UUID _val = commState.getUuid(null);
 
                             if (_val == UUID_NOT_READ)
                                 return false;
@@ -473,7 +473,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                             commState.keyDone = true;
                         }
 
-                        IgniteUuid _val = commState.getGridUuid();
+                        IgniteUuid _val = commState.getGridUuid(null);
 
                         if (_val == GRID_UUID_NOT_READ)
                             return false;
@@ -493,7 +493,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 7:
-                byte[] resTopicBytes0 = commState.getByteArray();
+                byte[] resTopicBytes0 = commState.getByteArray(null);
 
                 if (resTopicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -503,7 +503,7 @@ public class GridEventStorageMessage extends GridTcpCommunicationMessageAdapter
                 commState.idx++;
 
             case 8:
-                String userVer0 = commState.getString();
+                String userVer0 = commState.getString(null);
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java
index fd36e15..8a1f0b9 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionRequest.java
@@ -161,7 +161,7 @@ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> imple
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -169,19 +169,19 @@ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> imple
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(entriesBytes))
+                if (!commState.putByteArray(null, entriesBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(futId))
+                if (!commState.putLong(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
@@ -201,7 +201,7 @@ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> imple
 
         switch (commState.idx) {
             case 3:
-                byte[] entriesBytes0 = commState.getByteArray();
+                byte[] entriesBytes0 = commState.getByteArray(null);
 
                 if (entriesBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -214,7 +214,7 @@ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> imple
                 if (buf.remaining() < 8)
                     return false;
 
-                futId = commState.getLong();
+                futId = commState.getLong(null);
 
                 commState.idx++;
 
@@ -222,7 +222,7 @@ public class GridCacheEvictionRequest<K, V> extends GridCacheMessage<K, V> imple
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java
index b241043..203b99d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionResponse.java
@@ -151,7 +151,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -159,13 +159,13 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putBoolean(err))
+                if (!commState.putBoolean(null, err))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(futId))
+                if (!commState.putLong(null, futId))
                     return false;
 
                 commState.idx++;
@@ -173,7 +173,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
             case 5:
                 if (rejectedKeyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(rejectedKeyBytes.size()))
+                        if (!commState.putInt(null, rejectedKeyBytes.size()))
                             return false;
 
                         commState.it = rejectedKeyBytes.iterator();
@@ -183,7 +183,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -191,7 +191,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -215,7 +215,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
                 if (buf.remaining() < 1)
                     return false;
 
-                err = commState.getBoolean();
+                err = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -223,7 +223,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
                 if (buf.remaining() < 8)
                     return false;
 
-                futId = commState.getLong();
+                futId = commState.getLong(null);
 
                 commState.idx++;
 
@@ -232,7 +232,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -240,7 +240,7 @@ public class GridCacheEvictionResponse<K, V> extends GridCacheMessage<K, V> {
                         rejectedKeyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java
index 71eac41..ea7987d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMessage.java
@@ -586,7 +586,7 @@ public abstract class GridCacheMessage<K, V> extends GridTcpCommunicationMessage
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -594,19 +594,19 @@ public abstract class GridCacheMessage<K, V> extends GridTcpCommunicationMessage
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putInt(cacheId))
+                if (!commState.putInt(null, cacheId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putMessage(depInfo))
+                if (!commState.putMessage(null, depInfo))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(msgId))
+                if (!commState.putLong(null, msgId))
                     return false;
 
                 commState.idx++;
@@ -626,12 +626,12 @@ public abstract class GridCacheMessage<K, V> extends GridTcpCommunicationMessage
                 if (buf.remaining() < 4)
                     return false;
 
-                cacheId = commState.getInt();
+                cacheId = commState.getInt(null);
 
                 commState.idx++;
 
             case 1:
-                Object depInfo0 = commState.getMessage();
+                Object depInfo0 = commState.getMessage(null);
 
                 if (depInfo0 == MSG_NOT_READ)
                     return false;
@@ -644,7 +644,7 @@ public abstract class GridCacheMessage<K, V> extends GridTcpCommunicationMessage
                 if (buf.remaining() < 8)
                     return false;
 
-                msgId = commState.getLong();
+                msgId = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
index 693f1ff..88c087f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxRequest.java
@@ -118,7 +118,7 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -126,25 +126,25 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putCacheVersion(nearXidVer))
+                if (!commState.putCacheVersion(null, nearXidVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putInt(txNum))
+                if (!commState.putInt(null, txNum))
                     return false;
 
                 commState.idx++;
@@ -164,7 +164,7 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
 
         switch (commState.idx) {
             case 8:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -174,7 +174,7 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
                 commState.idx++;
 
             case 9:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -184,7 +184,7 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
                 commState.idx++;
 
             case 10:
-                GridCacheVersion nearXidVer0 = commState.getCacheVersion();
+                GridCacheVersion nearXidVer0 = commState.getCacheVersion(null);
 
                 if (nearXidVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -197,7 +197,7 @@ public class GridCacheOptimisticCheckPreparedTxRequest<K, V> extends GridDistrib
                 if (buf.remaining() < 4)
                     return false;
 
-                txNum = commState.getInt();
+                txNum = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
index 21c2256..1baa17a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheOptimisticCheckPreparedTxResponse.java
@@ -106,7 +106,7 @@ public class GridCacheOptimisticCheckPreparedTxResponse<K, V> extends GridDistri
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -114,19 +114,19 @@ public class GridCacheOptimisticCheckPreparedTxResponse<K, V> extends GridDistri
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putBoolean(success))
+                if (!commState.putBoolean(null, success))
                     return false;
 
                 commState.idx++;
@@ -146,7 +146,7 @@ public class GridCacheOptimisticCheckPreparedTxResponse<K, V> extends GridDistri
 
         switch (commState.idx) {
             case 8:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -156,7 +156,7 @@ public class GridCacheOptimisticCheckPreparedTxResponse<K, V> extends GridDistri
                 commState.idx++;
 
             case 9:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -169,7 +169,7 @@ public class GridCacheOptimisticCheckPreparedTxResponse<K, V> extends GridDistri
                 if (buf.remaining() < 1)
                     return false;
 
-                success = commState.getBoolean();
+                success = commState.getBoolean(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java
index b7f8c2a..89b1a4b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxRequest.java
@@ -153,7 +153,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -161,37 +161,37 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putCacheVersion(nearXidVer))
+                if (!commState.putCacheVersion(null, nearXidVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putUuid(originatingNodeId))
+                if (!commState.putUuid(null, originatingNodeId))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putLong(originatingThreadId))
+                if (!commState.putLong(null, originatingThreadId))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putBoolean(nearOnlyCheck))
+                if (!commState.putBoolean(null, nearOnlyCheck))
                     return false;
 
                 commState.idx++;
@@ -211,7 +211,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
 
         switch (commState.idx) {
             case 8:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -221,7 +221,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 commState.idx++;
 
             case 9:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -231,7 +231,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 commState.idx++;
 
             case 10:
-                GridCacheVersion nearXidVer0 = commState.getCacheVersion();
+                GridCacheVersion nearXidVer0 = commState.getCacheVersion(null);
 
                 if (nearXidVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -241,7 +241,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 commState.idx++;
 
             case 11:
-                UUID originatingNodeId0 = commState.getUuid();
+                UUID originatingNodeId0 = commState.getUuid(null);
 
                 if (originatingNodeId0 == UUID_NOT_READ)
                     return false;
@@ -254,7 +254,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 if (buf.remaining() < 8)
                     return false;
 
-                originatingThreadId = commState.getLong();
+                originatingThreadId = commState.getLong(null);
 
                 commState.idx++;
 
@@ -262,7 +262,7 @@ public class GridCachePessimisticCheckCommittedTxRequest<K, V> extends GridDistr
                 if (buf.remaining() < 1)
                     return false;
 
-                nearOnlyCheck = commState.getBoolean();
+                nearOnlyCheck = commState.getBoolean(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java
index 529edcb..88f354b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCachePessimisticCheckCommittedTxResponse.java
@@ -137,7 +137,7 @@ public class GridCachePessimisticCheckCommittedTxResponse<K, V> extends GridDist
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -145,19 +145,19 @@ public class GridCachePessimisticCheckCommittedTxResponse<K, V> extends GridDist
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putByteArray(committedTxInfoBytes))
+                if (!commState.putByteArray(null, committedTxInfoBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
@@ -177,7 +177,7 @@ public class GridCachePessimisticCheckCommittedTxResponse<K, V> extends GridDist
 
         switch (commState.idx) {
             case 8:
-                byte[] committedTxInfoBytes0 = commState.getByteArray();
+                byte[] committedTxInfoBytes0 = commState.getByteArray(null);
 
                 if (committedTxInfoBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -187,7 +187,7 @@ public class GridCachePessimisticCheckCommittedTxResponse<K, V> extends GridDist
                 commState.idx++;
 
             case 9:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -197,7 +197,7 @@ public class GridCachePessimisticCheckCommittedTxResponse<K, V> extends GridDist
                 commState.idx++;
 
             case 10:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java
index fd96d32..3a0a86f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedBaseMessage.java
@@ -255,7 +255,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -263,13 +263,13 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(candsByIdxBytes))
+                if (!commState.putByteArray(null, candsByIdxBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(candsByKeyBytes))
+                if (!commState.putByteArray(null, candsByKeyBytes))
                     return false;
 
                 commState.idx++;
@@ -277,7 +277,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
             case 5:
                 if (committedVers != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(committedVers.size()))
+                        if (!commState.putInt(null, committedVers.size()))
                             return false;
 
                         commState.it = committedVers.iterator();
@@ -287,7 +287,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -295,7 +295,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -304,7 +304,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
             case 6:
                 if (rolledbackVers != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(rolledbackVers.size()))
+                        if (!commState.putInt(null, rolledbackVers.size()))
                             return false;
 
                         commState.it = rolledbackVers.iterator();
@@ -314,7 +314,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -322,14 +322,14 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putCacheVersion(ver))
+                if (!commState.putCacheVersion(null, ver))
                     return false;
 
                 commState.idx++;
@@ -349,7 +349,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
 
         switch (commState.idx) {
             case 3:
-                byte[] candsByIdxBytes0 = commState.getByteArray();
+                byte[] candsByIdxBytes0 = commState.getByteArray(null);
 
                 if (candsByIdxBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -359,7 +359,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                 commState.idx++;
 
             case 4:
-                byte[] candsByKeyBytes0 = commState.getByteArray();
+                byte[] candsByKeyBytes0 = commState.getByteArray(null);
 
                 if (candsByKeyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -373,7 +373,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -381,7 +381,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                         committedVers = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;
@@ -402,7 +402,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -410,7 +410,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                         rolledbackVers = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;
@@ -427,7 +427,7 @@ public abstract class GridDistributedBaseMessage<K, V> extends GridCacheMessage<
                 commState.idx++;
 
             case 7:
-                GridCacheVersion ver0 = commState.getCacheVersion();
+                GridCacheVersion ver0 = commState.getCacheVersion(null);
 
                 if (ver0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java
index 519c3b7..add0721 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -463,7 +463,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -473,7 +473,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
             case 8:
                 if (drVersByIdx != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(drVersByIdx.length))
+                        if (!commState.putInt(null, drVersByIdx.length))
                             return false;
 
                         commState.it = arrayIterator(drVersByIdx);
@@ -483,7 +483,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -491,44 +491,44 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putByteArray(grpLockKeyBytes))
+                if (!commState.putByteArray(null, grpLockKeyBytes))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putBoolean(isInTx))
+                if (!commState.putBoolean(null, isInTx))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(isInvalidate))
+                if (!commState.putBoolean(null, isInvalidate))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putBoolean(isRead))
+                if (!commState.putBoolean(null, isRead))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putEnum(isolation))
+                if (!commState.putEnum(null, isolation))
                     return false;
 
                 commState.idx++;
@@ -536,7 +536,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
             case 15:
                 if (keyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(keyBytes.size()))
+                        if (!commState.putInt(null, keyBytes.size()))
                             return false;
 
                         commState.it = keyBytes.iterator();
@@ -546,7 +546,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -554,56 +554,56 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 16:
-                if (!commState.putCacheVersion(nearXidVer))
+                if (!commState.putCacheVersion(null, nearXidVer))
                     return false;
 
                 commState.idx++;
 
             case 17:
-                if (!commState.putUuid(nodeId))
+                if (!commState.putUuid(null, nodeId))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putBoolean(partLock))
+                if (!commState.putBoolean(null, partLock))
                     return false;
 
                 commState.idx++;
 
             case 19:
-                if (!commState.putBooleanArray(retVals))
+                if (!commState.putBooleanArray(null, retVals))
                     return false;
 
                 commState.idx++;
 
             case 20:
-                if (!commState.putLong(threadId))
+                if (!commState.putLong(null, threadId))
                     return false;
 
                 commState.idx++;
 
             case 21:
-                if (!commState.putLong(timeout))
+                if (!commState.putLong(null, timeout))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putInt(txSize))
+                if (!commState.putInt(null, txSize))
                     return false;
 
                 commState.idx++;
 
             case 23:
-                if (!commState.putByteArray(writeEntriesBytes))
+                if (!commState.putByteArray(null, writeEntriesBytes))
                     return false;
 
                 commState.idx++;
@@ -627,7 +627,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -635,7 +635,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                         drVersByIdx = new GridCacheVersion[commState.readSize];
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;
@@ -652,7 +652,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 9:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -662,7 +662,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 10:
-                byte[] grpLockKeyBytes0 = commState.getByteArray();
+                byte[] grpLockKeyBytes0 = commState.getByteArray(null);
 
                 if (grpLockKeyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -675,7 +675,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                isInTx = commState.getBoolean();
+                isInTx = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -683,7 +683,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                isInvalidate = commState.getBoolean();
+                isInvalidate = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -691,7 +691,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                isRead = commState.getBoolean();
+                isRead = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -699,7 +699,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                byte isolation0 = commState.getByte();
+                byte isolation0 = commState.getByte(null);
 
                 isolation = GridCacheTxIsolation.fromOrdinal(isolation0);
 
@@ -710,7 +710,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -718,7 +718,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                         keyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -735,7 +735,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 16:
-                GridCacheVersion nearXidVer0 = commState.getCacheVersion();
+                GridCacheVersion nearXidVer0 = commState.getCacheVersion(null);
 
                 if (nearXidVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -745,7 +745,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 17:
-                UUID nodeId0 = commState.getUuid();
+                UUID nodeId0 = commState.getUuid(null);
 
                 if (nodeId0 == UUID_NOT_READ)
                     return false;
@@ -758,12 +758,12 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                partLock = commState.getBoolean();
+                partLock = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 19:
-                boolean[] retVals0 = commState.getBooleanArray();
+                boolean[] retVals0 = commState.getBooleanArray(null);
 
                 if (retVals0 == BOOLEAN_ARR_NOT_READ)
                     return false;
@@ -776,7 +776,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 8)
                     return false;
 
-                threadId = commState.getLong();
+                threadId = commState.getLong(null);
 
                 commState.idx++;
 
@@ -784,7 +784,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong();
+                timeout = commState.getLong(null);
 
                 commState.idx++;
 
@@ -792,12 +792,12 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 4)
                     return false;
 
-                txSize = commState.getInt();
+                txSize = commState.getInt(null);
 
                 commState.idx++;
 
             case 23:
-                byte[] writeEntriesBytes0 = commState.getByteArray();
+                byte[] writeEntriesBytes0 = commState.getByteArray(null);
 
                 if (writeEntriesBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java
index 8edfc7c..cf94059 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java
@@ -287,7 +287,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -295,13 +295,13 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
@@ -309,7 +309,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
             case 10:
                 if (valBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(valBytes.size()))
+                        if (!commState.putInt(null, valBytes.size()))
                             return false;
 
                         commState.it = valBytes.iterator();
@@ -319,7 +319,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putValueBytes((GridCacheValueBytes)commState.cur))
+                        if (!commState.putValueBytes(null, (GridCacheValueBytes)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -327,7 +327,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -348,7 +348,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
 
         switch (commState.idx) {
             case 8:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -358,7 +358,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
                 commState.idx++;
 
             case 9:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -372,7 +372,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -380,7 +380,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
                         valBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheValueBytes _val = commState.getValueBytes();
+                        GridCacheValueBytes _val = commState.getValueBytes(null);
 
                         if (_val == VAL_BYTES_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java
index d2093c2..8ffbc3d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java
@@ -361,7 +361,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -369,49 +369,49 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putCacheVersion(baseVer))
+                if (!commState.putCacheVersion(null, baseVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putBoolean(commit))
+                if (!commState.putBoolean(null, commit))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putCacheVersion(commitVer))
+                if (!commState.putCacheVersion(null, commitVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putByteArray(grpLockKeyBytes))
+                if (!commState.putByteArray(null, grpLockKeyBytes))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putBoolean(invalidate))
+                if (!commState.putBoolean(null, invalidate))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putBoolean(syncCommit))
+                if (!commState.putBoolean(null, syncCommit))
                     return false;
 
                 commState.idx++;
 
             case 15:
-                if (!commState.putBoolean(syncRollback))
+                if (!commState.putBoolean(null, syncRollback))
                     return false;
 
                 commState.idx++;
@@ -419,7 +419,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
             case 16:
                 if (recoveryWritesBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(recoveryWritesBytes.size()))
+                        if (!commState.putInt(null, recoveryWritesBytes.size()))
                             return false;
 
                         commState.it = recoveryWritesBytes.iterator();
@@ -429,7 +429,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -437,20 +437,20 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 17:
-                if (!commState.putLong(threadId))
+                if (!commState.putLong(null, threadId))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putInt(txSize))
+                if (!commState.putInt(null, txSize))
                     return false;
 
                 commState.idx++;
@@ -458,7 +458,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
             case 19:
                 if (writeEntriesBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(writeEntriesBytes.size()))
+                        if (!commState.putInt(null, writeEntriesBytes.size()))
                             return false;
 
                         commState.it = writeEntriesBytes.iterator();
@@ -468,7 +468,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -476,7 +476,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -497,7 +497,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
 
         switch (commState.idx) {
             case 8:
-                GridCacheVersion baseVer0 = commState.getCacheVersion();
+                GridCacheVersion baseVer0 = commState.getCacheVersion(null);
 
                 if (baseVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -510,12 +510,12 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 if (buf.remaining() < 1)
                     return false;
 
-                commit = commState.getBoolean();
+                commit = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 10:
-                GridCacheVersion commitVer0 = commState.getCacheVersion();
+                GridCacheVersion commitVer0 = commState.getCacheVersion(null);
 
                 if (commitVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -525,7 +525,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 commState.idx++;
 
             case 11:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -535,7 +535,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 commState.idx++;
 
             case 12:
-                byte[] grpLockKeyBytes0 = commState.getByteArray();
+                byte[] grpLockKeyBytes0 = commState.getByteArray(null);
 
                 if (grpLockKeyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -548,7 +548,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 if (buf.remaining() < 1)
                     return false;
 
-                invalidate = commState.getBoolean();
+                invalidate = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -556,7 +556,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 if (buf.remaining() < 1)
                     return false;
 
-                syncCommit = commState.getBoolean();
+                syncCommit = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -564,7 +564,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 if (buf.remaining() < 1)
                     return false;
 
-                syncRollback = commState.getBoolean();
+                syncRollback = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -573,7 +573,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -581,7 +581,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                         recoveryWritesBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -601,7 +601,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 if (buf.remaining() < 8)
                     return false;
 
-                threadId = commState.getLong();
+                threadId = commState.getLong(null);
 
                 commState.idx++;
 
@@ -609,7 +609,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 if (buf.remaining() < 4)
                     return false;
 
-                txSize = commState.getInt();
+                txSize = commState.getInt(null);
 
                 commState.idx++;
 
@@ -618,7 +618,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -626,7 +626,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                         writeEntriesBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java
index 4481668..eb68e05 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java
@@ -94,7 +94,7 @@ public class GridDistributedTxFinishResponse<K, V> extends GridCacheMessage<K, V
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -102,13 +102,13 @@ public class GridDistributedTxFinishResponse<K, V> extends GridCacheMessage<K, V
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putCacheVersion(txId))
+                if (!commState.putCacheVersion(null, txId))
                     return false;
 
                 commState.idx++;
@@ -128,7 +128,7 @@ public class GridDistributedTxFinishResponse<K, V> extends GridCacheMessage<K, V
 
         switch (commState.idx) {
             case 3:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -138,7 +138,7 @@ public class GridDistributedTxFinishResponse<K, V> extends GridCacheMessage<K, V
                 commState.idx++;
 
             case 4:
-                GridCacheVersion txId0 = commState.getCacheVersion();
+                GridCacheVersion txId0 = commState.getCacheVersion(null);
 
                 if (txId0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
index 791c4f7..4aa4963 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
@@ -426,7 +426,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -434,43 +434,43 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putCacheVersion(commitVer))
+                if (!commState.putCacheVersion(null, commitVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putEnum(concurrency))
+                if (!commState.putEnum(null, concurrency))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putByteArray(dhtVersBytes))
+                if (!commState.putByteArray(null, dhtVersBytes))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putByteArray(grpLockKeyBytes))
+                if (!commState.putByteArray(null, grpLockKeyBytes))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(invalidate))
+                if (!commState.putBoolean(null, invalidate))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putEnum(isolation))
+                if (!commState.putEnum(null, isolation))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putBoolean(partLock))
+                if (!commState.putBoolean(null, partLock))
                     return false;
 
                 commState.idx++;
@@ -478,7 +478,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
             case 15:
                 if (readsBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(readsBytes.size()))
+                        if (!commState.putInt(null, readsBytes.size()))
                             return false;
 
                         commState.it = readsBytes.iterator();
@@ -488,7 +488,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -496,32 +496,32 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 16:
-                if (!commState.putLong(threadId))
+                if (!commState.putLong(null, threadId))
                     return false;
 
                 commState.idx++;
 
             case 17:
-                if (!commState.putLong(timeout))
+                if (!commState.putLong(null, timeout))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putByteArray(txNodesBytes))
+                if (!commState.putByteArray(null, txNodesBytes))
                     return false;
 
                 commState.idx++;
 
             case 19:
-                if (!commState.putInt(txSize))
+                if (!commState.putInt(null, txSize))
                     return false;
 
                 commState.idx++;
@@ -529,7 +529,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
             case 20:
                 if (writesBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(writesBytes.size()))
+                        if (!commState.putInt(null, writesBytes.size()))
                             return false;
 
                         commState.it = writesBytes.iterator();
@@ -539,7 +539,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -547,7 +547,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -568,7 +568,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
 
         switch (commState.idx) {
             case 8:
-                GridCacheVersion commitVer0 = commState.getCacheVersion();
+                GridCacheVersion commitVer0 = commState.getCacheVersion(null);
 
                 if (commitVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -581,14 +581,14 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 1)
                     return false;
 
-                byte concurrency0 = commState.getByte();
+                byte concurrency0 = commState.getByte(null);
 
                 concurrency = GridCacheTxConcurrency.fromOrdinal(concurrency0);
 
                 commState.idx++;
 
             case 10:
-                byte[] dhtVersBytes0 = commState.getByteArray();
+                byte[] dhtVersBytes0 = commState.getByteArray(null);
 
                 if (dhtVersBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -598,7 +598,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 commState.idx++;
 
             case 11:
-                byte[] grpLockKeyBytes0 = commState.getByteArray();
+                byte[] grpLockKeyBytes0 = commState.getByteArray(null);
 
                 if (grpLockKeyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -611,7 +611,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 1)
                     return false;
 
-                invalidate = commState.getBoolean();
+                invalidate = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -619,7 +619,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 1)
                     return false;
 
-                byte isolation0 = commState.getByte();
+                byte isolation0 = commState.getByte(null);
 
                 isolation = GridCacheTxIsolation.fromOrdinal(isolation0);
 
@@ -629,7 +629,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 1)
                     return false;
 
-                partLock = commState.getBoolean();
+                partLock = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -638,7 +638,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -646,7 +646,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                         readsBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -666,7 +666,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 8)
                     return false;
 
-                threadId = commState.getLong();
+                threadId = commState.getLong(null);
 
                 commState.idx++;
 
@@ -674,12 +674,12 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong();
+                timeout = commState.getLong(null);
 
                 commState.idx++;
 
             case 18:
-                byte[] txNodesBytes0 = commState.getByteArray();
+                byte[] txNodesBytes0 = commState.getByteArray(null);
 
                 if (txNodesBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -692,7 +692,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 4)
                     return false;
 
-                txSize = commState.getInt();
+                txSize = commState.getInt(null);
 
                 commState.idx++;
 
@@ -701,7 +701,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -709,7 +709,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                         writesBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
index 2987382..2754c9e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
@@ -171,7 +171,7 @@ public class GridDistributedTxPrepareResponse<K, V> extends GridDistributedBaseM
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -179,13 +179,13 @@ public class GridDistributedTxPrepareResponse<K, V> extends GridDistributedBaseM
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putByteArray(candsBytes))
+                if (!commState.putByteArray(null, candsBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
@@ -205,7 +205,7 @@ public class GridDistributedTxPrepareResponse<K, V> extends GridDistributedBaseM
 
         switch (commState.idx) {
             case 8:
-                byte[] candsBytes0 = commState.getByteArray();
+                byte[] candsBytes0 = commState.getByteArray(null);
 
                 if (candsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -215,7 +215,7 @@ public class GridDistributedTxPrepareResponse<K, V> extends GridDistributedBaseM
                 commState.idx++;
 
             case 9:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedUnlockRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedUnlockRequest.java
index 93e3ccf..aa0772e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedUnlockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedUnlockRequest.java
@@ -136,7 +136,7 @@ public class GridDistributedUnlockRequest<K, V> extends GridDistributedBaseMessa
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -146,7 +146,7 @@ public class GridDistributedUnlockRequest<K, V> extends GridDistributedBaseMessa
             case 8:
                 if (keyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(keyBytes.size()))
+                        if (!commState.putInt(null, keyBytes.size()))
                             return false;
 
                         commState.it = keyBytes.iterator();
@@ -156,7 +156,7 @@ public class GridDistributedUnlockRequest<K, V> extends GridDistributedBaseMessa
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -164,7 +164,7 @@ public class GridDistributedUnlockRequest<K, V> extends GridDistributedBaseMessa
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -189,7 +189,7 @@ public class GridDistributedUnlockRequest<K, V> extends GridDistributedBaseMessa
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -197,7 +197,7 @@ public class GridDistributedUnlockRequest<K, V> extends GridDistributedBaseMessa
                         keyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;


[04/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index 00512ff..446a521 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -545,7 +545,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -553,13 +553,13 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putLongList(drExpireTimes))
+                if (!commState.putLongList(null, drExpireTimes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLongList(drTtls))
+                if (!commState.putLongList(null, drTtls))
                     return false;
 
                 commState.idx++;
@@ -567,7 +567,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
             case 5:
                 if (drVers != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(drVers.size()))
+                        if (!commState.putInt(null, drVers.size()))
                             return false;
 
                         commState.it = drVers.iterator();
@@ -577,7 +577,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -585,14 +585,14 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putBoolean(fastMap))
+                if (!commState.putBoolean(null, fastMap))
                     return false;
 
                 commState.idx++;
@@ -600,7 +600,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
             case 7:
                 if (filterBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(filterBytes.length))
+                        if (!commState.putInt(null, filterBytes.length))
                             return false;
 
                         commState.it = arrayIterator(filterBytes);
@@ -610,7 +610,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -618,20 +618,20 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putCacheVersion(futVer))
+                if (!commState.putCacheVersion(null, futVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putBoolean(hasPrimary))
+                if (!commState.putBoolean(null, hasPrimary))
                     return false;
 
                 commState.idx++;
@@ -639,7 +639,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
             case 10:
                 if (keyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(keyBytes.size()))
+                        if (!commState.putInt(null, keyBytes.size()))
                             return false;
 
                         commState.it = keyBytes.iterator();
@@ -649,7 +649,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -657,44 +657,44 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putEnum(op))
+                if (!commState.putEnum(null, op))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(retval))
+                if (!commState.putBoolean(null, retval))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putEnum(syncMode))
+                if (!commState.putEnum(null, syncMode))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 15:
-                if (!commState.putLong(ttl))
+                if (!commState.putLong(null, ttl))
                     return false;
 
                 commState.idx++;
 
             case 16:
-                if (!commState.putCacheVersion(updateVer))
+                if (!commState.putCacheVersion(null, updateVer))
                     return false;
 
                 commState.idx++;
@@ -702,7 +702,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
             case 17:
                 if (valBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(valBytes.size()))
+                        if (!commState.putInt(null, valBytes.size()))
                             return false;
 
                         commState.it = valBytes.iterator();
@@ -712,7 +712,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putValueBytes((GridCacheValueBytes)commState.cur))
+                        if (!commState.putValueBytes(null, (GridCacheValueBytes)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -720,26 +720,26 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putBoolean(forceTransformBackups))
+                if (!commState.putBoolean(null, forceTransformBackups))
                     return false;
 
                 commState.idx++;
 
             case 19:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 20:
-                if (!commState.putInt(taskNameHash))
+                if (!commState.putInt(null, taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -759,7 +759,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
         switch (commState.idx) {
             case 3:
-                GridLongList drExpireTimes0 = commState.getLongList();
+                GridLongList drExpireTimes0 = commState.getLongList(null);
 
                 if (drExpireTimes0 == LONG_LIST_NOT_READ)
                     return false;
@@ -769,7 +769,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 4:
-                GridLongList drTtls0 = commState.getLongList();
+                GridLongList drTtls0 = commState.getLongList(null);
 
                 if (drTtls0 == LONG_LIST_NOT_READ)
                     return false;
@@ -783,7 +783,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -791,7 +791,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                         drVers = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;
@@ -811,7 +811,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                fastMap = commState.getBoolean();
+                fastMap = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -820,7 +820,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -828,7 +828,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                         filterBytes = new byte[commState.readSize][];
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -845,7 +845,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 8:
-                GridCacheVersion futVer0 = commState.getCacheVersion();
+                GridCacheVersion futVer0 = commState.getCacheVersion(null);
 
                 if (futVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -858,7 +858,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                hasPrimary = commState.getBoolean();
+                hasPrimary = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -867,7 +867,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -875,7 +875,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                         keyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -895,7 +895,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                byte op0 = commState.getByte();
+                byte op0 = commState.getByte(null);
 
                 op = GridCacheOperation.fromOrdinal(op0);
 
@@ -905,7 +905,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                retval = commState.getBoolean();
+                retval = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -913,7 +913,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                byte syncMode0 = commState.getByte();
+                byte syncMode0 = commState.getByte(null);
 
                 syncMode = GridCacheWriteSynchronizationMode.fromOrdinal(syncMode0);
 
@@ -923,7 +923,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
@@ -931,12 +931,12 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 8)
                     return false;
 
-                ttl = commState.getLong();
+                ttl = commState.getLong(null);
 
                 commState.idx++;
 
             case 16:
-                GridCacheVersion updateVer0 = commState.getCacheVersion();
+                GridCacheVersion updateVer0 = commState.getCacheVersion(null);
 
                 if (updateVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -950,7 +950,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -958,7 +958,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                         valBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheValueBytes _val = commState.getValueBytes();
+                        GridCacheValueBytes _val = commState.getValueBytes(null);
 
                         if (_val == VAL_BYTES_NOT_READ)
                             return false;
@@ -978,12 +978,12 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                forceTransformBackups = commState.getBoolean();
+                forceTransformBackups = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 19:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -996,7 +996,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt();
+                taskNameHash = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index fe16214..ba683c3 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -396,7 +396,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -404,31 +404,31 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(failedKeysBytes))
+                if (!commState.putByteArray(null, failedKeysBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putCacheVersion(futVer))
+                if (!commState.putCacheVersion(null, futVer))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putByteArray(remapKeysBytes))
+                if (!commState.putByteArray(null, remapKeysBytes))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putByteArray(retValBytes))
+                if (!commState.putByteArray(null, retValBytes))
                     return false;
 
                 commState.idx++;
@@ -436,7 +436,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
             case 8:
                 if (nearSkipIdxs != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearSkipIdxs.size()))
+                        if (!commState.putInt(null, nearSkipIdxs.size()))
                             return false;
 
                         commState.it = nearSkipIdxs.iterator();
@@ -446,7 +446,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putInt((int)commState.cur))
+                        if (!commState.putInt(null, (int)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -454,14 +454,14 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putLong(nearTtl))
+                if (!commState.putLong(null, nearTtl))
                     return false;
 
                 commState.idx++;
@@ -469,7 +469,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
             case 10:
                 if (nearValBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearValBytes.size()))
+                        if (!commState.putInt(null, nearValBytes.size()))
                             return false;
 
                         commState.it = nearValBytes.iterator();
@@ -479,7 +479,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putValueBytes((GridCacheValueBytes)commState.cur))
+                        if (!commState.putValueBytes(null, (GridCacheValueBytes)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -487,7 +487,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -496,7 +496,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
             case 11:
                 if (nearValsIdxs != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearValsIdxs.size()))
+                        if (!commState.putInt(null, nearValsIdxs.size()))
                             return false;
 
                         commState.it = nearValsIdxs.iterator();
@@ -506,7 +506,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putInt((int)commState.cur))
+                        if (!commState.putInt(null, (int)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -514,14 +514,14 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putCacheVersion(nearVer))
+                if (!commState.putCacheVersion(null, nearVer))
                     return false;
 
                 commState.idx++;
@@ -541,7 +541,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
 
         switch (commState.idx) {
             case 3:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -551,7 +551,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 4:
-                byte[] failedKeysBytes0 = commState.getByteArray();
+                byte[] failedKeysBytes0 = commState.getByteArray(null);
 
                 if (failedKeysBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -561,7 +561,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 5:
-                GridCacheVersion futVer0 = commState.getCacheVersion();
+                GridCacheVersion futVer0 = commState.getCacheVersion(null);
 
                 if (futVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -571,7 +571,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 6:
-                byte[] remapKeysBytes0 = commState.getByteArray();
+                byte[] remapKeysBytes0 = commState.getByteArray(null);
 
                 if (remapKeysBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -581,7 +581,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 7:
-                byte[] retValBytes0 = commState.getByteArray();
+                byte[] retValBytes0 = commState.getByteArray(null);
 
                 if (retValBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -595,7 +595,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -606,7 +606,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                         if (buf.remaining() < 4)
                             return false;
 
-                        int _val = commState.getInt();
+                        int _val = commState.getInt(null);
 
                         nearSkipIdxs.add((Integer)_val);
 
@@ -623,7 +623,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 if (buf.remaining() < 8)
                     return false;
 
-                nearTtl = commState.getLong();
+                nearTtl = commState.getLong(null);
 
                 commState.idx++;
 
@@ -632,7 +632,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -640,7 +640,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                         nearValBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheValueBytes _val = commState.getValueBytes();
+                        GridCacheValueBytes _val = commState.getValueBytes(null);
 
                         if (_val == VAL_BYTES_NOT_READ)
                             return false;
@@ -661,7 +661,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -672,7 +672,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                         if (buf.remaining() < 4)
                             return false;
 
-                        int _val = commState.getInt();
+                        int _val = commState.getInt(null);
 
                         nearValsIdxs.add((Integer)_val);
 
@@ -686,7 +686,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 12:
-                GridCacheVersion nearVer0 = commState.getCacheVersion();
+                GridCacheVersion nearVer0 = commState.getCacheVersion(null);
 
                 if (nearVer0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
index 3bd7d5e..30c18cc 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
@@ -185,7 +185,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -193,7 +193,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
@@ -201,7 +201,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
             case 4:
                 if (keyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(keyBytes.size()))
+                        if (!commState.putInt(null, keyBytes.size()))
                             return false;
 
                         commState.it = keyBytes.iterator();
@@ -211,7 +211,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -219,20 +219,20 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
@@ -252,7 +252,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
 
         switch (commState.idx) {
             case 3:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -266,7 +266,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -274,7 +274,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
                         keyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -291,7 +291,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
                 commState.idx++;
 
             case 5:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -304,7 +304,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
index df1afec..e333a95 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
@@ -189,7 +189,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -197,19 +197,19 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(infosBytes))
+                if (!commState.putByteArray(null, infosBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
@@ -217,7 +217,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
             case 6:
                 if (missedKeyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(missedKeyBytes.size()))
+                        if (!commState.putInt(null, missedKeyBytes.size()))
                             return false;
 
                         commState.it = missedKeyBytes.iterator();
@@ -227,7 +227,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -235,7 +235,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -256,7 +256,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
 
         switch (commState.idx) {
             case 3:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -266,7 +266,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
                 commState.idx++;
 
             case 4:
-                byte[] infosBytes0 = commState.getByteArray();
+                byte[] infosBytes0 = commState.getByteArray(null);
 
                 if (infosBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -276,7 +276,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
                 commState.idx++;
 
             case 5:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -290,7 +290,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -298,7 +298,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
                         missedKeyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
index 01ceb9d..f77adc5 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
@@ -215,7 +215,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -225,7 +225,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
             case 3:
                 if (parts != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(parts.size()))
+                        if (!commState.putInt(null, parts.size()))
                             return false;
 
                         commState.it = parts.iterator();
@@ -235,7 +235,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putInt((int)commState.cur))
+                        if (!commState.putInt(null, (int)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -243,38 +243,38 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(timeout))
+                if (!commState.putLong(null, timeout))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putByteArray(topicBytes))
+                if (!commState.putByteArray(null, topicBytes))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(updateSeq))
+                if (!commState.putLong(null, updateSeq))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putInt(workerId))
+                if (!commState.putInt(null, workerId))
                     return false;
 
                 commState.idx++;
@@ -298,7 +298,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -309,7 +309,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                         if (buf.remaining() < 4)
                             return false;
 
-                        int _val = commState.getInt();
+                        int _val = commState.getInt(null);
 
                         parts.add((Integer)_val);
 
@@ -326,7 +326,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong();
+                timeout = commState.getLong(null);
 
                 commState.idx++;
 
@@ -334,12 +334,12 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
             case 6:
-                byte[] topicBytes0 = commState.getByteArray();
+                byte[] topicBytes0 = commState.getByteArray(null);
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -352,7 +352,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                updateSeq = commState.getLong();
+                updateSeq = commState.getLong(null);
 
                 commState.idx++;
 
@@ -360,7 +360,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 4)
                     return false;
 
-                workerId = commState.getInt();
+                workerId = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
index 57c8e52..bf3b606 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
@@ -300,7 +300,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -308,13 +308,13 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putBoolean(ack))
+                if (!commState.putBoolean(null, ack))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(infoBytes))
+                if (!commState.putByteArray(null, infoBytes))
                     return false;
 
                 commState.idx++;
@@ -322,7 +322,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
             case 5:
                 if (last != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(last.size()))
+                        if (!commState.putInt(null, last.size()))
                             return false;
 
                         commState.it = last.iterator();
@@ -332,7 +332,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putInt((int)commState.cur))
+                        if (!commState.putInt(null, (int)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -340,7 +340,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -349,7 +349,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
             case 6:
                 if (missed != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(missed.size()))
+                        if (!commState.putInt(null, missed.size()))
                             return false;
 
                         commState.it = missed.iterator();
@@ -359,7 +359,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putInt((int)commState.cur))
+                        if (!commState.putInt(null, (int)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -367,20 +367,20 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(updateSeq))
+                if (!commState.putLong(null, updateSeq))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putInt(workerId))
+                if (!commState.putInt(null, workerId))
                     return false;
 
                 commState.idx++;
@@ -403,12 +403,12 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                ack = commState.getBoolean();
+                ack = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 4:
-                byte[] infoBytes0 = commState.getByteArray();
+                byte[] infoBytes0 = commState.getByteArray(null);
 
                 if (infoBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -422,7 +422,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -433,7 +433,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                         if (buf.remaining() < 4)
                             return false;
 
-                        int _val = commState.getInt();
+                        int _val = commState.getInt(null);
 
                         last.add((Integer)_val);
 
@@ -451,7 +451,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -462,7 +462,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                         if (buf.remaining() < 4)
                             return false;
 
-                        int _val = commState.getInt();
+                        int _val = commState.getInt(null);
 
                         missed.add((Integer)_val);
 
@@ -479,7 +479,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                updateSeq = commState.getLong();
+                updateSeq = commState.getLong(null);
 
                 commState.idx++;
 
@@ -487,7 +487,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 4)
                     return false;
 
-                workerId = commState.getInt();
+                workerId = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
index 28cb6bb..e275f17 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
@@ -84,7 +84,7 @@ abstract class GridDhtPartitionsAbstractMessage<K, V> extends GridCacheMessage<K
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -92,13 +92,13 @@ abstract class GridDhtPartitionsAbstractMessage<K, V> extends GridCacheMessage<K
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putDhtPartitionExchangeId(exchId))
+                if (!commState.putDhtPartitionExchangeId(null, exchId))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putCacheVersion(lastVer))
+                if (!commState.putCacheVersion(null, lastVer))
                     return false;
 
                 commState.idx++;
@@ -118,7 +118,7 @@ abstract class GridDhtPartitionsAbstractMessage<K, V> extends GridCacheMessage<K
 
         switch (commState.idx) {
             case 3:
-                GridDhtPartitionExchangeId exchId0 = commState.getDhtPartitionExchangeId();
+                GridDhtPartitionExchangeId exchId0 = commState.getDhtPartitionExchangeId(null);
 
                 if (exchId0 == DHT_PART_EXCHANGE_ID_NOT_READ)
                     return false;
@@ -128,7 +128,7 @@ abstract class GridDhtPartitionsAbstractMessage<K, V> extends GridCacheMessage<K
                 commState.idx++;
 
             case 4:
-                GridCacheVersion lastVer0 = commState.getCacheVersion();
+                GridCacheVersion lastVer0 = commState.getCacheVersion(null);
 
                 if (lastVer0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
index 68ff1a4..d4d4570 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
@@ -165,7 +165,7 @@ public class GridDhtPartitionsFullMessage<K, V> extends GridDhtPartitionsAbstrac
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -173,19 +173,19 @@ public class GridDhtPartitionsFullMessage<K, V> extends GridDhtPartitionsAbstrac
 
         switch (commState.idx) {
             case 5:
-                if (!commState.putByteArray(affAssignmentBytes))
+                if (!commState.putByteArray(null, affAssignmentBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putByteArray(partsBytes))
+                if (!commState.putByteArray(null, partsBytes))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
@@ -205,7 +205,7 @@ public class GridDhtPartitionsFullMessage<K, V> extends GridDhtPartitionsAbstrac
 
         switch (commState.idx) {
             case 5:
-                byte[] affAssignmentBytes0 = commState.getByteArray();
+                byte[] affAssignmentBytes0 = commState.getByteArray(null);
 
                 if (affAssignmentBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -215,7 +215,7 @@ public class GridDhtPartitionsFullMessage<K, V> extends GridDhtPartitionsAbstrac
                 commState.idx++;
 
             case 6:
-                byte[] partsBytes0 = commState.getByteArray();
+                byte[] partsBytes0 = commState.getByteArray(null);
 
                 if (partsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -228,7 +228,7 @@ public class GridDhtPartitionsFullMessage<K, V> extends GridDhtPartitionsAbstrac
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
index 350da08..0671800 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
@@ -114,7 +114,7 @@ public class GridDhtPartitionsSingleMessage<K, V> extends GridDhtPartitionsAbstr
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -122,7 +122,7 @@ public class GridDhtPartitionsSingleMessage<K, V> extends GridDhtPartitionsAbstr
 
         switch (commState.idx) {
             case 5:
-                if (!commState.putByteArray(partsBytes))
+                if (!commState.putByteArray(null, partsBytes))
                     return false;
 
                 commState.idx++;
@@ -142,7 +142,7 @@ public class GridDhtPartitionsSingleMessage<K, V> extends GridDhtPartitionsAbstr
 
         switch (commState.idx) {
             case 5:
-                byte[] partsBytes0 = commState.getByteArray();
+                byte[] partsBytes0 = commState.getByteArray(null);
 
                 if (partsBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleRequest.java
index 2015225..853cc51 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleRequest.java
@@ -61,7 +61,7 @@ public class GridDhtPartitionsSingleRequest<K, V> extends GridDhtPartitionsAbstr
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java
index 12aacb7..61815b0 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java
@@ -250,7 +250,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -260,7 +260,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
             case 3:
                 if (filterBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(filterBytes.length))
+                        if (!commState.putInt(null, filterBytes.length))
                             return false;
 
                         commState.it = arrayIterator(filterBytes);
@@ -270,7 +270,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -278,14 +278,14 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
@@ -293,7 +293,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
             case 5:
                 if (keyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(keyBytes.size()))
+                        if (!commState.putInt(null, keyBytes.size()))
                             return false;
 
                         commState.it = keyBytes.entrySet().iterator();
@@ -306,13 +306,13 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                         Map.Entry<byte[], Boolean> e = (Map.Entry<byte[], Boolean>)commState.cur;
 
                         if (!commState.keyDone) {
-                            if (!commState.putByteArray(e.getKey()))
+                            if (!commState.putByteArray(null, e.getKey()))
                                 return false;
 
                             commState.keyDone = true;
                         }
 
-                        if (!commState.putBoolean(e.getValue()))
+                        if (!commState.putBoolean(null, e.getValue()))
                             return false;
 
                         commState.keyDone = false;
@@ -322,44 +322,44 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putBoolean(reload))
+                if (!commState.putBoolean(null, reload))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putCacheVersion(ver))
+                if (!commState.putCacheVersion(null, ver))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putInt(taskNameHash))
+                if (!commState.putInt(null, taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -383,7 +383,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -391,7 +391,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                         filterBytes = new byte[commState.readSize][];
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -408,7 +408,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 4:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -422,7 +422,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -431,7 +431,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
-                            byte[] _val = commState.getByteArray();
+                            byte[] _val = commState.getByteArray(null);
 
                             if (_val == BYTE_ARR_NOT_READ)
                                 return false;
@@ -443,7 +443,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                         if (buf.remaining() < 1)
                             return false;
 
-                        boolean _val = commState.getBoolean();
+                        boolean _val = commState.getBoolean(null);
 
                         keyBytes.put((byte[])commState.cur, _val);
 
@@ -460,7 +460,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 6:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -473,7 +473,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 if (buf.remaining() < 1)
                     return false;
 
-                reload = commState.getBoolean();
+                reload = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -481,12 +481,12 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
             case 9:
-                GridCacheVersion ver0 = commState.getCacheVersion();
+                GridCacheVersion ver0 = commState.getCacheVersion(null);
 
                 if (ver0 == CACHE_VER_NOT_READ)
                     return false;
@@ -496,7 +496,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 10:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -509,7 +509,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt();
+                taskNameHash = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java
index 5d171bc..1eba548 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java
@@ -226,7 +226,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -234,19 +234,19 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(entriesBytes))
+                if (!commState.putByteArray(null, entriesBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
@@ -254,7 +254,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
             case 6:
                 if (invalidParts != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(invalidParts.size()))
+                        if (!commState.putInt(null, invalidParts.size()))
                             return false;
 
                         commState.it = invalidParts.iterator();
@@ -264,7 +264,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putInt((int)commState.cur))
+                        if (!commState.putInt(null, (int)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -272,26 +272,26 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putCacheVersion(ver))
+                if (!commState.putCacheVersion(null, ver))
                     return false;
 
                 commState.idx++;
@@ -311,7 +311,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
 
         switch (commState.idx) {
             case 3:
-                byte[] entriesBytes0 = commState.getByteArray();
+                byte[] entriesBytes0 = commState.getByteArray(null);
 
                 if (entriesBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -321,7 +321,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 4:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -331,7 +331,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 5:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -345,7 +345,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -356,7 +356,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                         if (buf.remaining() < 4)
                             return false;
 
-                        int _val = commState.getInt();
+                        int _val = commState.getInt(null);
 
                         invalidParts.add((Integer)_val);
 
@@ -370,7 +370,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 7:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -383,12 +383,12 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
             case 9:
-                GridCacheVersion ver0 = commState.getCacheVersion();
+                GridCacheVersion ver0 = commState.getCacheVersion(null);
 
                 if (ver0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
index d9217d5..6f80471 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
@@ -327,7 +327,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -337,7 +337,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
             case 24:
                 if (dhtVers != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(dhtVers.length))
+                        if (!commState.putInt(null, dhtVers.length))
                             return false;
 
                         commState.it = arrayIterator(dhtVers);
@@ -347,7 +347,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -355,7 +355,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -364,7 +364,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
             case 25:
                 if (filterBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(filterBytes.length))
+                        if (!commState.putInt(null, filterBytes.length))
                             return false;
 
                         commState.it = arrayIterator(filterBytes);
@@ -374,7 +374,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -382,56 +382,56 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 26:
-                if (!commState.putBoolean(implicitSingleTx))
+                if (!commState.putBoolean(null, implicitSingleTx))
                     return false;
 
                 commState.idx++;
 
             case 27:
-                if (!commState.putBoolean(implicitTx))
+                if (!commState.putBoolean(null, implicitTx))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 29:
-                if (!commState.putBoolean(onePhaseCommit))
+                if (!commState.putBoolean(null, onePhaseCommit))
                     return false;
 
                 commState.idx++;
 
             case 30:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 31:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 32:
-                if (!commState.putInt(taskNameHash))
+                if (!commState.putInt(null, taskNameHash))
                     return false;
 
                 commState.idx++;
 
             case 33:
-                if (!commState.putBoolean(hasTransforms))
+                if (!commState.putBoolean(null, hasTransforms))
                     return false;
 
                 commState.idx++;
@@ -455,7 +455,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -463,7 +463,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                         dhtVers = new GridCacheVersion[commState.readSize];
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;
@@ -484,7 +484,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -492,7 +492,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                         filterBytes = new byte[commState.readSize][];
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -512,7 +512,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                implicitSingleTx = commState.getBoolean();
+                implicitSingleTx = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -520,12 +520,12 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                implicitTx = commState.getBoolean();
+                implicitTx = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 28:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -538,7 +538,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                onePhaseCommit = commState.getBoolean();
+                onePhaseCommit = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -546,12 +546,12 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
             case 31:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -564,7 +564,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt();
+                taskNameHash = commState.getInt(null);
 
                 commState.idx++;
 
@@ -572,7 +572,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                hasTransforms = commState.getBoolean();
+                hasTransforms = commState.getBoolean(null);
 
                 commState.idx++;
 


[17/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
index f77adc5..bb036cd 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
@@ -250,31 +250,31 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(null, timeout))
+                if (!commState.putLong("timeout", timeout))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putByteArray(null, topicBytes))
+                if (!commState.putByteArray("topicBytes", topicBytes))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(null, updateSeq))
+                if (!commState.putLong("updateSeq", updateSeq))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putInt(null, workerId))
+                if (!commState.putInt("workerId", workerId))
                     return false;
 
                 commState.idx++;
@@ -326,7 +326,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong(null);
+                timeout = commState.getLong("timeout");
 
                 commState.idx++;
 
@@ -334,12 +334,12 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
             case 6:
-                byte[] topicBytes0 = commState.getByteArray(null);
+                byte[] topicBytes0 = commState.getByteArray("topicBytes");
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -352,7 +352,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                updateSeq = commState.getLong(null);
+                updateSeq = commState.getLong("updateSeq");
 
                 commState.idx++;
 
@@ -360,7 +360,7 @@ public class GridDhtPartitionDemandMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 4)
                     return false;
 
-                workerId = commState.getInt(null);
+                workerId = commState.getInt("workerId");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
index bf3b606..4736f5c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplyMessage.java
@@ -308,13 +308,13 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putBoolean(null, ack))
+                if (!commState.putBoolean("ack", ack))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(null, infoBytes))
+                if (!commState.putByteArray("infoBytes", infoBytes))
                     return false;
 
                 commState.idx++;
@@ -374,13 +374,13 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(null, updateSeq))
+                if (!commState.putLong("updateSeq", updateSeq))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putInt(null, workerId))
+                if (!commState.putInt("workerId", workerId))
                     return false;
 
                 commState.idx++;
@@ -403,12 +403,12 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                ack = commState.getBoolean(null);
+                ack = commState.getBoolean("ack");
 
                 commState.idx++;
 
             case 4:
-                byte[] infoBytes0 = commState.getByteArray(null);
+                byte[] infoBytes0 = commState.getByteArray("infoBytes");
 
                 if (infoBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -479,7 +479,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                updateSeq = commState.getLong(null);
+                updateSeq = commState.getLong("updateSeq");
 
                 commState.idx++;
 
@@ -487,7 +487,7 @@ public class GridDhtPartitionSupplyMessage<K, V> extends GridCacheMessage<K, V>
                 if (buf.remaining() < 4)
                     return false;
 
-                workerId = commState.getInt(null);
+                workerId = commState.getInt("workerId");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
index e275f17..6b975e7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsAbstractMessage.java
@@ -92,13 +92,13 @@ abstract class GridDhtPartitionsAbstractMessage<K, V> extends GridCacheMessage<K
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putDhtPartitionExchangeId(null, exchId))
+                if (!commState.putDhtPartitionExchangeId("exchId", exchId))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putCacheVersion(null, lastVer))
+                if (!commState.putCacheVersion("lastVer", lastVer))
                     return false;
 
                 commState.idx++;
@@ -118,7 +118,7 @@ abstract class GridDhtPartitionsAbstractMessage<K, V> extends GridCacheMessage<K
 
         switch (commState.idx) {
             case 3:
-                GridDhtPartitionExchangeId exchId0 = commState.getDhtPartitionExchangeId(null);
+                GridDhtPartitionExchangeId exchId0 = commState.getDhtPartitionExchangeId("exchId");
 
                 if (exchId0 == DHT_PART_EXCHANGE_ID_NOT_READ)
                     return false;
@@ -128,7 +128,7 @@ abstract class GridDhtPartitionsAbstractMessage<K, V> extends GridCacheMessage<K
                 commState.idx++;
 
             case 4:
-                GridCacheVersion lastVer0 = commState.getCacheVersion(null);
+                GridCacheVersion lastVer0 = commState.getCacheVersion("lastVer");
 
                 if (lastVer0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
index d4d4570..7ce0084 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
@@ -173,19 +173,19 @@ public class GridDhtPartitionsFullMessage<K, V> extends GridDhtPartitionsAbstrac
 
         switch (commState.idx) {
             case 5:
-                if (!commState.putByteArray(null, affAssignmentBytes))
+                if (!commState.putByteArray("affAssignmentBytes", affAssignmentBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putByteArray(null, partsBytes))
+                if (!commState.putByteArray("partsBytes", partsBytes))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
@@ -205,7 +205,7 @@ public class GridDhtPartitionsFullMessage<K, V> extends GridDhtPartitionsAbstrac
 
         switch (commState.idx) {
             case 5:
-                byte[] affAssignmentBytes0 = commState.getByteArray(null);
+                byte[] affAssignmentBytes0 = commState.getByteArray("affAssignmentBytes");
 
                 if (affAssignmentBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -215,7 +215,7 @@ public class GridDhtPartitionsFullMessage<K, V> extends GridDhtPartitionsAbstrac
                 commState.idx++;
 
             case 6:
-                byte[] partsBytes0 = commState.getByteArray(null);
+                byte[] partsBytes0 = commState.getByteArray("partsBytes");
 
                 if (partsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -228,7 +228,7 @@ public class GridDhtPartitionsFullMessage<K, V> extends GridDhtPartitionsAbstrac
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
index 0671800..a2cee94 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
@@ -122,7 +122,7 @@ public class GridDhtPartitionsSingleMessage<K, V> extends GridDhtPartitionsAbstr
 
         switch (commState.idx) {
             case 5:
-                if (!commState.putByteArray(null, partsBytes))
+                if (!commState.putByteArray("partsBytes", partsBytes))
                     return false;
 
                 commState.idx++;
@@ -142,7 +142,7 @@ public class GridDhtPartitionsSingleMessage<K, V> extends GridDhtPartitionsAbstr
 
         switch (commState.idx) {
             case 5:
-                byte[] partsBytes0 = commState.getByteArray(null);
+                byte[] partsBytes0 = commState.getByteArray("partsBytes");
 
                 if (partsBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java
index 61815b0..133569a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetRequest.java
@@ -285,7 +285,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 4:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
@@ -329,37 +329,37 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 6:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putBoolean(null, reload))
+                if (!commState.putBoolean("reload", reload))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putCacheVersion(null, ver))
+                if (!commState.putCacheVersion("ver", ver))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putInt(null, taskNameHash))
+                if (!commState.putInt("taskNameHash", taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -408,7 +408,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 4:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -460,7 +460,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 6:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -473,7 +473,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 if (buf.remaining() < 1)
                     return false;
 
-                reload = commState.getBoolean(null);
+                reload = commState.getBoolean("reload");
 
                 commState.idx++;
 
@@ -481,12 +481,12 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
             case 9:
-                GridCacheVersion ver0 = commState.getCacheVersion(null);
+                GridCacheVersion ver0 = commState.getCacheVersion("ver");
 
                 if (ver0 == CACHE_VER_NOT_READ)
                     return false;
@@ -496,7 +496,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 10:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -509,7 +509,7 @@ public class GridNearGetRequest<K, V> extends GridCacheMessage<K, V> implements
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt(null);
+                taskNameHash = commState.getInt("taskNameHash");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java
index 1eba548..c652c52 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearGetResponse.java
@@ -234,19 +234,19 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(null, entriesBytes))
+                if (!commState.putByteArray("entriesBytes", entriesBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
@@ -279,19 +279,19 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 7:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putCacheVersion(null, ver))
+                if (!commState.putCacheVersion("ver", ver))
                     return false;
 
                 commState.idx++;
@@ -311,7 +311,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
 
         switch (commState.idx) {
             case 3:
-                byte[] entriesBytes0 = commState.getByteArray(null);
+                byte[] entriesBytes0 = commState.getByteArray("entriesBytes");
 
                 if (entriesBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -321,7 +321,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 4:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -331,7 +331,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 5:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -370,7 +370,7 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                 commState.idx++;
 
             case 7:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -383,12 +383,12 @@ public class GridNearGetResponse<K, V> extends GridCacheMessage<K, V> implements
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
             case 9:
-                GridCacheVersion ver0 = commState.getCacheVersion(null);
+                GridCacheVersion ver0 = commState.getCacheVersion("ver");
 
                 if (ver0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
index 6f80471..68c76df 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
@@ -389,49 +389,49 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 commState.idx++;
 
             case 26:
-                if (!commState.putBoolean(null, implicitSingleTx))
+                if (!commState.putBoolean("implicitSingleTx", implicitSingleTx))
                     return false;
 
                 commState.idx++;
 
             case 27:
-                if (!commState.putBoolean(null, implicitTx))
+                if (!commState.putBoolean("implicitTx", implicitTx))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 29:
-                if (!commState.putBoolean(null, onePhaseCommit))
+                if (!commState.putBoolean("onePhaseCommit", onePhaseCommit))
                     return false;
 
                 commState.idx++;
 
             case 30:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 31:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 32:
-                if (!commState.putInt(null, taskNameHash))
+                if (!commState.putInt("taskNameHash", taskNameHash))
                     return false;
 
                 commState.idx++;
 
             case 33:
-                if (!commState.putBoolean(null, hasTransforms))
+                if (!commState.putBoolean("hasTransforms", hasTransforms))
                     return false;
 
                 commState.idx++;
@@ -512,7 +512,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                implicitSingleTx = commState.getBoolean(null);
+                implicitSingleTx = commState.getBoolean("implicitSingleTx");
 
                 commState.idx++;
 
@@ -520,12 +520,12 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                implicitTx = commState.getBoolean(null);
+                implicitTx = commState.getBoolean("implicitTx");
 
                 commState.idx++;
 
             case 28:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -538,7 +538,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                onePhaseCommit = commState.getBoolean(null);
+                onePhaseCommit = commState.getBoolean("onePhaseCommit");
 
                 commState.idx++;
 
@@ -546,12 +546,12 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
             case 31:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -564,7 +564,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt(null);
+                taskNameHash = commState.getInt("taskNameHash");
 
                 commState.idx++;
 
@@ -572,7 +572,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K, V>
                 if (buf.remaining() < 1)
                     return false;
 
-                hasTransforms = commState.getBoolean(null);
+                hasTransforms = commState.getBoolean("hasTransforms");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java
index f5476fc..9c0a0b0 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java
@@ -237,7 +237,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                 commState.idx++;
 
             case 12:
-                if (!commState.putBooleanArray(null, filterRes))
+                if (!commState.putBooleanArray("filterRes", filterRes))
                     return false;
 
                 commState.idx++;
@@ -270,7 +270,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                 commState.idx++;
 
             case 14:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
@@ -346,7 +346,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                 commState.idx++;
 
             case 12:
-                boolean[] filterRes0 = commState.getBooleanArray(null);
+                boolean[] filterRes0 = commState.getBooleanArray("filterRes");
 
                 if (filterRes0 == BOOLEAN_ARR_NOT_READ)
                     return false;
@@ -385,7 +385,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                 commState.idx++;
 
             case 14:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java
index b63b038..4164788 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java
@@ -176,31 +176,31 @@ public class GridNearTxFinishRequest<K, V> extends GridDistributedTxFinishReques
 
         switch (commState.idx) {
             case 20:
-                if (!commState.putBoolean(null, explicitLock))
+                if (!commState.putBoolean("explicitLock", explicitLock))
                     return false;
 
                 commState.idx++;
 
             case 21:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 23:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 24:
-                if (!commState.putInt(null, taskNameHash))
+                if (!commState.putInt("taskNameHash", taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -223,12 +223,12 @@ public class GridNearTxFinishRequest<K, V> extends GridDistributedTxFinishReques
                 if (buf.remaining() < 1)
                     return false;
 
-                explicitLock = commState.getBoolean(null);
+                explicitLock = commState.getBoolean("explicitLock");
 
                 commState.idx++;
 
             case 21:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -241,12 +241,12 @@ public class GridNearTxFinishRequest<K, V> extends GridDistributedTxFinishReques
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
             case 23:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -259,7 +259,7 @@ public class GridNearTxFinishRequest<K, V> extends GridDistributedTxFinishReques
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt(null);
+                taskNameHash = commState.getInt("taskNameHash");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java
index b093106..93629bf 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java
@@ -143,19 +143,19 @@ public class GridNearTxFinishResponse<K, V> extends GridDistributedTxFinishRespo
 
         switch (commState.idx) {
             case 5:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(null, nearThreadId))
+                if (!commState.putLong("nearThreadId", nearThreadId))
                     return false;
 
                 commState.idx++;
@@ -175,7 +175,7 @@ public class GridNearTxFinishResponse<K, V> extends GridDistributedTxFinishRespo
 
         switch (commState.idx) {
             case 5:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -185,7 +185,7 @@ public class GridNearTxFinishResponse<K, V> extends GridDistributedTxFinishRespo
                 commState.idx++;
 
             case 6:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -198,7 +198,7 @@ public class GridNearTxFinishResponse<K, V> extends GridDistributedTxFinishRespo
                 if (buf.remaining() < 8)
                     return false;
 
-                nearThreadId = commState.getLong(null);
+                nearThreadId = commState.getLong("nearThreadId");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
index 7decc5e..ab51ff3 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
@@ -219,6 +219,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
 
         _clone.futId = futId;
         _clone.miniId = miniId;
+        _clone.near = near;
         _clone.topVer = topVer;
         _clone.last = last;
         _clone.lastBackups = lastBackups;
@@ -243,13 +244,13 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
 
         switch (commState.idx) {
             case 21:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putBoolean(null, last))
+                if (!commState.putBoolean("last", last))
                     return false;
 
                 commState.idx++;
@@ -282,31 +283,31 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 commState.idx++;
 
             case 24:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 25:
-                if (!commState.putBoolean(null, near))
+                if (!commState.putBoolean("near", near))
                     return false;
 
                 commState.idx++;
 
             case 26:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 27:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putInt(null, taskNameHash))
+                if (!commState.putInt("taskNameHash", taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -326,7 +327,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
 
         switch (commState.idx) {
             case 21:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -339,7 +340,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 if (buf.remaining() < 1)
                     return false;
 
-                last = commState.getBoolean(null);
+                last = commState.getBoolean("last");
 
                 commState.idx++;
 
@@ -373,7 +374,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 commState.idx++;
 
             case 24:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -386,7 +387,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 if (buf.remaining() < 1)
                     return false;
 
-                near = commState.getBoolean(null);
+                near = commState.getBoolean("near");
 
                 commState.idx++;
 
@@ -394,12 +395,12 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
             case 27:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -412,7 +413,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt(null);
+                taskNameHash = commState.getInt("taskNameHash");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
index ea475a9..70719d5 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
@@ -255,13 +255,13 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
 
         switch (commState.idx) {
             case 10:
-                if (!commState.putCacheVersion(null, dhtVer))
+                if (!commState.putCacheVersion("dhtVer", dhtVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
@@ -294,7 +294,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                 commState.idx++;
 
             case 13:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
@@ -368,7 +368,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
 
         switch (commState.idx) {
             case 10:
-                GridCacheVersion dhtVer0 = commState.getCacheVersion(null);
+                GridCacheVersion dhtVer0 = commState.getCacheVersion("dhtVer");
 
                 if (dhtVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -378,7 +378,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                 commState.idx++;
 
             case 11:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -417,7 +417,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                 commState.idx++;
 
             case 13:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java
index 4318df6..4614513 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java
@@ -494,115 +494,115 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putBoolean(null, all))
+                if (!commState.putBoolean("all", all))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(null, argsBytes))
+                if (!commState.putByteArray("argsBytes", argsBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putString(null, cacheName))
+                if (!commState.putString("cacheName", cacheName))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putBoolean(null, cancel))
+                if (!commState.putBoolean("cancel", cancel))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putString(null, clause))
+                if (!commState.putString("clause", clause))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putString(null, clsName))
+                if (!commState.putString("clsName", clsName))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putBoolean(null, fields))
+                if (!commState.putBoolean("fields", fields))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putLong(null, id))
+                if (!commState.putLong("id", id))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putBoolean(null, incBackups))
+                if (!commState.putBoolean("incBackups", incBackups))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(null, incMeta))
+                if (!commState.putBoolean("incMeta", incMeta))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putByteArray(null, keyValFilterBytes))
+                if (!commState.putByteArray("keyValFilterBytes", keyValFilterBytes))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putInt(null, pageSize))
+                if (!commState.putInt("pageSize", pageSize))
                     return false;
 
                 commState.idx++;
 
             case 15:
-                if (!commState.putByteArray(null, prjFilterBytes))
+                if (!commState.putByteArray("prjFilterBytes", prjFilterBytes))
                     return false;
 
                 commState.idx++;
 
             case 16:
-                if (!commState.putByteArray(null, rdcBytes))
+                if (!commState.putByteArray("rdcBytes", rdcBytes))
                     return false;
 
                 commState.idx++;
 
             case 17:
-                if (!commState.putByteArray(null, transBytes))
+                if (!commState.putByteArray("transBytes", transBytes))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putEnum(null, type))
+                if (!commState.putEnum("type", type))
                     return false;
 
                 commState.idx++;
 
             case 19:
-                if (!commState.putBoolean(null, keepPortable))
+                if (!commState.putBoolean("keepPortable", keepPortable))
                     return false;
 
                 commState.idx++;
 
             case 20:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 21:
-                if (!commState.putInt(null, taskHash))
+                if (!commState.putInt("taskHash", taskHash))
                     return false;
 
                 commState.idx++;
@@ -625,12 +625,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                all = commState.getBoolean(null);
+                all = commState.getBoolean("all");
 
                 commState.idx++;
 
             case 4:
-                byte[] argsBytes0 = commState.getByteArray(null);
+                byte[] argsBytes0 = commState.getByteArray("argsBytes");
 
                 if (argsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -640,7 +640,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 commState.idx++;
 
             case 5:
-                String cacheName0 = commState.getString(null);
+                String cacheName0 = commState.getString("cacheName");
 
                 if (cacheName0 == STR_NOT_READ)
                     return false;
@@ -653,12 +653,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                cancel = commState.getBoolean(null);
+                cancel = commState.getBoolean("cancel");
 
                 commState.idx++;
 
             case 7:
-                String clause0 = commState.getString(null);
+                String clause0 = commState.getString("clause");
 
                 if (clause0 == STR_NOT_READ)
                     return false;
@@ -668,7 +668,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 commState.idx++;
 
             case 8:
-                String clsName0 = commState.getString(null);
+                String clsName0 = commState.getString("clsName");
 
                 if (clsName0 == STR_NOT_READ)
                     return false;
@@ -681,7 +681,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                fields = commState.getBoolean(null);
+                fields = commState.getBoolean("fields");
 
                 commState.idx++;
 
@@ -689,7 +689,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 8)
                     return false;
 
-                id = commState.getLong(null);
+                id = commState.getLong("id");
 
                 commState.idx++;
 
@@ -697,7 +697,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                incBackups = commState.getBoolean(null);
+                incBackups = commState.getBoolean("incBackups");
 
                 commState.idx++;
 
@@ -705,12 +705,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                incMeta = commState.getBoolean(null);
+                incMeta = commState.getBoolean("incMeta");
 
                 commState.idx++;
 
             case 13:
-                byte[] keyValFilterBytes0 = commState.getByteArray(null);
+                byte[] keyValFilterBytes0 = commState.getByteArray("keyValFilterBytes");
 
                 if (keyValFilterBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -723,12 +723,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 4)
                     return false;
 
-                pageSize = commState.getInt(null);
+                pageSize = commState.getInt("pageSize");
 
                 commState.idx++;
 
             case 15:
-                byte[] prjFilterBytes0 = commState.getByteArray(null);
+                byte[] prjFilterBytes0 = commState.getByteArray("prjFilterBytes");
 
                 if (prjFilterBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -738,7 +738,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 commState.idx++;
 
             case 16:
-                byte[] rdcBytes0 = commState.getByteArray(null);
+                byte[] rdcBytes0 = commState.getByteArray("rdcBytes");
 
                 if (rdcBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -748,7 +748,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 commState.idx++;
 
             case 17:
-                byte[] transBytes0 = commState.getByteArray(null);
+                byte[] transBytes0 = commState.getByteArray("transBytes");
 
                 if (transBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -761,7 +761,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                byte type0 = commState.getByte(null);
+                byte type0 = commState.getByte("type");
 
                 type = GridCacheQueryType.fromOrdinal(type0);
 
@@ -771,12 +771,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                keepPortable = commState.getBoolean(null);
+                keepPortable = commState.getBoolean("keepPortable");
 
                 commState.idx++;
 
             case 20:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -789,7 +789,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 4)
                     return false;
 
-                taskHash = commState.getInt(null);
+                taskHash = commState.getInt("taskHash");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java
index 0254c6d..825a575 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java
@@ -264,19 +264,19 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putBoolean(null, fields))
+                if (!commState.putBoolean("fields", fields))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putBoolean(null, finished))
+                if (!commState.putBoolean("finished", finished))
                     return false;
 
                 commState.idx++;
@@ -309,7 +309,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 commState.idx++;
 
             case 8:
-                if (!commState.putLong(null, reqId))
+                if (!commState.putLong("reqId", reqId))
                     return false;
 
                 commState.idx++;
@@ -358,7 +358,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 commState.idx++;
 
             case 4:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -371,7 +371,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 if (buf.remaining() < 1)
                     return false;
 
-                fields = commState.getBoolean(null);
+                fields = commState.getBoolean("fields");
 
                 commState.idx++;
 
@@ -379,7 +379,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 if (buf.remaining() < 1)
                     return false;
 
-                finished = commState.getBoolean(null);
+                finished = commState.getBoolean("finished");
 
                 commState.idx++;
 
@@ -416,7 +416,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 if (buf.remaining() < 8)
                     return false;
 
-                reqId = commState.getLong(null);
+                reqId = commState.getLong("reqId");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java
index f3a61c8..cca184b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java
@@ -133,7 +133,7 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
                 commState.idx++;
 
             case 1:
-                if (!commState.putClockDeltaVersion(null, snapVer))
+                if (!commState.putClockDeltaVersion("snapVer", snapVer))
                     return false;
 
                 commState.idx++;
@@ -159,7 +159,7 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
 
                 if (commState.readSize >= 0) {
                     if (deltas == null)
-                        deltas = U.newHashMap(commState.readSize);
+                        deltas = new HashMap<>(commState.readSize, 1.0f);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
@@ -192,7 +192,7 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
                 commState.idx++;
 
             case 1:
-                GridClockDeltaVersion snapVer0 = commState.getClockDeltaVersion(null);
+                GridClockDeltaVersion snapVer0 = commState.getClockDeltaVersion("snapVer");
 
                 if (snapVer0 == CLOCK_DELTA_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java
index e87e972..6f0ef14 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java
@@ -106,11 +106,11 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
     /** {@inheritDoc} */
     @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"})
     @Override public GridTcpCommunicationMessageAdapter clone() {
-        GridContinuousMessage clone = new GridContinuousMessage();
+        GridContinuousMessage _clone = new GridContinuousMessage();
 
-        clone0(clone);
+        clone0(_clone);
 
-        return clone;
+        return _clone;
     }
 
     /** {@inheritDoc} */
@@ -137,19 +137,19 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, dataBytes))
+                if (!commState.putByteArray("dataBytes", dataBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putUuid(null, routineId))
+                if (!commState.putUuid("routineId", routineId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putEnum(null, type))
+                if (!commState.putEnum("type", type))
                     return false;
 
                 commState.idx++;
@@ -166,7 +166,7 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                byte[] dataBytes0 = commState.getByteArray(null);
+                byte[] dataBytes0 = commState.getByteArray("dataBytes");
 
                 if (dataBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -176,7 +176,7 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                UUID routineId0 = commState.getUuid(null);
+                UUID routineId0 = commState.getUuid("routineId");
 
                 if (routineId0 == UUID_NOT_READ)
                     return false;
@@ -189,7 +189,7 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                byte type0 = commState.getByte(null);
+                byte type0 = commState.getByte("type");
 
                 type = GridContinuousMessageType.fromOrdinal(type0);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java
index 7810633..d7b815e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java
@@ -214,37 +214,37 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putString(null, cacheName))
+                if (!commState.putString("cacheName", cacheName))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, clsLdrId))
+                if (!commState.putGridUuid("clsLdrId", clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putByteArray(null, colBytes))
+                if (!commState.putByteArray("colBytes", colBytes))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putEnum(null, depMode))
+                if (!commState.putEnum("depMode", depMode))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putBoolean(null, forceLocDep))
+                if (!commState.putBoolean("forceLocDep", forceLocDep))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putBoolean(null, ignoreDepOwnership))
+                if (!commState.putBoolean("ignoreDepOwnership", ignoreDepOwnership))
                     return false;
 
                 commState.idx++;
@@ -288,31 +288,31 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(null, reqId))
+                if (!commState.putLong("reqId", reqId))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putByteArray(null, resTopicBytes))
+                if (!commState.putByteArray("resTopicBytes", resTopicBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putString(null, sampleClsName))
+                if (!commState.putString("sampleClsName", sampleClsName))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putByteArray(null, updaterBytes))
+                if (!commState.putByteArray("updaterBytes", updaterBytes))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putString(null, userVer))
+                if (!commState.putString("userVer", userVer))
                     return false;
 
                 commState.idx++;
@@ -328,7 +328,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                String cacheName0 = commState.getString(null);
+                String cacheName0 = commState.getString("cacheName");
 
                 if (cacheName0 == STR_NOT_READ)
                     return false;
@@ -338,7 +338,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 1:
-                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
+                IgniteUuid clsLdrId0 = commState.getGridUuid("clsLdrId");
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -348,7 +348,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 2:
-                byte[] colBytes0 = commState.getByteArray(null);
+                byte[] colBytes0 = commState.getByteArray("colBytes");
 
                 if (colBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -361,7 +361,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte(null);
+                byte depMode0 = commState.getByte("depMode");
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -371,7 +371,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 1)
                     return false;
 
-                forceLocDep = commState.getBoolean(null);
+                forceLocDep = commState.getBoolean("forceLocDep");
 
                 commState.idx++;
 
@@ -379,7 +379,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 1)
                     return false;
 
-                ignoreDepOwnership = commState.getBoolean(null);
+                ignoreDepOwnership = commState.getBoolean("ignoreDepOwnership");
 
                 commState.idx++;
 
@@ -393,7 +393,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
 
                 if (commState.readSize >= 0) {
                     if (ldrParticipants == null)
-                        ldrParticipants = U.newHashMap(commState.readSize);
+                        ldrParticipants = new HashMap<>(commState.readSize, 1.0f);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
@@ -429,12 +429,12 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 8)
                     return false;
 
-                reqId = commState.getLong(null);
+                reqId = commState.getLong("reqId");
 
                 commState.idx++;
 
             case 8:
-                byte[] resTopicBytes0 = commState.getByteArray(null);
+                byte[] resTopicBytes0 = commState.getByteArray("resTopicBytes");
 
                 if (resTopicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -444,7 +444,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 9:
-                String sampleClsName0 = commState.getString(null);
+                String sampleClsName0 = commState.getString("sampleClsName");
 
                 if (sampleClsName0 == STR_NOT_READ)
                     return false;
@@ -454,7 +454,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 10:
-                byte[] updaterBytes0 = commState.getByteArray(null);
+                byte[] updaterBytes0 = commState.getByteArray("updaterBytes");
 
                 if (updaterBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -464,7 +464,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 11:
-                String userVer0 = commState.getString(null);
+                String userVer0 = commState.getString("userVer");
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java
index f726db8..46bab85 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java
@@ -107,19 +107,19 @@ public class GridDataLoadResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(null, forceLocDep))
+                if (!commState.putBoolean("forceLocDep", forceLocDep))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(null, reqId))
+                if (!commState.putLong("reqId", reqId))
                     return false;
 
                 commState.idx++;
@@ -136,7 +136,7 @@ public class GridDataLoadResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -149,7 +149,7 @@ public class GridDataLoadResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                forceLocDep = commState.getBoolean(null);
+                forceLocDep = commState.getBoolean("forceLocDep");
 
                 commState.idx++;
 
@@ -157,7 +157,7 @@ public class GridDataLoadResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 8)
                     return false;
 
-                reqId = commState.getLong(null);
+                reqId = commState.getLong("reqId");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java
index f01b397..d3cb730 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java
@@ -133,19 +133,19 @@ public class GridGgfsAckMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, fileId))
+                if (!commState.putGridUuid("fileId", fileId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(null, id))
+                if (!commState.putLong("id", id))
                     return false;
 
                 commState.idx++;
@@ -165,7 +165,7 @@ public class GridGgfsAckMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -175,7 +175,7 @@ public class GridGgfsAckMessage extends GridGgfsCommunicationMessage {
                 commState.idx++;
 
             case 1:
-                IgniteUuid fileId0 = commState.getGridUuid(null);
+                IgniteUuid fileId0 = commState.getGridUuid("fileId");
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -188,7 +188,7 @@ public class GridGgfsAckMessage extends GridGgfsCommunicationMessage {
                 if (buf.remaining() < 8)
                     return false;
 
-                id = commState.getLong(null);
+                id = commState.getLong("id");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java
index 563c458..0675e7b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java
@@ -184,25 +184,25 @@ public final class GridGgfsBlockKey extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, affKey))
+                if (!commState.putGridUuid("affKey", affKey))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putLong(null, blockId))
+                if (!commState.putLong("blockId", blockId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(null, evictExclude))
+                if (!commState.putBoolean("evictExclude", evictExclude))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putGridUuid(null, fileId))
+                if (!commState.putGridUuid("fileId", fileId))
                     return false;
 
                 commState.idx++;
@@ -219,7 +219,7 @@ public final class GridGgfsBlockKey extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid affKey0 = commState.getGridUuid(null);
+                IgniteUuid affKey0 = commState.getGridUuid("affKey");
 
                 if (affKey0 == GRID_UUID_NOT_READ)
                     return false;
@@ -232,7 +232,7 @@ public final class GridGgfsBlockKey extends GridTcpCommunicationMessageAdapter
                 if (buf.remaining() < 8)
                     return false;
 
-                blockId = commState.getLong(null);
+                blockId = commState.getLong("blockId");
 
                 commState.idx++;
 
@@ -240,12 +240,12 @@ public final class GridGgfsBlockKey extends GridTcpCommunicationMessageAdapter
                 if (buf.remaining() < 1)
                     return false;
 
-                evictExclude = commState.getBoolean(null);
+                evictExclude = commState.getBoolean("evictExclude");
 
                 commState.idx++;
 
             case 3:
-                IgniteUuid fileId0 = commState.getGridUuid(null);
+                IgniteUuid fileId0 = commState.getGridUuid("fileId");
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java
index 2f9ea60..0b169a7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java
@@ -152,13 +152,13 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, fileId))
+                if (!commState.putGridUuid("fileId", fileId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(null, id))
+                if (!commState.putLong("id", id))
                     return false;
 
                 commState.idx++;
@@ -187,7 +187,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
 
                 if (commState.readSize >= 0) {
                     if (blocks == null)
-                        blocks = U.newHashMap(commState.readSize);
+                        blocks = new HashMap<>(commState.readSize, 1.0f);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
@@ -220,7 +220,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
                 commState.idx++;
 
             case 1:
-                IgniteUuid fileId0 = commState.getGridUuid(null);
+                IgniteUuid fileId0 = commState.getGridUuid("fileId");
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -233,7 +233,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
                 if (buf.remaining() < 8)
                     return false;
 
-                id = commState.getLong(null);
+                id = commState.getLong("id");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java
index c913132..e2fedec 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java
@@ -136,13 +136,13 @@ public class GridGgfsDeleteMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, id))
+                if (!commState.putGridUuid("id", id))
                     return false;
 
                 commState.idx++;
@@ -162,7 +162,7 @@ public class GridGgfsDeleteMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -172,7 +172,7 @@ public class GridGgfsDeleteMessage extends GridGgfsCommunicationMessage {
                 commState.idx++;
 
             case 1:
-                IgniteUuid id0 = commState.getGridUuid(null);
+                IgniteUuid id0 = commState.getGridUuid("id");
 
                 if (id0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java
index 46975bb..ce82844 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFileAffinityRange.java
@@ -289,31 +289,31 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, affKey))
+                if (!commState.putGridUuid("affKey", affKey))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(null, done))
+                if (!commState.putBoolean("done", done))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(null, endOff))
+                if (!commState.putLong("endOff", endOff))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putLong(null, startOff))
+                if (!commState.putLong("startOff", startOff))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putInt(null, status))
+                if (!commState.putInt("status", status))
                     return false;
 
                 commState.idx++;
@@ -330,7 +330,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid affKey0 = commState.getGridUuid(null);
+                IgniteUuid affKey0 = commState.getGridUuid("affKey");
 
                 if (affKey0 == GRID_UUID_NOT_READ)
                     return false;
@@ -343,7 +343,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 1)
                     return false;
 
-                done = commState.getBoolean(null);
+                done = commState.getBoolean("done");
 
                 commState.idx++;
 
@@ -351,7 +351,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 8)
                     return false;
 
-                endOff = commState.getLong(null);
+                endOff = commState.getLong("endOff");
 
                 commState.idx++;
 
@@ -359,7 +359,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 8)
                     return false;
 
-                startOff = commState.getLong(null);
+                startOff = commState.getLong("startOff");
 
                 commState.idx++;
 
@@ -367,7 +367,7 @@ public class GridGgfsFileAffinityRange extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 4)
                     return false;
 
-                status = commState.getInt(null);
+                status = commState.getInt("status");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java
index 80b4621..b35991b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerRequest.java
@@ -107,7 +107,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, fileId))
+                if (!commState.putGridUuid("fileId", fileId))
                     return false;
 
                 commState.idx++;
@@ -154,7 +154,7 @@ public class GridGgfsFragmentizerRequest extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid fileId0 = commState.getGridUuid(null);
+                IgniteUuid fileId0 = commState.getGridUuid("fileId");
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;


[05/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
index fc580ea..ef4e7ba 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
@@ -85,7 +85,7 @@ public class GridDhtAffinityAssignmentRequest<K, V> extends GridCacheMessage<K,
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -93,7 +93,7 @@ public class GridDhtAffinityAssignmentRequest<K, V> extends GridCacheMessage<K,
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
@@ -115,7 +115,7 @@ public class GridDhtAffinityAssignmentRequest<K, V> extends GridCacheMessage<K,
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
index 62923cb..2495763 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
@@ -126,7 +126,7 @@ public class GridDhtAffinityAssignmentResponse<K, V> extends GridCacheMessage<K,
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -134,13 +134,13 @@ public class GridDhtAffinityAssignmentResponse<K, V> extends GridCacheMessage<K,
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(affAssignmentBytes))
+                if (!commState.putByteArray(null, affAssignmentBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
@@ -159,7 +159,7 @@ public class GridDhtAffinityAssignmentResponse<K, V> extends GridCacheMessage<K,
 
         switch (commState.idx) {
             case 3:
-                byte[] affAssignmentBytes0 = commState.getByteArray();
+                byte[] affAssignmentBytes0 = commState.getByteArray(null);
 
                 if (affAssignmentBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -172,7 +172,7 @@ public class GridDhtAffinityAssignmentResponse<K, V> extends GridCacheMessage<K,
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java
index 0f115c1..a78a6e3 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java
@@ -340,7 +340,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -348,13 +348,13 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
 
         switch (commState.idx) {
             case 24:
-                if (!commState.putBitSet(invalidateEntries))
+                if (!commState.putBitSet(null, invalidateEntries))
                     return false;
 
                 commState.idx++;
 
             case 25:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
@@ -362,7 +362,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
             case 26:
                 if (nearKeyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearKeyBytes.size()))
+                        if (!commState.putInt(null, nearKeyBytes.size()))
                             return false;
 
                         commState.it = nearKeyBytes.iterator();
@@ -372,7 +372,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -380,38 +380,38 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 27:
-                if (!commState.putByteArray(ownedBytes))
+                if (!commState.putByteArray(null, ownedBytes))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 29:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 30:
-                if (!commState.putInt(taskNameHash))
+                if (!commState.putInt(null, taskNameHash))
                     return false;
 
                 commState.idx++;
 
             case 31:
-                if (!commState.putBitSet(preloadKeys))
+                if (!commState.putBitSet(null, preloadKeys))
                     return false;
 
                 commState.idx++;
@@ -431,7 +431,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
 
         switch (commState.idx) {
             case 24:
-                BitSet invalidateEntries0 = commState.getBitSet();
+                BitSet invalidateEntries0 = commState.getBitSet(null);
 
                 if (invalidateEntries0 == BIT_SET_NOT_READ)
                     return false;
@@ -441,7 +441,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                 commState.idx++;
 
             case 25:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -455,7 +455,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -463,7 +463,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                         nearKeyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -480,7 +480,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                 commState.idx++;
 
             case 27:
-                byte[] ownedBytes0 = commState.getByteArray();
+                byte[] ownedBytes0 = commState.getByteArray(null);
 
                 if (ownedBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -493,12 +493,12 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
             case 29:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -511,12 +511,12 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt();
+                taskNameHash = commState.getInt(null);
 
                 commState.idx++;
 
             case 31:
-                BitSet preloadKeys0 = commState.getBitSet();
+                BitSet preloadKeys0 = commState.getBitSet(null);
 
                 if (preloadKeys0 == BIT_SET_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java
index 3a86b4e..2563a31 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java
@@ -222,7 +222,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -232,7 +232,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
             case 11:
                 if (invalidParts != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(invalidParts.size()))
+                        if (!commState.putInt(null, invalidParts.size()))
                             return false;
 
                         commState.it = invalidParts.iterator();
@@ -242,7 +242,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putInt((int)commState.cur))
+                        if (!commState.putInt(null, (int)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -250,14 +250,14 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
@@ -265,7 +265,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
             case 13:
                 if (nearEvictedBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearEvictedBytes.size()))
+                        if (!commState.putInt(null, nearEvictedBytes.size()))
                             return false;
 
                         commState.it = nearEvictedBytes.iterator();
@@ -275,7 +275,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -283,7 +283,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -292,7 +292,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
             case 14:
                 if (preloadEntriesBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(preloadEntriesBytes.size()))
+                        if (!commState.putInt(null, preloadEntriesBytes.size()))
                             return false;
 
                         commState.it = preloadEntriesBytes.iterator();
@@ -302,7 +302,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -310,7 +310,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -335,7 +335,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -346,7 +346,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                         if (buf.remaining() < 4)
                             return false;
 
-                        int _val = commState.getInt();
+                        int _val = commState.getInt(null);
 
                         invalidParts.add((Integer)_val);
 
@@ -360,7 +360,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                 commState.idx++;
 
             case 12:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -374,7 +374,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -382,7 +382,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                         nearEvictedBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -403,7 +403,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -411,7 +411,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                         preloadEntriesBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
index c5db862..105787f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
@@ -315,7 +315,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -323,19 +323,19 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
 
         switch (commState.idx) {
             case 20:
-                if (!commState.putEnum(isolation))
+                if (!commState.putEnum(null, isolation))
                     return false;
 
                 commState.idx++;
 
             case 21:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putUuid(nearNodeId))
+                if (!commState.putUuid(null, nearNodeId))
                     return false;
 
                 commState.idx++;
@@ -343,7 +343,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
             case 23:
                 if (nearWritesBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearWritesBytes.size()))
+                        if (!commState.putInt(null, nearWritesBytes.size()))
                             return false;
 
                         commState.it = nearWritesBytes.iterator();
@@ -353,7 +353,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -361,14 +361,14 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 24:
-                if (!commState.putBoolean(onePhaseCommit))
+                if (!commState.putBoolean(null, onePhaseCommit))
                     return false;
 
                 commState.idx++;
@@ -376,7 +376,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
             case 25:
                 if (pendingVers != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(pendingVers.size()))
+                        if (!commState.putInt(null, pendingVers.size()))
                             return false;
 
                         commState.it = pendingVers.iterator();
@@ -386,7 +386,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -394,38 +394,38 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 26:
-                if (!commState.putBoolean(sysInvalidate))
+                if (!commState.putBoolean(null, sysInvalidate))
                     return false;
 
                 commState.idx++;
 
             case 27:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putCacheVersion(writeVer))
+                if (!commState.putCacheVersion(null, writeVer))
                     return false;
 
                 commState.idx++;
 
             case 29:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 30:
-                if (!commState.putInt(taskNameHash))
+                if (!commState.putInt(null, taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -448,14 +448,14 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 1)
                     return false;
 
-                byte isolation0 = commState.getByte();
+                byte isolation0 = commState.getByte(null);
 
                 isolation = GridCacheTxIsolation.fromOrdinal(isolation0);
 
                 commState.idx++;
 
             case 21:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -465,7 +465,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 commState.idx++;
 
             case 22:
-                UUID nearNodeId0 = commState.getUuid();
+                UUID nearNodeId0 = commState.getUuid(null);
 
                 if (nearNodeId0 == UUID_NOT_READ)
                     return false;
@@ -479,7 +479,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -487,7 +487,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                         nearWritesBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -507,7 +507,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 1)
                     return false;
 
-                onePhaseCommit = commState.getBoolean();
+                onePhaseCommit = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -516,7 +516,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -524,7 +524,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                         pendingVers = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;
@@ -544,7 +544,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 1)
                     return false;
 
-                sysInvalidate = commState.getBoolean();
+                sysInvalidate = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -552,12 +552,12 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
             case 28:
-                GridCacheVersion writeVer0 = commState.getCacheVersion();
+                GridCacheVersion writeVer0 = commState.getCacheVersion(null);
 
                 if (writeVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -567,7 +567,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 commState.idx++;
 
             case 29:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -580,7 +580,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt();
+                taskNameHash = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
index bab9219..b64e780 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
@@ -88,7 +88,7 @@ public class GridDhtTxFinishResponse<K, V> extends GridDistributedTxFinishRespon
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -96,7 +96,7 @@ public class GridDhtTxFinishResponse<K, V> extends GridDistributedTxFinishRespon
 
         switch (commState.idx) {
             case 5:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
@@ -116,7 +116,7 @@ public class GridDhtTxFinishResponse<K, V> extends GridDistributedTxFinishRespon
 
         switch (commState.idx) {
             case 5:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
index 61dfe70..1455e5d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
@@ -345,7 +345,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -353,31 +353,31 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
 
         switch (commState.idx) {
             case 21:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putBitSet(invalidateNearEntries))
+                if (!commState.putBitSet(null, invalidateNearEntries))
                     return false;
 
                 commState.idx++;
 
             case 23:
-                if (!commState.putBoolean(last))
+                if (!commState.putBoolean(null, last))
                     return false;
 
                 commState.idx++;
 
             case 24:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 25:
-                if (!commState.putUuid(nearNodeId))
+                if (!commState.putUuid(null, nearNodeId))
                     return false;
 
                 commState.idx++;
@@ -385,7 +385,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
             case 26:
                 if (nearWritesBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearWritesBytes.size()))
+                        if (!commState.putInt(null, nearWritesBytes.size()))
                             return false;
 
                         commState.it = nearWritesBytes.iterator();
@@ -395,7 +395,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -403,44 +403,44 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 27:
-                if (!commState.putCacheVersion(nearXidVer))
+                if (!commState.putCacheVersion(null, nearXidVer))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putByteArray(ownedBytes))
+                if (!commState.putByteArray(null, ownedBytes))
                     return false;
 
                 commState.idx++;
 
             case 29:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 30:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 31:
-                if (!commState.putInt(taskNameHash))
+                if (!commState.putInt(null, taskNameHash))
                     return false;
 
                 commState.idx++;
 
             case 32:
-                if (!commState.putBitSet(preloadKeys))
+                if (!commState.putBitSet(null, preloadKeys))
                     return false;
 
                 commState.idx++;
@@ -460,7 +460,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
 
         switch (commState.idx) {
             case 21:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -470,7 +470,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 commState.idx++;
 
             case 22:
-                BitSet invalidateNearEntries0 = commState.getBitSet();
+                BitSet invalidateNearEntries0 = commState.getBitSet(null);
 
                 if (invalidateNearEntries0 == BIT_SET_NOT_READ)
                     return false;
@@ -483,12 +483,12 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 if (buf.remaining() < 1)
                     return false;
 
-                last = commState.getBoolean();
+                last = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 24:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -498,7 +498,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 commState.idx++;
 
             case 25:
-                UUID nearNodeId0 = commState.getUuid();
+                UUID nearNodeId0 = commState.getUuid(null);
 
                 if (nearNodeId0 == UUID_NOT_READ)
                     return false;
@@ -512,7 +512,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -520,7 +520,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                         nearWritesBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -537,7 +537,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 commState.idx++;
 
             case 27:
-                GridCacheVersion nearXidVer0 = commState.getCacheVersion();
+                GridCacheVersion nearXidVer0 = commState.getCacheVersion(null);
 
                 if (nearXidVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -547,7 +547,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 commState.idx++;
 
             case 28:
-                byte[] ownedBytes0 = commState.getByteArray();
+                byte[] ownedBytes0 = commState.getByteArray(null);
 
                 if (ownedBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -560,12 +560,12 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
             case 30:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -578,12 +578,12 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt();
+                taskNameHash = commState.getInt(null);
 
                 commState.idx++;
 
             case 32:
-                BitSet preloadKeys0 = commState.getBitSet();
+                BitSet preloadKeys0 = commState.getBitSet(null);
 
                 if (preloadKeys0 == BIT_SET_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
index 1ada909..d541b58 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
@@ -229,7 +229,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -237,7 +237,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
 
         switch (commState.idx) {
             case 10:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
@@ -245,7 +245,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
             case 11:
                 if (invalidParts != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(invalidParts.size()))
+                        if (!commState.putInt(null, invalidParts.size()))
                             return false;
 
                         commState.it = invalidParts.iterator();
@@ -255,7 +255,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putInt((int)commState.cur))
+                        if (!commState.putInt(null, (int)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -263,14 +263,14 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
@@ -278,7 +278,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
             case 13:
                 if (nearEvictedBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearEvictedBytes.size()))
+                        if (!commState.putInt(null, nearEvictedBytes.size()))
                             return false;
 
                         commState.it = nearEvictedBytes.iterator();
@@ -288,7 +288,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -296,7 +296,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -305,7 +305,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
             case 14:
                 if (preloadEntriesBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(preloadEntriesBytes.size()))
+                        if (!commState.putInt(null, preloadEntriesBytes.size()))
                             return false;
 
                         commState.it = preloadEntriesBytes.iterator();
@@ -315,7 +315,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -323,7 +323,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -344,7 +344,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
 
         switch (commState.idx) {
             case 10:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -358,7 +358,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -369,7 +369,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                         if (buf.remaining() < 4)
                             return false;
 
-                        int _val = commState.getInt();
+                        int _val = commState.getInt(null);
 
                         invalidParts.add((Integer)_val);
 
@@ -383,7 +383,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                 commState.idx++;
 
             case 12:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -397,7 +397,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -405,7 +405,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                         nearEvictedBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -426,7 +426,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -434,7 +434,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                         preloadEntriesBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtUnlockRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
index 4a5a5a0..3a4c289 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtUnlockRequest.java
@@ -124,7 +124,7 @@ public class GridDhtUnlockRequest<K, V> extends GridDistributedUnlockRequest<K,
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -134,7 +134,7 @@ public class GridDhtUnlockRequest<K, V> extends GridDistributedUnlockRequest<K,
             case 9:
                 if (nearKeyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearKeyBytes.size()))
+                        if (!commState.putInt(null, nearKeyBytes.size()))
                             return false;
 
                         commState.it = nearKeyBytes.iterator();
@@ -144,7 +144,7 @@ public class GridDhtUnlockRequest<K, V> extends GridDistributedUnlockRequest<K,
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -152,7 +152,7 @@ public class GridDhtUnlockRequest<K, V> extends GridDistributedUnlockRequest<K,
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -177,7 +177,7 @@ public class GridDhtUnlockRequest<K, V> extends GridDistributedUnlockRequest<K,
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -185,7 +185,7 @@ public class GridDhtUnlockRequest<K, V> extends GridDistributedUnlockRequest<K,
                         nearKeyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java
index e04099c..f86a28c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicDeferredUpdateResponse.java
@@ -91,7 +91,7 @@ public class GridDhtAtomicDeferredUpdateResponse<K, V> extends GridCacheMessage<
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -101,7 +101,7 @@ public class GridDhtAtomicDeferredUpdateResponse<K, V> extends GridCacheMessage<
             case 3:
                 if (futVers != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(futVers.size()))
+                        if (!commState.putInt(null, futVers.size()))
                             return false;
 
                         commState.it = futVers.iterator();
@@ -111,7 +111,7 @@ public class GridDhtAtomicDeferredUpdateResponse<K, V> extends GridCacheMessage<
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -119,7 +119,7 @@ public class GridDhtAtomicDeferredUpdateResponse<K, V> extends GridCacheMessage<
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -144,7 +144,7 @@ public class GridDhtAtomicDeferredUpdateResponse<K, V> extends GridCacheMessage<
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -152,7 +152,7 @@ public class GridDhtAtomicDeferredUpdateResponse<K, V> extends GridCacheMessage<
                         futVers = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index ad3f8da..6e084f3 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -644,7 +644,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -652,13 +652,13 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putLongList(drExpireTimes))
+                if (!commState.putLongList(null, drExpireTimes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLongList(drTtls))
+                if (!commState.putLongList(null, drTtls))
                     return false;
 
                 commState.idx++;
@@ -666,7 +666,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
             case 5:
                 if (drVers != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(drVers.size()))
+                        if (!commState.putInt(null, drVers.size()))
                             return false;
 
                         commState.it = drVers.iterator();
@@ -676,7 +676,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -684,14 +684,14 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putCacheVersion(futVer))
+                if (!commState.putCacheVersion(null, futVer))
                     return false;
 
                 commState.idx++;
@@ -699,7 +699,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
             case 7:
                 if (keyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(keyBytes.size()))
+                        if (!commState.putInt(null, keyBytes.size()))
                             return false;
 
                         commState.it = keyBytes.iterator();
@@ -709,7 +709,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -717,32 +717,32 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putUuid(nodeId))
+                if (!commState.putUuid(null, nodeId))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putEnum(syncMode))
+                if (!commState.putEnum(null, syncMode))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putLong(ttl))
+                if (!commState.putLong(null, ttl))
                     return false;
 
                 commState.idx++;
@@ -750,7 +750,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
             case 12:
                 if (valBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(valBytes.size()))
+                        if (!commState.putInt(null, valBytes.size()))
                             return false;
 
                         commState.it = valBytes.iterator();
@@ -760,7 +760,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putValueBytes((GridCacheValueBytes)commState.cur))
+                        if (!commState.putValueBytes(null, (GridCacheValueBytes)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -768,14 +768,14 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putCacheVersion(writeVer))
+                if (!commState.putCacheVersion(null, writeVer))
                     return false;
 
                 commState.idx++;
@@ -783,7 +783,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
             case 14:
                 if (nearKeyBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearKeyBytes.size()))
+                        if (!commState.putInt(null, nearKeyBytes.size()))
                             return false;
 
                         commState.it = nearKeyBytes.iterator();
@@ -793,7 +793,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -801,7 +801,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -810,7 +810,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
             case 15:
                 if (nearValBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearValBytes.size()))
+                        if (!commState.putInt(null, nearValBytes.size()))
                             return false;
 
                         commState.it = nearValBytes.iterator();
@@ -820,7 +820,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putValueBytes((GridCacheValueBytes)commState.cur))
+                        if (!commState.putValueBytes(null, (GridCacheValueBytes)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -828,14 +828,14 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 16:
-                if (!commState.putBoolean(forceTransformBackups))
+                if (!commState.putBoolean(null, forceTransformBackups))
                     return false;
 
                 commState.idx++;
@@ -843,7 +843,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
             case 17:
                 if (nearTransformClosBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearTransformClosBytes.size()))
+                        if (!commState.putInt(null, nearTransformClosBytes.size()))
                             return false;
 
                         commState.it = nearTransformClosBytes.iterator();
@@ -853,7 +853,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -861,7 +861,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -870,7 +870,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
             case 18:
                 if (transformClosBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(transformClosBytes.size()))
+                        if (!commState.putInt(null, transformClosBytes.size()))
                             return false;
 
                         commState.it = transformClosBytes.iterator();
@@ -880,7 +880,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -888,20 +888,20 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 19:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 20:
-                if (!commState.putInt(taskNameHash))
+                if (!commState.putInt(null, taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -921,7 +921,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
         switch (commState.idx) {
             case 3:
-                GridLongList drExpireTimes0 = commState.getLongList();
+                GridLongList drExpireTimes0 = commState.getLongList(null);
 
                 if (drExpireTimes0 == LONG_LIST_NOT_READ)
                     return false;
@@ -931,7 +931,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 4:
-                GridLongList drTtls0 = commState.getLongList();
+                GridLongList drTtls0 = commState.getLongList(null);
 
                 if (drTtls0 == LONG_LIST_NOT_READ)
                     return false;
@@ -945,7 +945,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -953,7 +953,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         drVers = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;
@@ -970,7 +970,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 6:
-                GridCacheVersion futVer0 = commState.getCacheVersion();
+                GridCacheVersion futVer0 = commState.getCacheVersion(null);
 
                 if (futVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -984,7 +984,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -992,7 +992,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         keyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -1009,7 +1009,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 8:
-                UUID nodeId0 = commState.getUuid();
+                UUID nodeId0 = commState.getUuid(null);
 
                 if (nodeId0 == UUID_NOT_READ)
                     return false;
@@ -1022,7 +1022,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 1)
                     return false;
 
-                byte syncMode0 = commState.getByte();
+                byte syncMode0 = commState.getByte(null);
 
                 syncMode = GridCacheWriteSynchronizationMode.fromOrdinal(syncMode0);
 
@@ -1032,7 +1032,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
@@ -1040,7 +1040,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 8)
                     return false;
 
-                ttl = commState.getLong();
+                ttl = commState.getLong(null);
 
                 commState.idx++;
 
@@ -1049,7 +1049,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -1057,7 +1057,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         valBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheValueBytes _val = commState.getValueBytes();
+                        GridCacheValueBytes _val = commState.getValueBytes(null);
 
                         if (_val == VAL_BYTES_NOT_READ)
                             return false;
@@ -1074,7 +1074,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 13:
-                GridCacheVersion writeVer0 = commState.getCacheVersion();
+                GridCacheVersion writeVer0 = commState.getCacheVersion(null);
 
                 if (writeVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -1088,7 +1088,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -1096,7 +1096,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         nearKeyBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -1117,7 +1117,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -1125,7 +1125,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         nearValBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheValueBytes _val = commState.getValueBytes();
+                        GridCacheValueBytes _val = commState.getValueBytes(null);
 
                         if (_val == VAL_BYTES_NOT_READ)
                             return false;
@@ -1145,7 +1145,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 1)
                     return false;
 
-                forceTransformBackups = commState.getBoolean();
+                forceTransformBackups = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -1154,7 +1154,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -1162,7 +1162,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         nearTransformClosBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -1183,7 +1183,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -1191,7 +1191,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                         transformClosBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -1208,7 +1208,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 19:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -1221,7 +1221,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt();
+                taskNameHash = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
index 81b0a89..5d3ba59 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
@@ -203,7 +203,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -211,19 +211,19 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(failedKeysBytes))
+                if (!commState.putByteArray(null, failedKeysBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putCacheVersion(futVer))
+                if (!commState.putCacheVersion(null, futVer))
                     return false;
 
                 commState.idx++;
@@ -231,7 +231,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
             case 6:
                 if (nearEvictedBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nearEvictedBytes.size()))
+                        if (!commState.putInt(null, nearEvictedBytes.size()))
                             return false;
 
                         commState.it = nearEvictedBytes.iterator();
@@ -241,7 +241,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -249,7 +249,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -270,7 +270,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
 
         switch (commState.idx) {
             case 3:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -280,7 +280,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 4:
-                byte[] failedKeysBytes0 = commState.getByteArray();
+                byte[] failedKeysBytes0 = commState.getByteArray(null);
 
                 if (failedKeysBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -290,7 +290,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 5:
-                GridCacheVersion futVer0 = commState.getCacheVersion();
+                GridCacheVersion futVer0 = commState.getCacheVersion(null);
 
                 if (futVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -304,7 +304,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -312,7 +312,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
                         nearEvictedBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;


[16/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java
index 9d71c9c..5ea3ae5 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsFragmentizerResponse.java
@@ -82,7 +82,7 @@ public class GridGgfsFragmentizerResponse extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, fileId))
+                if (!commState.putGridUuid("fileId", fileId))
                     return false;
 
                 commState.idx++;
@@ -102,7 +102,7 @@ public class GridGgfsFragmentizerResponse extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid fileId0 = commState.getGridUuid(null);
+                IgniteUuid fileId0 = commState.getGridUuid("fileId");
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java
index 06fbcef..4cbec78 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsSyncMessage.java
@@ -100,13 +100,13 @@ public class GridGgfsSyncMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putLong(null, order))
+                if (!commState.putLong("order", order))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(null, res))
+                if (!commState.putBoolean("res", res))
                     return false;
 
                 commState.idx++;
@@ -129,7 +129,7 @@ public class GridGgfsSyncMessage extends GridGgfsCommunicationMessage {
                 if (buf.remaining() < 8)
                     return false;
 
-                order = commState.getLong(null);
+                order = commState.getLong("order");
 
                 commState.idx++;
 
@@ -137,7 +137,7 @@ public class GridGgfsSyncMessage extends GridGgfsCommunicationMessage {
                 if (buf.remaining() < 1)
                     return false;
 
-                res = commState.getBoolean(null);
+                res = commState.getBoolean("res");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java
index 601428c..df9fd66 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeRequestWrapper.java
@@ -62,7 +62,7 @@ public class GridClientHandshakeRequestWrapper extends GridTcpCommunicationMessa
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, bytes))
+                if (!commState.putByteArray("bytes", bytes))
                     return false;
 
                 commState.idx++;
@@ -78,12 +78,12 @@ public class GridClientHandshakeRequestWrapper extends GridTcpCommunicationMessa
 
         switch (commState.idx) {
             case 0:
-//                byte[] bytes0 = commState.getByteArray(null, GridClientHandshakeRequest.PACKET_SIZE);
-//
-//                if (bytes0 == BYTE_ARR_NOT_READ)
-//                    return false;
-//
-//                bytes = bytes0;
+                byte[] bytes0 = commState.getByteArray("bytes");
+
+                if (bytes0 == BYTE_ARR_NOT_READ)
+                    return false;
+
+                bytes = bytes0;
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java
index c77964b..bf3ee7c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientHandshakeResponseWrapper.java
@@ -49,6 +49,15 @@ public class GridClientHandshakeResponseWrapper extends GridTcpCommunicationMess
             commState.typeWritten = true;
         }
 
+        switch (commState.idx) {
+            case 0:
+                if (!commState.putByte("code", code))
+                    return false;
+
+                commState.idx++;
+
+        }
+
         return true;
     }
 
@@ -56,6 +65,17 @@ public class GridClientHandshakeResponseWrapper extends GridTcpCommunicationMess
     @Override public boolean readFrom(ByteBuffer buf) {
         commState.setBuffer(buf);
 
+        switch (commState.idx) {
+            case 0:
+                if (buf.remaining() < 1)
+                    return false;
+
+                code = commState.getByte("code");
+
+                commState.idx++;
+
+        }
+
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java
index 4779afb..128c657 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientMessageWrapper.java
@@ -133,32 +133,32 @@ public class GridClientMessageWrapper extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putInt(null, msgSize))
+                if (!commState.putUuid("clientId", clientId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putLong(null, reqId))
+                if (!commState.putUuid("destId", destId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putUuid(null, clientId))
+                if (!commState.putByteBuffer("msg", msg))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putUuid(null, destId))
+                if (!commState.putInt("msgSize", msgSize))
                     return false;
 
                 commState.idx++;
 
             case 4:
-//                if (!commState.putByteBuffer(null, msg))
-//                    return false;
+                if (!commState.putLong("reqId", reqId))
+                    return false;
 
                 commState.idx++;
 
@@ -173,53 +173,51 @@ public class GridClientMessageWrapper extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                if (buf.remaining() < 4)
-                    return false;
+                UUID clientId0 = commState.getUuid("clientId");
 
-                msgSize = commState.getInt(null);
+                if (clientId0 == UUID_NOT_READ)
+                    return false;
 
-                if (msgSize == 0) // Ping message.
-                    return true;
+                clientId = clientId0;
 
                 commState.idx++;
 
             case 1:
-                if (buf.remaining() < 8)
+                UUID destId0 = commState.getUuid("destId");
+
+                if (destId0 == UUID_NOT_READ)
                     return false;
 
-                reqId = commState.getLong(null);
+                destId = destId0;
 
                 commState.idx++;
 
             case 2:
-                UUID clientId0 = commState.getUuid(null);
+                ByteBuffer msg0 = commState.getByteBuffer("msg");
 
-                if (clientId0 == UUID_NOT_READ)
+                if (msg0 == BYTE_BUF_NOT_READ)
                     return false;
 
-                clientId = clientId0;
+                msg = msg0;
 
                 commState.idx++;
 
             case 3:
-                UUID destId0 = commState.getUuid(null);
-
-                if (destId0 == UUID_NOT_READ)
+                if (buf.remaining() < 4)
                     return false;
 
-                destId = destId0;
+                msgSize = commState.getInt("msgSize");
 
                 commState.idx++;
 
             case 4:
-//                byte[] msg0 = commState.getByteArray(null, msgSize - 40);
-//
-//                if (msg0 == BYTE_ARR_NOT_READ)
-//                    return false;
-//
-//                msg = ByteBuffer.wrap(msg0);
-//
-//                commState.idx++;
+                if (buf.remaining() < 8)
+                    return false;
+
+                reqId = commState.getLong("reqId");
+
+                commState.idx++;
+
         }
 
         return true;
@@ -244,8 +242,8 @@ public class GridClientMessageWrapper extends GridTcpCommunicationMessageAdapter
     @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
         GridClientMessageWrapper _clone = (GridClientMessageWrapper)_msg;
 
-        _clone.reqId = reqId;
         _clone.msgSize = msgSize;
+        _clone.reqId = reqId;
         _clone.clientId = clientId;
         _clone.destId = destId;
         _clone.msg = msg;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java
index b719531..ea1da3d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/client/message/GridClientPingPacketWrapper.java
@@ -37,7 +37,7 @@ public class GridClientPingPacketWrapper extends GridTcpCommunicationMessageAdap
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putInt(null, size))
+                if (!commState.putInt("size", size))
                     return false;
 
                 commState.idx++;
@@ -49,7 +49,20 @@ public class GridClientPingPacketWrapper extends GridTcpCommunicationMessageAdap
 
     /** {@inheritDoc} */
     @Override public boolean readFrom(ByteBuffer buf) {
-        throw new UnsupportedOperationException();
+        commState.setBuffer(buf);
+
+        switch (commState.idx) {
+            case 0:
+                if (buf.remaining() < 4)
+                    return false;
+
+                size = commState.getInt("size");
+
+                commState.idx++;
+
+        }
+
+        return true;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java
index 2b66ef6..1894d03 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultRequest.java
@@ -123,13 +123,13 @@ public class GridTaskResultRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, taskId))
+                if (!commState.putGridUuid("taskId", taskId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putByteArray(null, topicBytes))
+                if (!commState.putByteArray("topicBytes", topicBytes))
                     return false;
 
                 commState.idx++;
@@ -146,7 +146,7 @@ public class GridTaskResultRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid taskId0 = commState.getGridUuid(null);
+                IgniteUuid taskId0 = commState.getGridUuid("taskId");
 
                 if (taskId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -156,7 +156,7 @@ public class GridTaskResultRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                byte[] topicBytes0 = commState.getByteArray(null);
+                byte[] topicBytes0 = commState.getByteArray("topicBytes");
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java
index ad9e42f..6d30432 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/task/GridTaskResultResponse.java
@@ -143,25 +143,25 @@ public class GridTaskResultResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putString(null, err))
+                if (!commState.putString("err", err))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(null, finished))
+                if (!commState.putBoolean("finished", finished))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(null, found))
+                if (!commState.putBoolean("found", found))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putByteArray(null, resBytes))
+                if (!commState.putByteArray("resBytes", resBytes))
                     return false;
 
                 commState.idx++;
@@ -178,7 +178,7 @@ public class GridTaskResultResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                String err0 = commState.getString(null);
+                String err0 = commState.getString("err");
 
                 if (err0 == STR_NOT_READ)
                     return false;
@@ -191,7 +191,7 @@ public class GridTaskResultResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                finished = commState.getBoolean(null);
+                finished = commState.getBoolean("finished");
 
                 commState.idx++;
 
@@ -199,12 +199,12 @@ public class GridTaskResultResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                found = commState.getBoolean(null);
+                found = commState.getBoolean("found");
 
                 commState.idx++;
 
             case 3:
-                byte[] resBytes0 = commState.getByteArray(null);
+                byte[] resBytes0 = commState.getByteArray("resBytes");
 
                 if (resBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java
index 077aa93..4aebe54 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/protocols/tcp/GridMemcachedMessageWrapper.java
@@ -66,7 +66,7 @@ public class GridMemcachedMessageWrapper extends GridTcpCommunicationMessageAdap
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, bytes))
+                if (!commState.putByteArray("bytes", bytes))
                     return false;
 
                 commState.idx++;
@@ -78,7 +78,22 @@ public class GridMemcachedMessageWrapper extends GridTcpCommunicationMessageAdap
 
     /** {@inheritDoc} */
     @Override public boolean readFrom(ByteBuffer buf) {
-        throw new UnsupportedOperationException();
+        commState.setBuffer(buf);
+
+        switch (commState.idx) {
+            case 0:
+                byte[] bytes0 = commState.getByteArray("bytes");
+
+                if (bytes0 == BYTE_ARR_NOT_READ)
+                    return false;
+
+                bytes = bytes0;
+
+                commState.idx++;
+
+        }
+
+        return true;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java
index cc56dc8..358b7a4 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerCancelRequest.java
@@ -77,7 +77,7 @@ public class GridStreamerCancelRequest extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(null, cancelledFutId))
+                if (!commState.putGridUuid("cancelledFutId", cancelledFutId))
                     return false;
 
                 commState.idx++;
@@ -94,7 +94,7 @@ public class GridStreamerCancelRequest extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid cancelledFutId0 = commState.getGridUuid(null);
+                IgniteUuid cancelledFutId0 = commState.getGridUuid("cancelledFutId");
 
                 if (cancelledFutId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java
index 39c8cf2..be546c6 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerExecutionRequest.java
@@ -178,25 +178,25 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, batchBytes))
+                if (!commState.putByteArray("batchBytes", batchBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, clsLdrId))
+                if (!commState.putGridUuid("clsLdrId", clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putEnum(null, depMode))
+                if (!commState.putEnum("depMode", depMode))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putBoolean(null, forceLocDep))
+                if (!commState.putBoolean("forceLocDep", forceLocDep))
                     return false;
 
                 commState.idx++;
@@ -240,13 +240,13 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 commState.idx++;
 
             case 5:
-                if (!commState.putString(null, sampleClsName))
+                if (!commState.putString("sampleClsName", sampleClsName))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putString(null, userVer))
+                if (!commState.putString("userVer", userVer))
                     return false;
 
                 commState.idx++;
@@ -263,7 +263,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
 
         switch (commState.idx) {
             case 0:
-                byte[] batchBytes0 = commState.getByteArray(null);
+                byte[] batchBytes0 = commState.getByteArray("batchBytes");
 
                 if (batchBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -273,7 +273,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 commState.idx++;
 
             case 1:
-                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
+                IgniteUuid clsLdrId0 = commState.getGridUuid("clsLdrId");
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -286,7 +286,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte(null);
+                byte depMode0 = commState.getByte("depMode");
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -296,7 +296,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 if (buf.remaining() < 1)
                     return false;
 
-                forceLocDep = commState.getBoolean(null);
+                forceLocDep = commState.getBoolean("forceLocDep");
 
                 commState.idx++;
 
@@ -310,7 +310,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
 
                 if (commState.readSize >= 0) {
                     if (ldrParticipants == null)
-                        ldrParticipants = U.newHashMap(commState.readSize);
+                        ldrParticipants = new HashMap<>(commState.readSize, 1.0f);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
@@ -343,7 +343,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 commState.idx++;
 
             case 5:
-                String sampleClsName0 = commState.getString(null);
+                String sampleClsName0 = commState.getString("sampleClsName");
 
                 if (sampleClsName0 == STR_NOT_READ)
                     return false;
@@ -353,7 +353,7 @@ public class GridStreamerExecutionRequest extends GridTcpCommunicationMessageAda
                 commState.idx++;
 
             case 6:
-                String userVer0 = commState.getString(null);
+                String userVer0 = commState.getString("userVer");
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java
index fc3cfcb..bfaeb09 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/streamer/GridStreamerResponse.java
@@ -98,13 +98,13 @@ public class GridStreamerResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
@@ -121,7 +121,7 @@ public class GridStreamerResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -131,7 +131,7 @@ public class GridStreamerResponse extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
index 0a3f856..1fa6a8d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
@@ -265,6 +265,9 @@ public class GridTcpCommunicationMessageState {
 
             writer.writeByteArray(name, arr);
 
+            if (arr == null)
+                return true;
+
             hdrDone = true;
         }
         else
@@ -311,6 +314,9 @@ public class GridTcpCommunicationMessageState {
 
             writer.writeShortArray(name, arr);
 
+            if (arr == null)
+                return true;
+
             hdrDone = true;
         }
         else
@@ -357,6 +363,9 @@ public class GridTcpCommunicationMessageState {
 
             writer.writeIntArray(name, arr);
 
+            if (arr == null)
+                return true;
+
             hdrDone = true;
         }
         else
@@ -403,6 +412,9 @@ public class GridTcpCommunicationMessageState {
 
             writer.writeLongArray(name, arr);
 
+            if (arr == null)
+                return true;
+
             hdrDone = true;
         }
         else
@@ -449,6 +461,9 @@ public class GridTcpCommunicationMessageState {
 
             writer.writeFloatArray(name, arr);
 
+            if (arr == null)
+                return true;
+
             hdrDone = true;
         }
         else
@@ -495,6 +510,9 @@ public class GridTcpCommunicationMessageState {
 
             writer.writeDoubleArray(name, arr);
 
+            if (arr == null)
+                return true;
+
             hdrDone = true;
         }
         else
@@ -541,6 +559,9 @@ public class GridTcpCommunicationMessageState {
 
             writer.writeCharArray(name, arr);
 
+            if (arr == null)
+                return true;
+
             hdrDone = true;
         }
         else
@@ -587,6 +608,9 @@ public class GridTcpCommunicationMessageState {
 
             writer.writeBooleanArray(name, arr);
 
+            if (arr == null)
+                return true;
+
             hdrDone = true;
         }
         else
@@ -1055,6 +1079,9 @@ public class GridTcpCommunicationMessageState {
 
             writer.writeObject(name, msg);
 
+            if (msg == null)
+                return true;
+
             hdrDone = true;
         }
         else


[11/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
IGNITE-61 - Portable format in direct marshalling


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

Branch: refs/heads/ignite-61
Commit: 1767ba5e69648c3e5d471a73b66b0bf172f28a6f
Parents: 5ed5176
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Fri Dec 19 14:56:59 2014 +0300
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Fri Dec 19 14:56:59 2014 +0300

----------------------------------------------------------------------
 .../jobstealing/JobStealingRequest.java         |  2 +-
 .../GridTcpCommunicationMessageState.java       | 30 ++++++++++++++++----
 2 files changed, 26 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1767ba5e/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
index 1b3a91e..73450e0 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
@@ -69,7 +69,7 @@ public class JobStealingRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.writeType(directType()))
+            if (!commState.writeByte(directType()))
                 return false;
 
             commState.typeWritten = true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1767ba5e/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
index 5a3e74d..1357627 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
@@ -78,19 +78,39 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
-     * @param type Message type.
-     * @return Whether message type was written.
+     * @param val Byte value.
+     * @return Whether value was written.
+     */
+    public final boolean writeByte(byte val) {
+        if (stream.remaining() < 1)
+            return false;
+
+        stream.writeByte(val);
+
+        return true;
+    }
+
+    /**
+     * @param val Int value.
+     * @return Whether value was written.
      */
-    public final boolean writeType(byte type) {
-        if (stream.remaining() == 0)
+    public final boolean writeInt(int val) {
+        if (stream.remaining() < 4)
             return false;
 
-        stream.writeByte(type);
+        stream.writeInt(val);
 
         return true;
     }
 
     /**
+     * @return Int value.
+     */
+    public final int readInt() {
+        return stream.readInt();
+    }
+
+    /**
      * @param name Field name.
      * @param b Byte value.
      * @return Whether value was written.


[15/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
IGNITE-61 - Portable format in direct marshalling


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

Branch: refs/heads/ignite-61
Commit: d0ecc3fd21cd2ac07595c78140932f6044ad7d0d
Parents: 4abbc39
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Fri Dec 19 19:16:51 2014 +0300
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Fri Dec 19 19:16:51 2014 +0300

----------------------------------------------------------------------
 .../grid/util/direct/GridTcpCommunicationMessageState.java     | 2 +-
 .../grid/util/direct/GridTcpCommunicationPortableStream.java   | 6 +-----
 2 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d0ecc3fd/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
index c2d8b14..0a3f856 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
@@ -74,7 +74,7 @@ public class GridTcpCommunicationMessageState {
      * @param buf Buffer.
      */
     public final void setBuffer(ByteBuffer buf) {
-        assert buf != null;
+        stream.setBuffer(buf);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d0ecc3fd/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableStream.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableStream.java
index c87837f..3ec27df 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableStream.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableStream.java
@@ -249,11 +249,7 @@ public class GridTcpCommunicationPortableStream implements GridPortableOutputStr
      * @return Whether last object was fully written.
      */
     public boolean lastWritten() {
-        boolean lastWritten0 = lastWritten;
-
-        lastWritten = false;
-
-        return lastWritten0;
+        return lastWritten;
     }
 
     /**


[14/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
IGNITE-61 - Portable format in direct marshalling


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

Branch: refs/heads/ignite-61
Commit: 4abbc39c04c66ff6ad88035ba787b9e496d28275
Parents: eb7eb8d
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Fri Dec 19 17:27:46 2014 +0300
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Fri Dec 19 17:27:46 2014 +0300

----------------------------------------------------------------------
 .../jobstealing/JobStealingRequest.java         |  8 ++---
 .../GridTcpCommunicationMessageAdapter.java     |  3 ++
 .../GridTcpCommunicationMessageState.java       | 38 ++++++++++++++++++++
 3 files changed, 45 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4abbc39c/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
index 73450e0..0c4e968 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
@@ -69,10 +69,10 @@ public class JobStealingRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.writeByte(directType()))
-                return false;
-
-            commState.typeWritten = true;
+//            if (!commState.writeByte(directType()))
+//                return false;
+//
+//            commState.typeWritten = true;
         }
 
         switch (commState.idx) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4abbc39c/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
index d08caea..7f5d97c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
@@ -56,6 +56,9 @@ public abstract class GridTcpCommunicationMessageAdapter implements Serializable
     public static final UUID UUID_NOT_READ = new UUID(0, 0);
 
     /** */
+    public static final ByteBuffer BYTE_BUF_NOT_READ = ByteBuffer.allocate(0);
+
+    /** */
     public static final IgniteUuid GRID_UUID_NOT_READ = new IgniteUuid(new UUID(0, 0), 0);
 
     /** */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4abbc39c/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
index ee60070..c2d8b14 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
@@ -623,6 +623,44 @@ public class GridTcpCommunicationMessageState {
 
     /**
      * @param name Field name.
+     * @param buf Buffer.
+     * @return Whether value was fully written.
+     */
+    public final boolean putByteBuffer(String name, @Nullable ByteBuffer buf) {
+        byte[] arr = null;
+
+        if (buf != null) {
+            ByteBuffer buf0 = buf.duplicate();
+
+            buf0.flip();
+
+            arr = new byte[buf0.remaining()];
+
+            buf0.get(arr);
+        }
+
+        return putByteArray(name, arr);
+    }
+
+    /**
+     * @param name Field name.
+     * @return {@link ByteBuffer} or special
+     *      {@link GridTcpCommunicationMessageAdapter#BYTE_BUF_NOT_READ}
+     *      value if it was not fully read.
+     */
+    public final ByteBuffer getByteBuffer(String name) {
+        byte[] arr = getByteArray(name);
+
+        if (arr == BYTE_ARR_NOT_READ)
+            return BYTE_BUF_NOT_READ;
+        else if (arr == null)
+            return null;
+        else
+            return ByteBuffer.wrap(arr);
+    }
+
+    /**
+     * @param name Field name.
      * @param uuid {@link UUID}.
      * @return Whether value was fully written.
      */


[13/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
IGNITE-61 - Portable format in direct marshalling


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

Branch: refs/heads/ignite-61
Commit: eb7eb8d0ff8385502784ea43b08ac9dcf21046c3
Parents: 469f365
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Fri Dec 19 16:38:44 2014 +0300
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Fri Dec 19 16:38:44 2014 +0300

----------------------------------------------------------------------
 .../GridTcpCommunicationMessageState.java       | 33 --------------------
 1 file changed, 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/eb7eb8d0/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
index 1357627..ee60070 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
@@ -78,39 +78,6 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
-     * @param val Byte value.
-     * @return Whether value was written.
-     */
-    public final boolean writeByte(byte val) {
-        if (stream.remaining() < 1)
-            return false;
-
-        stream.writeByte(val);
-
-        return true;
-    }
-
-    /**
-     * @param val Int value.
-     * @return Whether value was written.
-     */
-    public final boolean writeInt(int val) {
-        if (stream.remaining() < 4)
-            return false;
-
-        stream.writeInt(val);
-
-        return true;
-    }
-
-    /**
-     * @return Int value.
-     */
-    public final int readInt() {
-        return stream.readInt();
-    }
-
-    /**
      * @param name Field name.
      * @param b Byte value.
      * @return Whether value was written.


[09/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
IGNITE-61 - Portable format in direct marshalling


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

Branch: refs/heads/ignite-61
Commit: ac71f06cba36cae91275bd677c4dff4df692fa89
Parents: 55fb126
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Dec 18 17:03:01 2014 +0300
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Dec 18 17:03:01 2014 +0300

----------------------------------------------------------------------
 .../direct/GridPortableByteBufferStream.java    | 726 -------------------
 .../GridTcpCommunicationMessageAdapter.java     |  11 -
 .../GridTcpCommunicationMessageState.java       |  10 +-
 .../GridTcpCommunicationPortableReader.java     | 207 ++++++
 .../GridTcpCommunicationPortableStream.java     | 726 +++++++++++++++++++
 .../GridTcpCommunicationPortableWriter.java     | 223 ++++++
 6 files changed, 1161 insertions(+), 742 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac71f06c/modules/core/src/main/java/org/gridgain/grid/util/direct/GridPortableByteBufferStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridPortableByteBufferStream.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridPortableByteBufferStream.java
deleted file mode 100644
index 4433cbf..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridPortableByteBufferStream.java
+++ /dev/null
@@ -1,726 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.util.direct;
-
-import org.gridgain.grid.kernal.processors.portable.*;
-import org.gridgain.grid.util.*;
-import sun.misc.*;
-import sun.nio.ch.*;
-
-import java.nio.*;
-
-import static org.gridgain.grid.util.direct.GridTcpCommunicationMessageAdapter.*;
-
-/**
- * Portable stream based on {@link ByteBuffer}.
- */
-public class GridPortableByteBufferStream implements GridPortableOutputStream, GridPortableInputStream {
-    /** */
-    private static final Unsafe UNSAFE = GridUnsafe.unsafe();
-
-    /** */
-    private static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
-
-    /** */
-    private static final long SHORT_ARR_OFF = UNSAFE.arrayBaseOffset(short[].class);
-
-    /** */
-    private static final long INT_ARR_OFF = UNSAFE.arrayBaseOffset(int[].class);
-
-    /** */
-    private static final long LONG_ARR_OFF = UNSAFE.arrayBaseOffset(long[].class);
-
-    /** */
-    private static final long FLOAT_ARR_OFF = UNSAFE.arrayBaseOffset(float[].class);
-
-    /** */
-    private static final long DOUBLE_ARR_OFF = UNSAFE.arrayBaseOffset(double[].class);
-
-    /** */
-    private static final long CHAR_ARR_OFF = UNSAFE.arrayBaseOffset(char[].class);
-
-    /** */
-    private static final long BOOLEAN_ARR_OFF = UNSAFE.arrayBaseOffset(boolean[].class);
-
-    /** */
-    private static final byte[] BYTE_ARR_EMPTY = new byte[0];
-
-    /** */
-    private static final short[] SHORT_ARR_EMPTY = new short[0];
-
-    /** */
-    private static final int[] INT_ARR_EMPTY = new int[0];
-
-    /** */
-    private static final long[] LONG_ARR_EMPTY = new long[0];
-
-    /** */
-    private static final float[] FLOAT_ARR_EMPTY = new float[0];
-
-    /** */
-    private static final double[] DOUBLE_ARR_EMPTY = new double[0];
-
-    /** */
-    private static final char[] CHAR_ARR_EMPTY = new char[0];
-
-    /** */
-    private static final boolean[] BOOLEAN_ARR_EMPTY = new boolean[0];
-
-    /** */
-    private static final ArrayCreator<byte[]> BYTE_ARR_CREATOR = new ArrayCreator<byte[]>() {
-        @Override public byte[] create(int len) {
-            switch (len) {
-                case -1:
-                    return BYTE_ARR_NOT_READ;
-
-                case 0:
-                    return BYTE_ARR_EMPTY;
-
-                default:
-                    return new byte[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<short[]> SHORT_ARR_CREATOR = new ArrayCreator<short[]>() {
-        @Override public short[] create(int len) {
-            switch (len) {
-                case -1:
-                    return SHORT_ARR_NOT_READ;
-
-                case 0:
-                    return SHORT_ARR_EMPTY;
-
-                default:
-                    return new short[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<int[]> INT_ARR_CREATOR = new ArrayCreator<int[]>() {
-        @Override public int[] create(int len) {
-            switch (len) {
-                case -1:
-                    return INT_ARR_NOT_READ;
-
-                case 0:
-                    return INT_ARR_EMPTY;
-
-                default:
-                    return new int[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<long[]> LONG_ARR_CREATOR = new ArrayCreator<long[]>() {
-        @Override public long[] create(int len) {
-            switch (len) {
-                case -1:
-                    return LONG_ARR_NOT_READ;
-
-                case 0:
-                    return LONG_ARR_EMPTY;
-
-                default:
-                    return new long[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<float[]> FLOAT_ARR_CREATOR = new ArrayCreator<float[]>() {
-        @Override public float[] create(int len) {
-            switch (len) {
-                case -1:
-                    return FLOAT_ARR_NOT_READ;
-
-                case 0:
-                    return FLOAT_ARR_EMPTY;
-
-                default:
-                    return new float[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<double[]> DOUBLE_ARR_CREATOR = new ArrayCreator<double[]>() {
-        @Override public double[] create(int len) {
-            switch (len) {
-                case -1:
-                    return DOUBLE_ARR_NOT_READ;
-
-                case 0:
-                    return DOUBLE_ARR_EMPTY;
-
-                default:
-                    return new double[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<char[]> CHAR_ARR_CREATOR = new ArrayCreator<char[]>() {
-        @Override public char[] create(int len) {
-            switch (len) {
-                case -1:
-                    return CHAR_ARR_NOT_READ;
-
-                case 0:
-                    return CHAR_ARR_EMPTY;
-
-                default:
-                    return new char[len];
-            }
-        }
-    };
-
-    /** */
-    private static final ArrayCreator<boolean[]> BOOLEAN_ARR_CREATOR = new ArrayCreator<boolean[]>() {
-        @Override public boolean[] create(int len) {
-            switch (len) {
-                case -1:
-                    return BOOLEAN_ARR_NOT_READ;
-
-                case 0:
-                    return BOOLEAN_ARR_EMPTY;
-
-                default:
-                    return new boolean[len];
-            }
-        }
-    };
-
-    /** */
-    private ByteBuffer buf;
-
-    /** */
-    private byte[] heapArr;
-
-    /** */
-    private long baseOff;
-
-    /** */
-    private int arrOff;
-
-    /** */
-    private Object tmpArr;
-
-    /** */
-    private int tmpArrOff;
-
-    /** */
-    private int tmpArrBytes;
-
-    /** */
-    private boolean msgTypeDone;
-
-    /** */
-    private GridTcpCommunicationMessageAdapter msg;
-
-    /** */
-    private boolean lastWritten;
-
-    /**
-     * @param buf Buffer.
-     */
-    public final void setBuffer(ByteBuffer buf) {
-        assert buf != null;
-
-        if (this.buf != buf) {
-            this.buf = buf;
-
-            heapArr = buf.isDirect() ? null : buf.array();
-            baseOff = buf.isDirect() ? ((DirectBuffer)buf).address() : BYTE_ARR_OFF;
-        }
-    }
-
-    /**
-     * @return Whether last object was fully written.
-     */
-    public boolean lastWritten() {
-        boolean lastWritten0 = lastWritten;
-
-        lastWritten = false;
-
-        return lastWritten0;
-    }
-
-    /**
-     * @param msg Message.
-     */
-    public void writeMessage(GridTcpCommunicationMessageAdapter msg) {
-        assert msg != null;
-
-        lastWritten = msg.writeTo(buf);
-    }
-
-    /**
-     * @return Message.
-     */
-    public GridTcpCommunicationMessageAdapter readMessage() {
-        if (!msgTypeDone) {
-            if (!buf.hasRemaining())
-                return MSG_NOT_READ;
-
-            byte type = readByte();
-
-            msg = GridTcpCommunicationMessageFactory.create(type);
-
-            msgTypeDone = true;
-        }
-
-        if (msg.readFrom(buf)) {
-            GridTcpCommunicationMessageAdapter msg0 = msg;
-
-            msgTypeDone = false;
-            msg = null;
-
-            return msg0;
-        }
-        else
-            return MSG_NOT_READ;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeByte(byte val) {
-        int pos = buf.position();
-
-        UNSAFE.putByte(heapArr, baseOff + pos, val);
-
-        buf.position(pos + 1);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeByteArray(byte[] val) {
-        assert val != null;
-
-        lastWritten = writeArray(val, BYTE_ARR_OFF, val.length);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeBoolean(boolean val) {
-        int pos = buf.position();
-
-        UNSAFE.putBoolean(heapArr, baseOff + pos, val);
-
-        buf.position(pos + 1);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeBooleanArray(boolean[] val) {
-        assert val != null;
-
-        lastWritten = writeArray(val, BOOLEAN_ARR_OFF, val.length);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeShort(short val) {
-        int pos = buf.position();
-
-        UNSAFE.putShort(heapArr, baseOff + pos, val);
-
-        buf.position(pos + 2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeShortArray(short[] val) {
-        assert val != null;
-
-        lastWritten = writeArray(val, SHORT_ARR_OFF, val.length << 1);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeChar(char val) {
-        int pos = buf.position();
-
-        UNSAFE.putChar(heapArr, baseOff + pos, val);
-
-        buf.position(pos + 2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeCharArray(char[] val) {
-        assert val != null;
-
-        lastWritten = writeArray(val, CHAR_ARR_OFF, val.length << 1);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeInt(int val) {
-        int pos = buf.position();
-
-        UNSAFE.putInt(heapArr, baseOff + pos, val);
-
-        buf.position(pos + 4);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeInt(int pos, int val) {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeIntArray(int[] val) {
-        assert val != null;
-
-        lastWritten = writeArray(val, INT_ARR_OFF, val.length << 2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeFloat(float val) {
-        int pos = buf.position();
-
-        UNSAFE.putFloat(heapArr, baseOff + pos, val);
-
-        buf.position(pos + 4);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeFloatArray(float[] val) {
-        assert val != null;
-
-        lastWritten = writeArray(val, FLOAT_ARR_OFF, val.length << 2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeLong(long val) {
-        int pos = buf.position();
-
-        UNSAFE.putLong(heapArr, baseOff + pos, val);
-
-        buf.position(pos + 8);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeLongArray(long[] val) {
-        assert val != null;
-
-        lastWritten = writeArray(val, LONG_ARR_OFF, val.length << 3);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeDouble(double val) {
-        int pos = buf.position();
-
-        UNSAFE.putDouble(heapArr, baseOff + pos, val);
-
-        buf.position(pos + 8);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeDoubleArray(double[] val) {
-        assert val != null;
-
-        lastWritten = writeArray(val, DOUBLE_ARR_OFF, val.length << 3);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void write(byte[] arr, int off, int len) {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void write(long addr, int cnt) {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte readByte() {
-        assert buf.hasRemaining();
-
-        int pos = buf.position();
-
-        buf.position(pos + 1);
-
-        return UNSAFE.getByte(heapArr, baseOff + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] readByteArray(int cnt) {
-        return readArray(BYTE_ARR_CREATOR, cnt, 0, BYTE_ARR_OFF);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean readBoolean() {
-        assert buf.hasRemaining();
-
-        int pos = buf.position();
-
-        buf.position(pos + 1);
-
-        return UNSAFE.getBoolean(heapArr, baseOff + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean[] readBooleanArray(int cnt) {
-        return readArray(BOOLEAN_ARR_CREATOR, cnt, 0, BOOLEAN_ARR_OFF);
-    }
-
-    /** {@inheritDoc} */
-    @Override public short readShort() {
-        assert buf.remaining() >= 2;
-
-        int pos = buf.position();
-
-        buf.position(pos + 2);
-
-        return UNSAFE.getShort(heapArr, baseOff + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public short[] readShortArray(int cnt) {
-        return readArray(SHORT_ARR_CREATOR, cnt, 1, SHORT_ARR_OFF);
-    }
-
-    /** {@inheritDoc} */
-    @Override public char readChar() {
-        assert buf.remaining() >= 2;
-
-        int pos = buf.position();
-
-        buf.position(pos + 2);
-
-        return UNSAFE.getChar(heapArr, baseOff + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public char[] readCharArray(int cnt) {
-        return readArray(CHAR_ARR_CREATOR, cnt, 1, CHAR_ARR_OFF);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int readInt() {
-        assert buf.remaining() >= 4;
-
-        int pos = buf.position();
-
-        buf.position(pos + 4);
-
-        return UNSAFE.getInt(heapArr, baseOff + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int readInt(int pos) {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int[] readIntArray(int cnt) {
-        return readArray(INT_ARR_CREATOR, cnt, 2, INT_ARR_OFF);
-    }
-
-    /** {@inheritDoc} */
-    @Override public float readFloat() {
-        assert buf.remaining() >= 4;
-
-        int pos = buf.position();
-
-        buf.position(pos + 4);
-
-        return UNSAFE.getFloat(heapArr, baseOff + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public float[] readFloatArray(int cnt) {
-        return readArray(FLOAT_ARR_CREATOR, cnt, 2, FLOAT_ARR_OFF);
-    }
-
-    /** {@inheritDoc} */
-    @Override public long readLong() {
-        assert buf.remaining() >= 8;
-
-        int pos = buf.position();
-
-        buf.position(pos + 8);
-
-        return UNSAFE.getLong(heapArr, baseOff + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public long[] readLongArray(int cnt) {
-        return readArray(LONG_ARR_CREATOR, cnt, 3, LONG_ARR_OFF);
-    }
-
-    /** {@inheritDoc} */
-    @Override public double readDouble() {
-        assert buf.remaining() >= 8;
-
-        int pos = buf.position();
-
-        buf.position(pos + 8);
-
-        return UNSAFE.getDouble(heapArr, baseOff + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public double[] readDoubleArray(int cnt) {
-        return readArray(DOUBLE_ARR_CREATOR, cnt, 3, DOUBLE_ARR_OFF);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int read(byte[] arr, int off, int len) {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int read(long addr, int len) {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int position() {
-        return buf.position();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void position(int pos) {
-        buf.position(pos);
-    }
-
-    /** {@inheritDoc} */
-    public int remaining() {
-        return buf.remaining();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void close() {
-        // No-op.
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] array() {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] arrayCopy() {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long offheapPointer() {
-        throw new UnsupportedOperationException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasArray() {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param bytes Length in bytes.
-     * @return Whether array was fully written
-     */
-    private boolean writeArray(Object arr, long off, int bytes) {
-        assert arr != null;
-        assert arr.getClass().isArray() && arr.getClass().getComponentType().isPrimitive();
-        assert off > 0;
-        assert bytes >= 0;
-        assert bytes >= arrOff;
-
-        if (!buf.hasRemaining())
-            return false;
-
-        int toWrite = bytes - arrOff;
-        int pos = buf.position();
-        int remaining = buf.remaining();
-
-        if (toWrite <= remaining) {
-            UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, toWrite);
-
-            pos += toWrite;
-
-            buf.position(pos);
-
-            arrOff = 0;
-
-            return true;
-        }
-        else {
-            UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, remaining);
-
-            pos += remaining;
-
-            buf.position(pos);
-
-            arrOff += remaining;
-
-            return false;
-        }
-    }
-
-    /**
-     * @param creator Array creator.
-     * @param len Array Array length.
-     * @param lenShift Array length shift size.
-     * @param off Base offset.
-     * @return Array or special value if it was not fully read.
-     */
-    private <T> T readArray(ArrayCreator<T> creator, int len, int lenShift, long off) {
-        assert creator != null;
-
-        if (tmpArr == null) {
-            assert len >= 0;
-
-            switch (len) {
-                case 0:
-                    return creator.create(0);
-
-                default:
-                    tmpArr = creator.create(len);
-                    tmpArrBytes = len << lenShift;
-            }
-        }
-
-        int toRead = tmpArrBytes - tmpArrOff;
-        int remaining = buf.remaining();
-        int pos = buf.position();
-
-        if (remaining < toRead) {
-            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, remaining);
-
-            buf.position(pos + remaining);
-
-            tmpArrOff += remaining;
-
-            return creator.create(-1);
-        }
-        else {
-            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, toRead);
-
-            buf.position(pos + toRead);
-
-            T arr = (T)tmpArr;
-
-            tmpArr = null;
-            tmpArrBytes = 0;
-            tmpArrOff = 0;
-
-            return arr;
-        }
-    }
-
-    /**
-     * Array creator.
-     */
-    private static interface ArrayCreator<T> {
-        /**
-         * @param len Array length or {@code -1} if array was not fully read.
-         * @return New array.
-         */
-        public T create(int len);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac71f06c/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
index 8961688..d08caea 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageAdapter.java
@@ -85,9 +85,6 @@ public abstract class GridTcpCommunicationMessageAdapter implements Serializable
     public static final BitSet BIT_SET_NOT_READ = new BitSet();
 
     /** */
-    public static final Enum<?> ENUM_NOT_READ = DummyEnum.DUMMY;
-
-    /** */
     public static final GridTcpCommunicationMessageAdapter MSG_NOT_READ = new GridTcpCommunicationMessageAdapter() {
         @SuppressWarnings("CloneDoesntCallSuperClone")
         @Override public GridTcpCommunicationMessageAdapter clone() {
@@ -176,12 +173,4 @@ public abstract class GridTcpCommunicationMessageAdapter implements Serializable
             }
         };
     }
-
-    /**
-     * Dummy enum.
-     */
-    private enum DummyEnum {
-        /** */
-        DUMMY
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac71f06c/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
index a5df710..ee60070 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
@@ -35,16 +35,16 @@ public class GridTcpCommunicationMessageState {
     private static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
 
     /** */
-    private static final int FIELD_HDR_LEN = 9;
+    private static final int FIELD_HDR_LEN = 0;
 
     /** */
-    private final GridPortableByteBufferStream stream = new GridPortableByteBufferStream();
+    private final GridTcpCommunicationPortableStream stream = new GridTcpCommunicationPortableStream();
 
     /** */
-    private final PortableWriter writer = null;//new org.gridgain.grid.util.portable.GridPortableWriterImpl();
+    private final PortableWriter writer = new GridTcpCommunicationPortableWriter(stream);
 
     /** */
-    private final PortableReader reader = null;//new org.gridgain.grid.util.portable.GridPortableReaderImpl();
+    private final PortableReader reader = new GridTcpCommunicationPortableReader(stream);
 
     /** */
     private boolean hdrDone;
@@ -1012,7 +1012,7 @@ public class GridTcpCommunicationMessageState {
      */
     public final boolean putMessage(String name, @Nullable GridTcpCommunicationMessageAdapter msg) {
         if (!hdrDone) {
-            if (stream.remaining() < FIELD_HDR_LEN)
+            if (stream.remaining() < FIELD_HDR_LEN + 1)
                 return false;
 
             writer.writeObject(name, msg);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac71f06c/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableReader.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableReader.java
new file mode 100644
index 0000000..d4b6e2d
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableReader.java
@@ -0,0 +1,207 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.gridgain.grid.util.direct;
+
+import org.apache.ignite.portables.*;
+import org.jetbrains.annotations.*;
+
+import java.math.*;
+import java.sql.*;
+import java.util.*;
+import java.util.Date;
+
+/**
+ * Portable reader implementation.
+ */
+public class GridTcpCommunicationPortableReader implements PortableReader {
+    /** Stream. */
+    private final GridTcpCommunicationPortableStream stream;
+
+    /**
+     * @param stream Stream.
+     */
+    public GridTcpCommunicationPortableReader(GridTcpCommunicationPortableStream stream) {
+        this.stream = stream;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte readByte(String fieldName) throws PortableException {
+        return stream.readByte();
+    }
+
+    /** {@inheritDoc} */
+    @Override public short readShort(String fieldName) throws PortableException {
+        return stream.readShort();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int readInt(String fieldName) throws PortableException {
+        return stream.readInt();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long readLong(String fieldName) throws PortableException {
+        return stream.readLong();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float readFloat(String fieldName) throws PortableException {
+        return stream.readFloat();
+    }
+
+    /** {@inheritDoc} */
+    @Override public double readDouble(String fieldName) throws PortableException {
+        return stream.readDouble();
+    }
+
+    /** {@inheritDoc} */
+    @Override public char readChar(String fieldName) throws PortableException {
+        return stream.readChar();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean readBoolean(String fieldName) throws PortableException {
+        return stream.readBoolean();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public byte[] readByteArray(String fieldName) throws PortableException {
+        return stream.readByteArray(stream.readInt());
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public short[] readShortArray(String fieldName) throws PortableException {
+        return stream.readShortArray(stream.readInt());
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public int[] readIntArray(String fieldName) throws PortableException {
+        return stream.readIntArray(stream.readInt());
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public long[] readLongArray(String fieldName) throws PortableException {
+        return stream.readLongArray(stream.readInt());
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public float[] readFloatArray(String fieldName) throws PortableException {
+        return stream.readFloatArray(stream.readInt());
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public double[] readDoubleArray(String fieldName) throws PortableException {
+        return stream.readDoubleArray(stream.readInt());
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public char[] readCharArray(String fieldName) throws PortableException {
+        return stream.readCharArray(stream.readInt());
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public boolean[] readBooleanArray(String fieldName) throws PortableException {
+        return stream.readBooleanArray(stream.readInt());
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public <T> T readObject(String fieldName) throws PortableException {
+        return (T)stream.readMessage();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public BigDecimal readDecimal(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public String readString(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public UUID readUuid(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Date readDate(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Timestamp readTimestamp(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public BigDecimal[] readDecimalArray(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public String[] readStringArray(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public UUID[] readUuidArray(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Date[] readDateArray(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public Object[] readObjectArray(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public <T> Collection<T> readCollection(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public <T> Collection<T> readCollection(String fieldName, Class<? extends Collection<T>> colCls)
+        throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public <K, V> Map<K, V> readMap(String fieldName) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public <K, V> Map<K, V> readMap(String fieldName, Class<? extends Map<K, V>> mapCls)
+        throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public <T extends Enum<?>> T readEnum(String fieldName, Class<T> enumCls)
+        throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Nullable @Override public <T extends Enum<?>> T[] readEnumArray(String fieldName, Class<T> enumCls)
+        throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public PortableRawReader rawReader() {
+        throw new UnsupportedOperationException();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac71f06c/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableStream.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableStream.java
new file mode 100644
index 0000000..c87837f
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableStream.java
@@ -0,0 +1,726 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.gridgain.grid.util.direct;
+
+import org.gridgain.grid.kernal.processors.portable.*;
+import org.gridgain.grid.util.*;
+import sun.misc.*;
+import sun.nio.ch.*;
+
+import java.nio.*;
+
+import static org.gridgain.grid.util.direct.GridTcpCommunicationMessageAdapter.*;
+
+/**
+ * Portable stream based on {@link ByteBuffer}.
+ */
+public class GridTcpCommunicationPortableStream implements GridPortableOutputStream, GridPortableInputStream {
+    /** */
+    private static final Unsafe UNSAFE = GridUnsafe.unsafe();
+
+    /** */
+    private static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
+
+    /** */
+    private static final long SHORT_ARR_OFF = UNSAFE.arrayBaseOffset(short[].class);
+
+    /** */
+    private static final long INT_ARR_OFF = UNSAFE.arrayBaseOffset(int[].class);
+
+    /** */
+    private static final long LONG_ARR_OFF = UNSAFE.arrayBaseOffset(long[].class);
+
+    /** */
+    private static final long FLOAT_ARR_OFF = UNSAFE.arrayBaseOffset(float[].class);
+
+    /** */
+    private static final long DOUBLE_ARR_OFF = UNSAFE.arrayBaseOffset(double[].class);
+
+    /** */
+    private static final long CHAR_ARR_OFF = UNSAFE.arrayBaseOffset(char[].class);
+
+    /** */
+    private static final long BOOLEAN_ARR_OFF = UNSAFE.arrayBaseOffset(boolean[].class);
+
+    /** */
+    private static final byte[] BYTE_ARR_EMPTY = new byte[0];
+
+    /** */
+    private static final short[] SHORT_ARR_EMPTY = new short[0];
+
+    /** */
+    private static final int[] INT_ARR_EMPTY = new int[0];
+
+    /** */
+    private static final long[] LONG_ARR_EMPTY = new long[0];
+
+    /** */
+    private static final float[] FLOAT_ARR_EMPTY = new float[0];
+
+    /** */
+    private static final double[] DOUBLE_ARR_EMPTY = new double[0];
+
+    /** */
+    private static final char[] CHAR_ARR_EMPTY = new char[0];
+
+    /** */
+    private static final boolean[] BOOLEAN_ARR_EMPTY = new boolean[0];
+
+    /** */
+    private static final ArrayCreator<byte[]> BYTE_ARR_CREATOR = new ArrayCreator<byte[]>() {
+        @Override public byte[] create(int len) {
+            switch (len) {
+                case -1:
+                    return BYTE_ARR_NOT_READ;
+
+                case 0:
+                    return BYTE_ARR_EMPTY;
+
+                default:
+                    return new byte[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<short[]> SHORT_ARR_CREATOR = new ArrayCreator<short[]>() {
+        @Override public short[] create(int len) {
+            switch (len) {
+                case -1:
+                    return SHORT_ARR_NOT_READ;
+
+                case 0:
+                    return SHORT_ARR_EMPTY;
+
+                default:
+                    return new short[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<int[]> INT_ARR_CREATOR = new ArrayCreator<int[]>() {
+        @Override public int[] create(int len) {
+            switch (len) {
+                case -1:
+                    return INT_ARR_NOT_READ;
+
+                case 0:
+                    return INT_ARR_EMPTY;
+
+                default:
+                    return new int[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<long[]> LONG_ARR_CREATOR = new ArrayCreator<long[]>() {
+        @Override public long[] create(int len) {
+            switch (len) {
+                case -1:
+                    return LONG_ARR_NOT_READ;
+
+                case 0:
+                    return LONG_ARR_EMPTY;
+
+                default:
+                    return new long[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<float[]> FLOAT_ARR_CREATOR = new ArrayCreator<float[]>() {
+        @Override public float[] create(int len) {
+            switch (len) {
+                case -1:
+                    return FLOAT_ARR_NOT_READ;
+
+                case 0:
+                    return FLOAT_ARR_EMPTY;
+
+                default:
+                    return new float[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<double[]> DOUBLE_ARR_CREATOR = new ArrayCreator<double[]>() {
+        @Override public double[] create(int len) {
+            switch (len) {
+                case -1:
+                    return DOUBLE_ARR_NOT_READ;
+
+                case 0:
+                    return DOUBLE_ARR_EMPTY;
+
+                default:
+                    return new double[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<char[]> CHAR_ARR_CREATOR = new ArrayCreator<char[]>() {
+        @Override public char[] create(int len) {
+            switch (len) {
+                case -1:
+                    return CHAR_ARR_NOT_READ;
+
+                case 0:
+                    return CHAR_ARR_EMPTY;
+
+                default:
+                    return new char[len];
+            }
+        }
+    };
+
+    /** */
+    private static final ArrayCreator<boolean[]> BOOLEAN_ARR_CREATOR = new ArrayCreator<boolean[]>() {
+        @Override public boolean[] create(int len) {
+            switch (len) {
+                case -1:
+                    return BOOLEAN_ARR_NOT_READ;
+
+                case 0:
+                    return BOOLEAN_ARR_EMPTY;
+
+                default:
+                    return new boolean[len];
+            }
+        }
+    };
+
+    /** */
+    private ByteBuffer buf;
+
+    /** */
+    private byte[] heapArr;
+
+    /** */
+    private long baseOff;
+
+    /** */
+    private int arrOff;
+
+    /** */
+    private Object tmpArr;
+
+    /** */
+    private int tmpArrOff;
+
+    /** */
+    private int tmpArrBytes;
+
+    /** */
+    private boolean msgTypeDone;
+
+    /** */
+    private GridTcpCommunicationMessageAdapter msg;
+
+    /** */
+    private boolean lastWritten;
+
+    /**
+     * @param buf Buffer.
+     */
+    public final void setBuffer(ByteBuffer buf) {
+        assert buf != null;
+
+        if (this.buf != buf) {
+            this.buf = buf;
+
+            heapArr = buf.isDirect() ? null : buf.array();
+            baseOff = buf.isDirect() ? ((DirectBuffer)buf).address() : BYTE_ARR_OFF;
+        }
+    }
+
+    /**
+     * @return Whether last object was fully written.
+     */
+    public boolean lastWritten() {
+        boolean lastWritten0 = lastWritten;
+
+        lastWritten = false;
+
+        return lastWritten0;
+    }
+
+    /**
+     * @param msg Message.
+     */
+    public void writeMessage(GridTcpCommunicationMessageAdapter msg) {
+        assert msg != null;
+
+        lastWritten = msg.writeTo(buf);
+    }
+
+    /**
+     * @return Message.
+     */
+    public GridTcpCommunicationMessageAdapter readMessage() {
+        if (!msgTypeDone) {
+            assert buf.hasRemaining();
+
+            byte type = readByte();
+
+            msg = type == Byte.MIN_VALUE ? null : GridTcpCommunicationMessageFactory.create(type);
+
+            msgTypeDone = true;
+        }
+
+        if (msg == null || msg.readFrom(buf)) {
+            GridTcpCommunicationMessageAdapter msg0 = msg;
+
+            msgTypeDone = false;
+            msg = null;
+
+            return msg0;
+        }
+        else
+            return MSG_NOT_READ;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeByte(byte val) {
+        int pos = buf.position();
+
+        UNSAFE.putByte(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 1);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeByteArray(byte[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, BYTE_ARR_OFF, val.length);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBoolean(boolean val) {
+        int pos = buf.position();
+
+        UNSAFE.putBoolean(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 1);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBooleanArray(boolean[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, BOOLEAN_ARR_OFF, val.length);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeShort(short val) {
+        int pos = buf.position();
+
+        UNSAFE.putShort(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeShortArray(short[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, SHORT_ARR_OFF, val.length << 1);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeChar(char val) {
+        int pos = buf.position();
+
+        UNSAFE.putChar(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeCharArray(char[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, CHAR_ARR_OFF, val.length << 1);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeInt(int val) {
+        int pos = buf.position();
+
+        UNSAFE.putInt(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 4);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeInt(int pos, int val) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeIntArray(int[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, INT_ARR_OFF, val.length << 2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeFloat(float val) {
+        int pos = buf.position();
+
+        UNSAFE.putFloat(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 4);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeFloatArray(float[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, FLOAT_ARR_OFF, val.length << 2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeLong(long val) {
+        int pos = buf.position();
+
+        UNSAFE.putLong(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 8);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeLongArray(long[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, LONG_ARR_OFF, val.length << 3);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDouble(double val) {
+        int pos = buf.position();
+
+        UNSAFE.putDouble(heapArr, baseOff + pos, val);
+
+        buf.position(pos + 8);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDoubleArray(double[] val) {
+        assert val != null;
+
+        lastWritten = writeArray(val, DOUBLE_ARR_OFF, val.length << 3);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void write(byte[] arr, int off, int len) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void write(long addr, int cnt) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte readByte() {
+        assert buf.hasRemaining();
+
+        int pos = buf.position();
+
+        buf.position(pos + 1);
+
+        return UNSAFE.getByte(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] readByteArray(int cnt) {
+        return readArray(BYTE_ARR_CREATOR, cnt, 0, BYTE_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean readBoolean() {
+        assert buf.hasRemaining();
+
+        int pos = buf.position();
+
+        buf.position(pos + 1);
+
+        return UNSAFE.getBoolean(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean[] readBooleanArray(int cnt) {
+        return readArray(BOOLEAN_ARR_CREATOR, cnt, 0, BOOLEAN_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public short readShort() {
+        assert buf.remaining() >= 2;
+
+        int pos = buf.position();
+
+        buf.position(pos + 2);
+
+        return UNSAFE.getShort(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public short[] readShortArray(int cnt) {
+        return readArray(SHORT_ARR_CREATOR, cnt, 1, SHORT_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public char readChar() {
+        assert buf.remaining() >= 2;
+
+        int pos = buf.position();
+
+        buf.position(pos + 2);
+
+        return UNSAFE.getChar(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public char[] readCharArray(int cnt) {
+        return readArray(CHAR_ARR_CREATOR, cnt, 1, CHAR_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int readInt() {
+        assert buf.remaining() >= 4;
+
+        int pos = buf.position();
+
+        buf.position(pos + 4);
+
+        return UNSAFE.getInt(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int readInt(int pos) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int[] readIntArray(int cnt) {
+        return readArray(INT_ARR_CREATOR, cnt, 2, INT_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public float readFloat() {
+        assert buf.remaining() >= 4;
+
+        int pos = buf.position();
+
+        buf.position(pos + 4);
+
+        return UNSAFE.getFloat(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public float[] readFloatArray(int cnt) {
+        return readArray(FLOAT_ARR_CREATOR, cnt, 2, FLOAT_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public long readLong() {
+        assert buf.remaining() >= 8;
+
+        int pos = buf.position();
+
+        buf.position(pos + 8);
+
+        return UNSAFE.getLong(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public long[] readLongArray(int cnt) {
+        return readArray(LONG_ARR_CREATOR, cnt, 3, LONG_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public double readDouble() {
+        assert buf.remaining() >= 8;
+
+        int pos = buf.position();
+
+        buf.position(pos + 8);
+
+        return UNSAFE.getDouble(heapArr, baseOff + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public double[] readDoubleArray(int cnt) {
+        return readArray(DOUBLE_ARR_CREATOR, cnt, 3, DOUBLE_ARR_OFF);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int read(byte[] arr, int off, int len) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int read(long addr, int len) {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int position() {
+        return buf.position();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void position(int pos) {
+        buf.position(pos);
+    }
+
+    /** {@inheritDoc} */
+    public int remaining() {
+        return buf.remaining();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void close() {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] array() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] arrayCopy() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long offheapPointer() {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasArray() {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param bytes Length in bytes.
+     * @return Whether array was fully written
+     */
+    private boolean writeArray(Object arr, long off, int bytes) {
+        assert arr != null;
+        assert arr.getClass().isArray() && arr.getClass().getComponentType().isPrimitive();
+        assert off > 0;
+        assert bytes >= 0;
+        assert bytes >= arrOff;
+
+        if (!buf.hasRemaining())
+            return false;
+
+        int toWrite = bytes - arrOff;
+        int pos = buf.position();
+        int remaining = buf.remaining();
+
+        if (toWrite <= remaining) {
+            UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, toWrite);
+
+            pos += toWrite;
+
+            buf.position(pos);
+
+            arrOff = 0;
+
+            return true;
+        }
+        else {
+            UNSAFE.copyMemory(arr, off + arrOff, heapArr, baseOff + pos, remaining);
+
+            pos += remaining;
+
+            buf.position(pos);
+
+            arrOff += remaining;
+
+            return false;
+        }
+    }
+
+    /**
+     * @param creator Array creator.
+     * @param len Array Array length.
+     * @param lenShift Array length shift size.
+     * @param off Base offset.
+     * @return Array or special value if it was not fully read.
+     */
+    private <T> T readArray(ArrayCreator<T> creator, int len, int lenShift, long off) {
+        assert creator != null;
+
+        if (tmpArr == null) {
+            switch (len) {
+                case -1:
+                    return null;
+
+                case 0:
+                    return creator.create(0);
+
+                default:
+                    tmpArr = creator.create(len);
+                    tmpArrBytes = len << lenShift;
+            }
+        }
+
+        int toRead = tmpArrBytes - tmpArrOff;
+        int remaining = buf.remaining();
+        int pos = buf.position();
+
+        if (remaining < toRead) {
+            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, remaining);
+
+            buf.position(pos + remaining);
+
+            tmpArrOff += remaining;
+
+            return creator.create(-1);
+        }
+        else {
+            UNSAFE.copyMemory(heapArr, baseOff + pos, tmpArr, off + tmpArrOff, toRead);
+
+            buf.position(pos + toRead);
+
+            T arr = (T)tmpArr;
+
+            tmpArr = null;
+            tmpArrBytes = 0;
+            tmpArrOff = 0;
+
+            return arr;
+        }
+    }
+
+    /**
+     * Array creator.
+     */
+    private static interface ArrayCreator<T> {
+        /**
+         * @param len Array length or {@code -1} if array was not fully read.
+         * @return New array.
+         */
+        public T create(int len);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ac71f06c/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableWriter.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableWriter.java
new file mode 100644
index 0000000..7f7f971
--- /dev/null
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationPortableWriter.java
@@ -0,0 +1,223 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.gridgain.grid.util.direct;
+
+import org.apache.ignite.portables.*;
+import org.jetbrains.annotations.*;
+
+import java.math.*;
+import java.sql.*;
+import java.util.*;
+import java.util.Date;
+
+/**
+ * Portable writer implementation.
+ */
+public class GridTcpCommunicationPortableWriter implements PortableWriter {
+    /** Stream. */
+    private final GridTcpCommunicationPortableStream stream;
+
+    /**
+     * @param stream Stream.
+     */
+    public GridTcpCommunicationPortableWriter(GridTcpCommunicationPortableStream stream) {
+        this.stream = stream;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeByte(String fieldName, byte val) throws PortableException {
+        stream.writeByte(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeShort(String fieldName, short val) throws PortableException {
+        stream.writeShort(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeInt(String fieldName, int val) throws PortableException {
+        stream.writeInt(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeLong(String fieldName, long val) throws PortableException {
+        stream.writeLong(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeFloat(String fieldName, float val) throws PortableException {
+        stream.writeFloat(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDouble(String fieldName, double val) throws PortableException {
+        stream.writeDouble(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeChar(String fieldName, char val) throws PortableException {
+        stream.writeChar(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBoolean(String fieldName, boolean val) throws PortableException {
+        stream.writeBoolean(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeByteArray(String fieldName, @Nullable byte[] val) throws PortableException {
+        stream.writeInt(val != null ? val.length : -1);
+
+        if (val != null)
+            stream.writeByteArray(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeShortArray(String fieldName, @Nullable short[] val) throws PortableException {
+        stream.writeInt(val != null ? val.length : -1);
+
+        if (val != null)
+            stream.writeShortArray(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeIntArray(String fieldName, @Nullable int[] val) throws PortableException {
+        stream.writeInt(val != null ? val.length : -1);
+
+        if (val != null)
+            stream.writeIntArray(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeLongArray(String fieldName, @Nullable long[] val) throws PortableException {
+        stream.writeInt(val != null ? val.length : -1);
+
+        if (val != null)
+            stream.writeLongArray(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeFloatArray(String fieldName, @Nullable float[] val) throws PortableException {
+        stream.writeInt(val != null ? val.length : -1);
+
+        if (val != null)
+            stream.writeFloatArray(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDoubleArray(String fieldName, @Nullable double[] val) throws PortableException {
+        stream.writeInt(val != null ? val.length : -1);
+
+        if (val != null)
+            stream.writeDoubleArray(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeCharArray(String fieldName, @Nullable char[] val) throws PortableException {
+        stream.writeInt(val != null ? val.length : -1);
+
+        if (val != null)
+            stream.writeCharArray(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBooleanArray(String fieldName, @Nullable boolean[] val) throws PortableException {
+        stream.writeInt(val != null ? val.length : -1);
+
+        if (val != null)
+            stream.writeBooleanArray(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeObject(String fieldName, @Nullable Object obj) throws PortableException {
+        if (obj != null) {
+            assert obj instanceof GridTcpCommunicationMessageAdapter;
+
+            stream.writeMessage((GridTcpCommunicationMessageAdapter)obj);
+        }
+        else
+            stream.writeByte(Byte.MIN_VALUE);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDecimal(String fieldName, @Nullable BigDecimal val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeString(String fieldName, @Nullable String val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeUuid(String fieldName, @Nullable UUID val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDate(String fieldName, @Nullable Date val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTimestamp(String fieldName, @Nullable Timestamp val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDecimalArray(String fieldName, @Nullable BigDecimal[] val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeStringArray(String fieldName, @Nullable String[] val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeUuidArray(String fieldName, @Nullable UUID[] val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDateArray(String fieldName, @Nullable Date[] val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeObjectArray(String fieldName, @Nullable Object[] val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public <T> void writeCollection(String fieldName, @Nullable Collection<T> col) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public <K, V> void writeMap(String fieldName, @Nullable Map<K, V> map) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public <T extends Enum<?>> void writeEnum(String fieldName, T val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public <T extends Enum<?>> void writeEnumArray(String fieldName, T[] val) throws PortableException {
+        throw new UnsupportedOperationException();
+    }
+
+    /** {@inheritDoc} */
+    @Override public PortableRawWriter rawWriter() {
+        throw new UnsupportedOperationException();
+    }
+}


[08/20] incubator-ignite git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-61

Posted by vk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-61


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

Branch: refs/heads/ignite-61
Commit: 55fb12671a8ecbaaf380947a44dd780f85a89545
Parents: d21e6b4 0e3e622
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Dec 18 15:07:20 2014 +0300
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Dec 18 15:07:20 2014 +0300

----------------------------------------------------------------------
 pom.xml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[18/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java
index add0721..0a49f10 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -498,37 +498,37 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putByteArray(null, grpLockKeyBytes))
+                if (!commState.putByteArray("grpLockKeyBytes", grpLockKeyBytes))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putBoolean(null, isInTx))
+                if (!commState.putBoolean("isInTx", isInTx))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(null, isInvalidate))
+                if (!commState.putBoolean("isInvalidate", isInvalidate))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putBoolean(null, isRead))
+                if (!commState.putBoolean("isRead", isRead))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putEnum(null, isolation))
+                if (!commState.putEnum("isolation", isolation))
                     return false;
 
                 commState.idx++;
@@ -561,49 +561,49 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 16:
-                if (!commState.putCacheVersion(null, nearXidVer))
+                if (!commState.putCacheVersion("nearXidVer", nearXidVer))
                     return false;
 
                 commState.idx++;
 
             case 17:
-                if (!commState.putUuid(null, nodeId))
+                if (!commState.putUuid("nodeId", nodeId))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putBoolean(null, partLock))
+                if (!commState.putBoolean("partLock", partLock))
                     return false;
 
                 commState.idx++;
 
             case 19:
-                if (!commState.putBooleanArray(null, retVals))
+                if (!commState.putBooleanArray("retVals", retVals))
                     return false;
 
                 commState.idx++;
 
             case 20:
-                if (!commState.putLong(null, threadId))
+                if (!commState.putLong("threadId", threadId))
                     return false;
 
                 commState.idx++;
 
             case 21:
-                if (!commState.putLong(null, timeout))
+                if (!commState.putLong("timeout", timeout))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putInt(null, txSize))
+                if (!commState.putInt("txSize", txSize))
                     return false;
 
                 commState.idx++;
 
             case 23:
-                if (!commState.putByteArray(null, writeEntriesBytes))
+                if (!commState.putByteArray("writeEntriesBytes", writeEntriesBytes))
                     return false;
 
                 commState.idx++;
@@ -652,7 +652,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 9:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -662,7 +662,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 10:
-                byte[] grpLockKeyBytes0 = commState.getByteArray(null);
+                byte[] grpLockKeyBytes0 = commState.getByteArray("grpLockKeyBytes");
 
                 if (grpLockKeyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -675,7 +675,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                isInTx = commState.getBoolean(null);
+                isInTx = commState.getBoolean("isInTx");
 
                 commState.idx++;
 
@@ -683,7 +683,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                isInvalidate = commState.getBoolean(null);
+                isInvalidate = commState.getBoolean("isInvalidate");
 
                 commState.idx++;
 
@@ -691,7 +691,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                isRead = commState.getBoolean(null);
+                isRead = commState.getBoolean("isRead");
 
                 commState.idx++;
 
@@ -699,7 +699,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                byte isolation0 = commState.getByte(null);
+                byte isolation0 = commState.getByte("isolation");
 
                 isolation = GridCacheTxIsolation.fromOrdinal(isolation0);
 
@@ -735,7 +735,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 16:
-                GridCacheVersion nearXidVer0 = commState.getCacheVersion(null);
+                GridCacheVersion nearXidVer0 = commState.getCacheVersion("nearXidVer");
 
                 if (nearXidVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -745,7 +745,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 commState.idx++;
 
             case 17:
-                UUID nodeId0 = commState.getUuid(null);
+                UUID nodeId0 = commState.getUuid("nodeId");
 
                 if (nodeId0 == UUID_NOT_READ)
                     return false;
@@ -758,12 +758,12 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 1)
                     return false;
 
-                partLock = commState.getBoolean(null);
+                partLock = commState.getBoolean("partLock");
 
                 commState.idx++;
 
             case 19:
-                boolean[] retVals0 = commState.getBooleanArray(null);
+                boolean[] retVals0 = commState.getBooleanArray("retVals");
 
                 if (retVals0 == BOOLEAN_ARR_NOT_READ)
                     return false;
@@ -776,7 +776,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 8)
                     return false;
 
-                threadId = commState.getLong(null);
+                threadId = commState.getLong("threadId");
 
                 commState.idx++;
 
@@ -784,7 +784,7 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong(null);
+                timeout = commState.getLong("timeout");
 
                 commState.idx++;
 
@@ -792,12 +792,12 @@ public class GridDistributedLockRequest<K, V> extends GridDistributedBaseMessage
                 if (buf.remaining() < 4)
                     return false;
 
-                txSize = commState.getInt(null);
+                txSize = commState.getInt("txSize");
 
                 commState.idx++;
 
             case 23:
-                byte[] writeEntriesBytes0 = commState.getByteArray(null);
+                byte[] writeEntriesBytes0 = commState.getByteArray("writeEntriesBytes");
 
                 if (writeEntriesBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java
index cf94059..7facf11 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedLockResponse.java
@@ -295,13 +295,13 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
@@ -348,7 +348,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
 
         switch (commState.idx) {
             case 8:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -358,7 +358,7 @@ public class GridDistributedLockResponse<K, V> extends GridDistributedBaseMessag
                 commState.idx++;
 
             case 9:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java
index 8ffbc3d..b41665d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishRequest.java
@@ -342,6 +342,8 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
         _clone.commitVer = commitVer;
         _clone.invalidate = invalidate;
         _clone.commit = commit;
+        _clone.syncCommit = syncCommit;
+        _clone.syncRollback = syncRollback;
         _clone.baseVer = baseVer;
         _clone.writeEntries = writeEntries;
         _clone.writeEntriesBytes = writeEntriesBytes;
@@ -369,54 +371,42 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putCacheVersion(null, baseVer))
+                if (!commState.putCacheVersion("baseVer", baseVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putBoolean(null, commit))
+                if (!commState.putBoolean("commit", commit))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putCacheVersion(null, commitVer))
+                if (!commState.putCacheVersion("commitVer", commitVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putByteArray(null, grpLockKeyBytes))
+                if (!commState.putByteArray("grpLockKeyBytes", grpLockKeyBytes))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putBoolean(null, invalidate))
+                if (!commState.putBoolean("invalidate", invalidate))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putBoolean(null, syncCommit))
-                    return false;
-
-                commState.idx++;
-
-            case 15:
-                if (!commState.putBoolean(null, syncRollback))
-                    return false;
-
-                commState.idx++;
-
-            case 16:
                 if (recoveryWritesBytes != null) {
                     if (commState.it == null) {
                         if (!commState.putInt(null, recoveryWritesBytes.size()))
@@ -443,14 +433,26 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
 
                 commState.idx++;
 
+            case 15:
+                if (!commState.putBoolean("syncCommit", syncCommit))
+                    return false;
+
+                commState.idx++;
+
+            case 16:
+                if (!commState.putBoolean("syncRollback", syncRollback))
+                    return false;
+
+                commState.idx++;
+
             case 17:
-                if (!commState.putLong(null, threadId))
+                if (!commState.putLong("threadId", threadId))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putInt(null, txSize))
+                if (!commState.putInt("txSize", txSize))
                     return false;
 
                 commState.idx++;
@@ -497,7 +499,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
 
         switch (commState.idx) {
             case 8:
-                GridCacheVersion baseVer0 = commState.getCacheVersion(null);
+                GridCacheVersion baseVer0 = commState.getCacheVersion("baseVer");
 
                 if (baseVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -510,12 +512,12 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 if (buf.remaining() < 1)
                     return false;
 
-                commit = commState.getBoolean(null);
+                commit = commState.getBoolean("commit");
 
                 commState.idx++;
 
             case 10:
-                GridCacheVersion commitVer0 = commState.getCacheVersion(null);
+                GridCacheVersion commitVer0 = commState.getCacheVersion("commitVer");
 
                 if (commitVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -525,7 +527,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 commState.idx++;
 
             case 11:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -535,7 +537,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 commState.idx++;
 
             case 12:
-                byte[] grpLockKeyBytes0 = commState.getByteArray(null);
+                byte[] grpLockKeyBytes0 = commState.getByteArray("grpLockKeyBytes");
 
                 if (grpLockKeyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -548,27 +550,11 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 if (buf.remaining() < 1)
                     return false;
 
-                invalidate = commState.getBoolean(null);
+                invalidate = commState.getBoolean("invalidate");
 
                 commState.idx++;
 
             case 14:
-                if (buf.remaining() < 1)
-                    return false;
-
-                syncCommit = commState.getBoolean(null);
-
-                commState.idx++;
-
-            case 15:
-                if (buf.remaining() < 1)
-                    return false;
-
-                syncRollback = commState.getBoolean(null);
-
-                commState.idx++;
-
-            case 16:
                 if (commState.readSize == -1) {
                     if (buf.remaining() < 4)
                         return false;
@@ -597,11 +583,27 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
 
                 commState.idx++;
 
+            case 15:
+                if (buf.remaining() < 1)
+                    return false;
+
+                syncCommit = commState.getBoolean("syncCommit");
+
+                commState.idx++;
+
+            case 16:
+                if (buf.remaining() < 1)
+                    return false;
+
+                syncRollback = commState.getBoolean("syncRollback");
+
+                commState.idx++;
+
             case 17:
                 if (buf.remaining() < 8)
                     return false;
 
-                threadId = commState.getLong(null);
+                threadId = commState.getLong("threadId");
 
                 commState.idx++;
 
@@ -609,7 +611,7 @@ public class GridDistributedTxFinishRequest<K, V> extends GridDistributedBaseMes
                 if (buf.remaining() < 4)
                     return false;
 
-                txSize = commState.getInt(null);
+                txSize = commState.getInt("txSize");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java
index eb68e05..fd616d0 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxFinishResponse.java
@@ -102,13 +102,13 @@ public class GridDistributedTxFinishResponse<K, V> extends GridCacheMessage<K, V
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putCacheVersion(null, txId))
+                if (!commState.putCacheVersion("txId", txId))
                     return false;
 
                 commState.idx++;
@@ -128,7 +128,7 @@ public class GridDistributedTxFinishResponse<K, V> extends GridCacheMessage<K, V
 
         switch (commState.idx) {
             case 3:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -138,7 +138,7 @@ public class GridDistributedTxFinishResponse<K, V> extends GridCacheMessage<K, V
                 commState.idx++;
 
             case 4:
-                GridCacheVersion txId0 = commState.getCacheVersion(null);
+                GridCacheVersion txId0 = commState.getCacheVersion("txId");
 
                 if (txId0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
index 4aa4963..25db96e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
@@ -434,43 +434,43 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putCacheVersion(null, commitVer))
+                if (!commState.putCacheVersion("commitVer", commitVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putEnum(null, concurrency))
+                if (!commState.putEnum("concurrency", concurrency))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putByteArray(null, dhtVersBytes))
+                if (!commState.putByteArray("dhtVersBytes", dhtVersBytes))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putByteArray(null, grpLockKeyBytes))
+                if (!commState.putByteArray("grpLockKeyBytes", grpLockKeyBytes))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(null, invalidate))
+                if (!commState.putBoolean("invalidate", invalidate))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putEnum(null, isolation))
+                if (!commState.putEnum("isolation", isolation))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putBoolean(null, partLock))
+                if (!commState.putBoolean("partLock", partLock))
                     return false;
 
                 commState.idx++;
@@ -503,25 +503,25 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 commState.idx++;
 
             case 16:
-                if (!commState.putLong(null, threadId))
+                if (!commState.putLong("threadId", threadId))
                     return false;
 
                 commState.idx++;
 
             case 17:
-                if (!commState.putLong(null, timeout))
+                if (!commState.putLong("timeout", timeout))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putByteArray(null, txNodesBytes))
+                if (!commState.putByteArray("txNodesBytes", txNodesBytes))
                     return false;
 
                 commState.idx++;
 
             case 19:
-                if (!commState.putInt(null, txSize))
+                if (!commState.putInt("txSize", txSize))
                     return false;
 
                 commState.idx++;
@@ -568,7 +568,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
 
         switch (commState.idx) {
             case 8:
-                GridCacheVersion commitVer0 = commState.getCacheVersion(null);
+                GridCacheVersion commitVer0 = commState.getCacheVersion("commitVer");
 
                 if (commitVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -581,14 +581,14 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 1)
                     return false;
 
-                byte concurrency0 = commState.getByte(null);
+                byte concurrency0 = commState.getByte("concurrency");
 
                 concurrency = GridCacheTxConcurrency.fromOrdinal(concurrency0);
 
                 commState.idx++;
 
             case 10:
-                byte[] dhtVersBytes0 = commState.getByteArray(null);
+                byte[] dhtVersBytes0 = commState.getByteArray("dhtVersBytes");
 
                 if (dhtVersBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -598,7 +598,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 commState.idx++;
 
             case 11:
-                byte[] grpLockKeyBytes0 = commState.getByteArray(null);
+                byte[] grpLockKeyBytes0 = commState.getByteArray("grpLockKeyBytes");
 
                 if (grpLockKeyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -611,7 +611,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 1)
                     return false;
 
-                invalidate = commState.getBoolean(null);
+                invalidate = commState.getBoolean("invalidate");
 
                 commState.idx++;
 
@@ -619,7 +619,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 1)
                     return false;
 
-                byte isolation0 = commState.getByte(null);
+                byte isolation0 = commState.getByte("isolation");
 
                 isolation = GridCacheTxIsolation.fromOrdinal(isolation0);
 
@@ -629,7 +629,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 1)
                     return false;
 
-                partLock = commState.getBoolean(null);
+                partLock = commState.getBoolean("partLock");
 
                 commState.idx++;
 
@@ -666,7 +666,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 8)
                     return false;
 
-                threadId = commState.getLong(null);
+                threadId = commState.getLong("threadId");
 
                 commState.idx++;
 
@@ -674,12 +674,12 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong(null);
+                timeout = commState.getLong("timeout");
 
                 commState.idx++;
 
             case 18:
-                byte[] txNodesBytes0 = commState.getByteArray(null);
+                byte[] txNodesBytes0 = commState.getByteArray("txNodesBytes");
 
                 if (txNodesBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -692,7 +692,7 @@ public class GridDistributedTxPrepareRequest<K, V> extends GridDistributedBaseMe
                 if (buf.remaining() < 4)
                     return false;
 
-                txSize = commState.getInt(null);
+                txSize = commState.getInt("txSize");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
index 2754c9e..64922f7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
@@ -179,13 +179,13 @@ public class GridDistributedTxPrepareResponse<K, V> extends GridDistributedBaseM
 
         switch (commState.idx) {
             case 8:
-                if (!commState.putByteArray(null, candsBytes))
+                if (!commState.putByteArray("candsBytes", candsBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
@@ -205,7 +205,7 @@ public class GridDistributedTxPrepareResponse<K, V> extends GridDistributedBaseM
 
         switch (commState.idx) {
             case 8:
-                byte[] candsBytes0 = commState.getByteArray(null);
+                byte[] candsBytes0 = commState.getByteArray("candsBytes");
 
                 if (candsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -215,7 +215,7 @@ public class GridDistributedTxPrepareResponse<K, V> extends GridDistributedBaseM
                 commState.idx++;
 
             case 9:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
index ef4e7ba..9c6b74b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentRequest.java
@@ -93,7 +93,7 @@ public class GridDhtAffinityAssignmentRequest<K, V> extends GridCacheMessage<K,
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
@@ -115,7 +115,7 @@ public class GridDhtAffinityAssignmentRequest<K, V> extends GridCacheMessage<K,
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
index 2495763..151e833 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
@@ -134,13 +134,13 @@ public class GridDhtAffinityAssignmentResponse<K, V> extends GridCacheMessage<K,
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(null, affAssignmentBytes))
+                if (!commState.putByteArray("affAssignmentBytes", affAssignmentBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
@@ -159,7 +159,7 @@ public class GridDhtAffinityAssignmentResponse<K, V> extends GridCacheMessage<K,
 
         switch (commState.idx) {
             case 3:
-                byte[] affAssignmentBytes0 = commState.getByteArray(null);
+                byte[] affAssignmentBytes0 = commState.getByteArray("affAssignmentBytes");
 
                 if (affAssignmentBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -172,7 +172,7 @@ public class GridDhtAffinityAssignmentResponse<K, V> extends GridCacheMessage<K,
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java
index a78a6e3..685f2b9 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockRequest.java
@@ -348,13 +348,13 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
 
         switch (commState.idx) {
             case 24:
-                if (!commState.putBitSet(null, invalidateEntries))
+                if (!commState.putBitSet("invalidateEntries", invalidateEntries))
                     return false;
 
                 commState.idx++;
 
             case 25:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
@@ -387,31 +387,31 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                 commState.idx++;
 
             case 27:
-                if (!commState.putByteArray(null, ownedBytes))
+                if (!commState.putByteArray("ownedBytes", ownedBytes))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 29:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 30:
-                if (!commState.putInt(null, taskNameHash))
+                if (!commState.putInt("taskNameHash", taskNameHash))
                     return false;
 
                 commState.idx++;
 
             case 31:
-                if (!commState.putBitSet(null, preloadKeys))
+                if (!commState.putBitSet("preloadKeys", preloadKeys))
                     return false;
 
                 commState.idx++;
@@ -431,7 +431,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
 
         switch (commState.idx) {
             case 24:
-                BitSet invalidateEntries0 = commState.getBitSet(null);
+                BitSet invalidateEntries0 = commState.getBitSet("invalidateEntries");
 
                 if (invalidateEntries0 == BIT_SET_NOT_READ)
                     return false;
@@ -441,7 +441,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                 commState.idx++;
 
             case 25:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -480,7 +480,7 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                 commState.idx++;
 
             case 27:
-                byte[] ownedBytes0 = commState.getByteArray(null);
+                byte[] ownedBytes0 = commState.getByteArray("ownedBytes");
 
                 if (ownedBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -493,12 +493,12 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
             case 29:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -511,12 +511,12 @@ public class GridDhtLockRequest<K, V> extends GridDistributedLockRequest<K, V> {
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt(null);
+                taskNameHash = commState.getInt("taskNameHash");
 
                 commState.idx++;
 
             case 31:
-                BitSet preloadKeys0 = commState.getBitSet(null);
+                BitSet preloadKeys0 = commState.getBitSet("preloadKeys");
 
                 if (preloadKeys0 == BIT_SET_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java
index 2563a31..6c68bdb 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtLockResponse.java
@@ -257,7 +257,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                 commState.idx++;
 
             case 12:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
@@ -360,7 +360,7 @@ public class GridDhtLockResponse<K, V> extends GridDistributedLockResponse<K, V>
                 commState.idx++;
 
             case 12:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
index 105787f..d435b58 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
@@ -323,19 +323,19 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
 
         switch (commState.idx) {
             case 20:
-                if (!commState.putEnum(null, isolation))
+                if (!commState.putEnum("isolation", isolation))
                     return false;
 
                 commState.idx++;
 
             case 21:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putUuid(null, nearNodeId))
+                if (!commState.putUuid("nearNodeId", nearNodeId))
                     return false;
 
                 commState.idx++;
@@ -368,7 +368,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 commState.idx++;
 
             case 24:
-                if (!commState.putBoolean(null, onePhaseCommit))
+                if (!commState.putBoolean("onePhaseCommit", onePhaseCommit))
                     return false;
 
                 commState.idx++;
@@ -401,31 +401,31 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 commState.idx++;
 
             case 26:
-                if (!commState.putBoolean(null, sysInvalidate))
+                if (!commState.putBoolean("sysInvalidate", sysInvalidate))
                     return false;
 
                 commState.idx++;
 
             case 27:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putCacheVersion(null, writeVer))
+                if (!commState.putCacheVersion("writeVer", writeVer))
                     return false;
 
                 commState.idx++;
 
             case 29:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 30:
-                if (!commState.putInt(null, taskNameHash))
+                if (!commState.putInt("taskNameHash", taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -448,14 +448,14 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 1)
                     return false;
 
-                byte isolation0 = commState.getByte(null);
+                byte isolation0 = commState.getByte("isolation");
 
                 isolation = GridCacheTxIsolation.fromOrdinal(isolation0);
 
                 commState.idx++;
 
             case 21:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -465,7 +465,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 commState.idx++;
 
             case 22:
-                UUID nearNodeId0 = commState.getUuid(null);
+                UUID nearNodeId0 = commState.getUuid("nearNodeId");
 
                 if (nearNodeId0 == UUID_NOT_READ)
                     return false;
@@ -507,7 +507,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 1)
                     return false;
 
-                onePhaseCommit = commState.getBoolean(null);
+                onePhaseCommit = commState.getBoolean("onePhaseCommit");
 
                 commState.idx++;
 
@@ -544,7 +544,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 1)
                     return false;
 
-                sysInvalidate = commState.getBoolean(null);
+                sysInvalidate = commState.getBoolean("sysInvalidate");
 
                 commState.idx++;
 
@@ -552,12 +552,12 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
             case 28:
-                GridCacheVersion writeVer0 = commState.getCacheVersion(null);
+                GridCacheVersion writeVer0 = commState.getCacheVersion("writeVer");
 
                 if (writeVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -567,7 +567,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 commState.idx++;
 
             case 29:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -580,7 +580,7 @@ public class GridDhtTxFinishRequest<K, V> extends GridDistributedTxFinishRequest
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt(null);
+                taskNameHash = commState.getInt("taskNameHash");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
index b64e780..1215f1e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
@@ -96,7 +96,7 @@ public class GridDhtTxFinishResponse<K, V> extends GridDistributedTxFinishRespon
 
         switch (commState.idx) {
             case 5:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
@@ -116,7 +116,7 @@ public class GridDhtTxFinishResponse<K, V> extends GridDistributedTxFinishRespon
 
         switch (commState.idx) {
             case 5:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
index 1455e5d..51be9d5 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
@@ -353,31 +353,31 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
 
         switch (commState.idx) {
             case 21:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putBitSet(null, invalidateNearEntries))
+                if (!commState.putBitSet("invalidateNearEntries", invalidateNearEntries))
                     return false;
 
                 commState.idx++;
 
             case 23:
-                if (!commState.putBoolean(null, last))
+                if (!commState.putBoolean("last", last))
                     return false;
 
                 commState.idx++;
 
             case 24:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 25:
-                if (!commState.putUuid(null, nearNodeId))
+                if (!commState.putUuid("nearNodeId", nearNodeId))
                     return false;
 
                 commState.idx++;
@@ -410,37 +410,37 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 commState.idx++;
 
             case 27:
-                if (!commState.putCacheVersion(null, nearXidVer))
+                if (!commState.putCacheVersion("nearXidVer", nearXidVer))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putByteArray(null, ownedBytes))
+                if (!commState.putByteArray("ownedBytes", ownedBytes))
                     return false;
 
                 commState.idx++;
 
             case 29:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 30:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 31:
-                if (!commState.putInt(null, taskNameHash))
+                if (!commState.putInt("taskNameHash", taskNameHash))
                     return false;
 
                 commState.idx++;
 
             case 32:
-                if (!commState.putBitSet(null, preloadKeys))
+                if (!commState.putBitSet("preloadKeys", preloadKeys))
                     return false;
 
                 commState.idx++;
@@ -460,7 +460,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
 
         switch (commState.idx) {
             case 21:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -470,7 +470,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 commState.idx++;
 
             case 22:
-                BitSet invalidateNearEntries0 = commState.getBitSet(null);
+                BitSet invalidateNearEntries0 = commState.getBitSet("invalidateNearEntries");
 
                 if (invalidateNearEntries0 == BIT_SET_NOT_READ)
                     return false;
@@ -483,12 +483,12 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 if (buf.remaining() < 1)
                     return false;
 
-                last = commState.getBoolean(null);
+                last = commState.getBoolean("last");
 
                 commState.idx++;
 
             case 24:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -498,7 +498,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 commState.idx++;
 
             case 25:
-                UUID nearNodeId0 = commState.getUuid(null);
+                UUID nearNodeId0 = commState.getUuid("nearNodeId");
 
                 if (nearNodeId0 == UUID_NOT_READ)
                     return false;
@@ -537,7 +537,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 commState.idx++;
 
             case 27:
-                GridCacheVersion nearXidVer0 = commState.getCacheVersion(null);
+                GridCacheVersion nearXidVer0 = commState.getCacheVersion("nearXidVer");
 
                 if (nearXidVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -547,7 +547,7 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 commState.idx++;
 
             case 28:
-                byte[] ownedBytes0 = commState.getByteArray(null);
+                byte[] ownedBytes0 = commState.getByteArray("ownedBytes");
 
                 if (ownedBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -560,12 +560,12 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
             case 30:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -578,12 +578,12 @@ public class GridDhtTxPrepareRequest<K, V> extends GridDistributedTxPrepareReque
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt(null);
+                taskNameHash = commState.getInt("taskNameHash");
 
                 commState.idx++;
 
             case 32:
-                BitSet preloadKeys0 = commState.getBitSet(null);
+                BitSet preloadKeys0 = commState.getBitSet("preloadKeys");
 
                 if (preloadKeys0 == BIT_SET_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
index d541b58..33fe66f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
@@ -237,7 +237,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
 
         switch (commState.idx) {
             case 10:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
@@ -270,7 +270,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                 commState.idx++;
 
             case 12:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
@@ -344,7 +344,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
 
         switch (commState.idx) {
             case 10:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -383,7 +383,7 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
                 commState.idx++;
 
             case 12:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index 6e084f3..18ba7c4 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -652,13 +652,13 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putLongList(null, drExpireTimes))
+                if (!commState.putLongList("drExpireTimes", drExpireTimes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLongList(null, drTtls))
+                if (!commState.putLongList("drTtls", drTtls))
                     return false;
 
                 commState.idx++;
@@ -691,7 +691,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 6:
-                if (!commState.putCacheVersion(null, futVer))
+                if (!commState.putCacheVersion("futVer", futVer))
                     return false;
 
                 commState.idx++;
@@ -724,25 +724,25 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 8:
-                if (!commState.putUuid(null, nodeId))
+                if (!commState.putUuid("nodeId", nodeId))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putEnum(null, syncMode))
+                if (!commState.putEnum("syncMode", syncMode))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putLong(null, ttl))
+                if (!commState.putLong("ttl", ttl))
                     return false;
 
                 commState.idx++;
@@ -775,7 +775,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 13:
-                if (!commState.putCacheVersion(null, writeVer))
+                if (!commState.putCacheVersion("writeVer", writeVer))
                     return false;
 
                 commState.idx++;
@@ -835,7 +835,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 16:
-                if (!commState.putBoolean(null, forceTransformBackups))
+                if (!commState.putBoolean("forceTransformBackups", forceTransformBackups))
                     return false;
 
                 commState.idx++;
@@ -895,13 +895,13 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 19:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 20:
-                if (!commState.putInt(null, taskNameHash))
+                if (!commState.putInt("taskNameHash", taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -921,7 +921,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
 
         switch (commState.idx) {
             case 3:
-                GridLongList drExpireTimes0 = commState.getLongList(null);
+                GridLongList drExpireTimes0 = commState.getLongList("drExpireTimes");
 
                 if (drExpireTimes0 == LONG_LIST_NOT_READ)
                     return false;
@@ -931,7 +931,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 4:
-                GridLongList drTtls0 = commState.getLongList(null);
+                GridLongList drTtls0 = commState.getLongList("drTtls");
 
                 if (drTtls0 == LONG_LIST_NOT_READ)
                     return false;
@@ -970,7 +970,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 6:
-                GridCacheVersion futVer0 = commState.getCacheVersion(null);
+                GridCacheVersion futVer0 = commState.getCacheVersion("futVer");
 
                 if (futVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -1009,7 +1009,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 8:
-                UUID nodeId0 = commState.getUuid(null);
+                UUID nodeId0 = commState.getUuid("nodeId");
 
                 if (nodeId0 == UUID_NOT_READ)
                     return false;
@@ -1022,7 +1022,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 1)
                     return false;
 
-                byte syncMode0 = commState.getByte(null);
+                byte syncMode0 = commState.getByte("syncMode");
 
                 syncMode = GridCacheWriteSynchronizationMode.fromOrdinal(syncMode0);
 
@@ -1032,7 +1032,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
@@ -1040,7 +1040,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 8)
                     return false;
 
-                ttl = commState.getLong(null);
+                ttl = commState.getLong("ttl");
 
                 commState.idx++;
 
@@ -1074,7 +1074,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 13:
-                GridCacheVersion writeVer0 = commState.getCacheVersion(null);
+                GridCacheVersion writeVer0 = commState.getCacheVersion("writeVer");
 
                 if (writeVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -1145,7 +1145,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 1)
                     return false;
 
-                forceTransformBackups = commState.getBoolean(null);
+                forceTransformBackups = commState.getBoolean("forceTransformBackups");
 
                 commState.idx++;
 
@@ -1208,7 +1208,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 commState.idx++;
 
             case 19:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -1221,7 +1221,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> imp
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt(null);
+                taskNameHash = commState.getInt("taskNameHash");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
index 5d3ba59..bc54e2f 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
@@ -211,19 +211,19 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(null, failedKeysBytes))
+                if (!commState.putByteArray("failedKeysBytes", failedKeysBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putCacheVersion(null, futVer))
+                if (!commState.putCacheVersion("futVer", futVer))
                     return false;
 
                 commState.idx++;
@@ -270,7 +270,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
 
         switch (commState.idx) {
             case 3:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -280,7 +280,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 4:
-                byte[] failedKeysBytes0 = commState.getByteArray(null);
+                byte[] failedKeysBytes0 = commState.getByteArray("failedKeysBytes");
 
                 if (failedKeysBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -290,7 +290,7 @@ public class GridDhtAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 5:
-                GridCacheVersion futVer0 = commState.getCacheVersion(null);
+                GridCacheVersion futVer0 = commState.getCacheVersion("futVer");
 
                 if (futVer0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index 446a521..353446a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -553,13 +553,13 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putLongList(null, drExpireTimes))
+                if (!commState.putLongList("drExpireTimes", drExpireTimes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLongList(null, drTtls))
+                if (!commState.putLongList("drTtls", drTtls))
                     return false;
 
                 commState.idx++;
@@ -592,7 +592,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 6:
-                if (!commState.putBoolean(null, fastMap))
+                if (!commState.putBoolean("fastMap", fastMap))
                     return false;
 
                 commState.idx++;
@@ -625,13 +625,13 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 8:
-                if (!commState.putCacheVersion(null, futVer))
+                if (!commState.putCacheVersion("futVer", futVer))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putBoolean(null, hasPrimary))
+                if (!commState.putBoolean("hasPrimary", hasPrimary))
                     return false;
 
                 commState.idx++;
@@ -664,37 +664,37 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 11:
-                if (!commState.putEnum(null, op))
+                if (!commState.putEnum("op", op))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(null, retval))
+                if (!commState.putBoolean("retval", retval))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putEnum(null, syncMode))
+                if (!commState.putEnum("syncMode", syncMode))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
 
             case 15:
-                if (!commState.putLong(null, ttl))
+                if (!commState.putLong("ttl", ttl))
                     return false;
 
                 commState.idx++;
 
             case 16:
-                if (!commState.putCacheVersion(null, updateVer))
+                if (!commState.putCacheVersion("updateVer", updateVer))
                     return false;
 
                 commState.idx++;
@@ -727,19 +727,19 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 18:
-                if (!commState.putBoolean(null, forceTransformBackups))
+                if (!commState.putBoolean("forceTransformBackups", forceTransformBackups))
                     return false;
 
                 commState.idx++;
 
             case 19:
-                if (!commState.putUuid(null, subjId))
+                if (!commState.putUuid("subjId", subjId))
                     return false;
 
                 commState.idx++;
 
             case 20:
-                if (!commState.putInt(null, taskNameHash))
+                if (!commState.putInt("taskNameHash", taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -759,7 +759,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
 
         switch (commState.idx) {
             case 3:
-                GridLongList drExpireTimes0 = commState.getLongList(null);
+                GridLongList drExpireTimes0 = commState.getLongList("drExpireTimes");
 
                 if (drExpireTimes0 == LONG_LIST_NOT_READ)
                     return false;
@@ -769,7 +769,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 4:
-                GridLongList drTtls0 = commState.getLongList(null);
+                GridLongList drTtls0 = commState.getLongList("drTtls");
 
                 if (drTtls0 == LONG_LIST_NOT_READ)
                     return false;
@@ -811,7 +811,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                fastMap = commState.getBoolean(null);
+                fastMap = commState.getBoolean("fastMap");
 
                 commState.idx++;
 
@@ -845,7 +845,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 commState.idx++;
 
             case 8:
-                GridCacheVersion futVer0 = commState.getCacheVersion(null);
+                GridCacheVersion futVer0 = commState.getCacheVersion("futVer");
 
                 if (futVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -858,7 +858,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                hasPrimary = commState.getBoolean(null);
+                hasPrimary = commState.getBoolean("hasPrimary");
 
                 commState.idx++;
 
@@ -895,7 +895,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                byte op0 = commState.getByte(null);
+                byte op0 = commState.getByte("op");
 
                 op = GridCacheOperation.fromOrdinal(op0);
 
@@ -905,7 +905,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                retval = commState.getBoolean(null);
+                retval = commState.getBoolean("retval");
 
                 commState.idx++;
 
@@ -913,7 +913,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                byte syncMode0 = commState.getByte(null);
+                byte syncMode0 = commState.getByte("syncMode");
 
                 syncMode = GridCacheWriteSynchronizationMode.fromOrdinal(syncMode0);
 
@@ -923,7 +923,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 
@@ -931,12 +931,12 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 8)
                     return false;
 
-                ttl = commState.getLong(null);
+                ttl = commState.getLong("ttl");
 
                 commState.idx++;
 
             case 16:
-                GridCacheVersion updateVer0 = commState.getCacheVersion(null);
+                GridCacheVersion updateVer0 = commState.getCacheVersion("updateVer");
 
                 if (updateVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -978,12 +978,12 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 1)
                     return false;
 
-                forceTransformBackups = commState.getBoolean(null);
+                forceTransformBackups = commState.getBoolean("forceTransformBackups");
 
                 commState.idx++;
 
             case 19:
-                UUID subjId0 = commState.getUuid(null);
+                UUID subjId0 = commState.getUuid("subjId");
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -996,7 +996,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K, V> im
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt(null);
+                taskNameHash = commState.getInt("taskNameHash");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index ba683c3..363ac8b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -404,31 +404,31 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putByteArray(null, errBytes))
+                if (!commState.putByteArray("errBytes", errBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(null, failedKeysBytes))
+                if (!commState.putByteArray("failedKeysBytes", failedKeysBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putCacheVersion(null, futVer))
+                if (!commState.putCacheVersion("futVer", futVer))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putByteArray(null, remapKeysBytes))
+                if (!commState.putByteArray("remapKeysBytes", remapKeysBytes))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putByteArray(null, retValBytes))
+                if (!commState.putByteArray("retValBytes", retValBytes))
                     return false;
 
                 commState.idx++;
@@ -461,7 +461,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 9:
-                if (!commState.putLong(null, nearTtl))
+                if (!commState.putLong("nearTtl", nearTtl))
                     return false;
 
                 commState.idx++;
@@ -521,7 +521,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 12:
-                if (!commState.putCacheVersion(null, nearVer))
+                if (!commState.putCacheVersion("nearVer", nearVer))
                     return false;
 
                 commState.idx++;
@@ -541,7 +541,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
 
         switch (commState.idx) {
             case 3:
-                byte[] errBytes0 = commState.getByteArray(null);
+                byte[] errBytes0 = commState.getByteArray("errBytes");
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -551,7 +551,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 4:
-                byte[] failedKeysBytes0 = commState.getByteArray(null);
+                byte[] failedKeysBytes0 = commState.getByteArray("failedKeysBytes");
 
                 if (failedKeysBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -561,7 +561,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 5:
-                GridCacheVersion futVer0 = commState.getCacheVersion(null);
+                GridCacheVersion futVer0 = commState.getCacheVersion("futVer");
 
                 if (futVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -571,7 +571,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 6:
-                byte[] remapKeysBytes0 = commState.getByteArray(null);
+                byte[] remapKeysBytes0 = commState.getByteArray("remapKeysBytes");
 
                 if (remapKeysBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -581,7 +581,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 7:
-                byte[] retValBytes0 = commState.getByteArray(null);
+                byte[] retValBytes0 = commState.getByteArray("retValBytes");
 
                 if (retValBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -623,7 +623,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 if (buf.remaining() < 8)
                     return false;
 
-                nearTtl = commState.getLong(null);
+                nearTtl = commState.getLong("nearTtl");
 
                 commState.idx++;
 
@@ -686,7 +686,7 @@ public class GridNearAtomicUpdateResponse<K, V> extends GridCacheMessage<K, V> i
                 commState.idx++;
 
             case 12:
-                GridCacheVersion nearVer0 = commState.getCacheVersion(null);
+                GridCacheVersion nearVer0 = commState.getCacheVersion("nearVer");
 
                 if (nearVer0 == CACHE_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
index 30c18cc..60f9144 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysRequest.java
@@ -193,7 +193,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
@@ -226,13 +226,13 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
                 commState.idx++;
 
             case 5:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putLong(null, topVer))
+                if (!commState.putLong("topVer", topVer))
                     return false;
 
                 commState.idx++;
@@ -252,7 +252,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
 
         switch (commState.idx) {
             case 3:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -291,7 +291,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
                 commState.idx++;
 
             case 5:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -304,7 +304,7 @@ public class GridDhtForceKeysRequest<K, V> extends GridCacheMessage<K, V> implem
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong(null);
+                topVer = commState.getLong("topVer");
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5b3f26e/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
index e333a95..bd56937 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
@@ -197,19 +197,19 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putGridUuid(null, futId))
+                if (!commState.putGridUuid("futId", futId))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(null, infosBytes))
+                if (!commState.putByteArray("infosBytes", infosBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putGridUuid(null, miniId))
+                if (!commState.putGridUuid("miniId", miniId))
                     return false;
 
                 commState.idx++;
@@ -256,7 +256,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
 
         switch (commState.idx) {
             case 3:
-                IgniteUuid futId0 = commState.getGridUuid(null);
+                IgniteUuid futId0 = commState.getGridUuid("futId");
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -266,7 +266,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
                 commState.idx++;
 
             case 4:
-                byte[] infosBytes0 = commState.getByteArray(null);
+                byte[] infosBytes0 = commState.getByteArray("infosBytes");
 
                 if (infosBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -276,7 +276,7 @@ public class GridDhtForceKeysResponse<K, V> extends GridCacheMessage<K, V> imple
                 commState.idx++;
 
             case 5:
-                IgniteUuid miniId0 = commState.getGridUuid(null);
+                IgniteUuid miniId0 = commState.getGridUuid("miniId");
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;


[20/20] incubator-ignite git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-61

Posted by vk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-61


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

Branch: refs/heads/ignite-61
Commit: 9b7fea2d3283f6d8b70ae1da7bbb09b894fd44ef
Parents: f5b3f26 1812040
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Mon Dec 22 15:02:54 2014 -0800
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Mon Dec 22 15:02:54 2014 -0800

----------------------------------------------------------------------
 .../java/META-INF/native/linux64/libggshmem.so  | Bin 161925 -> 138023 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------



[10/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
IGNITE-61 - Portable format in direct marshalling


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

Branch: refs/heads/ignite-61
Commit: 5ed5176eff3df499014e7084c5bb3f46aa319c6c
Parents: ac71f06
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Dec 18 17:12:26 2014 +0300
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Dec 18 17:12:26 2014 +0300

----------------------------------------------------------------------
 .../spi/collision/jobstealing/JobStealingRequest.java  |  2 +-
 .../util/direct/GridTcpCommunicationMessageState.java  | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5ed5176e/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
index 6e43563..1b3a91e 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
@@ -69,7 +69,7 @@ public class JobStealingRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(null, directType()))
+            if (!commState.writeType(directType()))
                 return false;
 
             commState.typeWritten = true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5ed5176e/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
index ee60070..5a3e74d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
+++ b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageState.java
@@ -78,6 +78,19 @@ public class GridTcpCommunicationMessageState {
     }
 
     /**
+     * @param type Message type.
+     * @return Whether message type was written.
+     */
+    public final boolean writeType(byte type) {
+        if (stream.remaining() == 0)
+            return false;
+
+        stream.writeByte(type);
+
+        return true;
+    }
+
+    /**
      * @param name Field name.
      * @param b Byte value.
      * @return Whether value was written.


[07/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
IGNITE-61 - Portable format in direct marshalling


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

Branch: refs/heads/ignite-61
Commit: d21e6b4b70b0b6baa0115c392eb94c2d207678e2
Parents: 4a5a08e
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Thu Dec 18 15:06:05 2014 +0300
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Thu Dec 18 15:06:05 2014 +0300

----------------------------------------------------------------------
 .../jobstealing/JobStealingRequest.java         |    6 +-
 .../communication/tcp/TcpCommunicationSpi.java  |  108 +-
 .../GridClientConnectionManagerAdapter.java     |   75 +-
 .../grid/kernal/GridJobCancelRequest.java       |   14 +-
 .../grid/kernal/GridJobExecuteRequest.java      |  102 +-
 .../grid/kernal/GridJobExecuteRequestV2.java    |    6 +-
 .../grid/kernal/GridJobExecuteResponse.java     |   30 +-
 .../grid/kernal/GridJobSiblingsRequest.java     |   10 +-
 .../grid/kernal/GridJobSiblingsResponse.java    |    6 +-
 .../grid/kernal/GridTaskCancelRequest.java      |    6 +-
 .../grid/kernal/GridTaskSessionRequest.java     |   14 +-
 .../checkpoint/GridCheckpointRequest.java       |   14 +-
 .../managers/communication/GridIoMessage.java   |   30 +-
 .../communication/GridIoUserMessage.java        |   40 +-
 .../deployment/GridDeploymentInfoBean.java      |   32 +-
 .../deployment/GridDeploymentRequest.java       |   28 +-
 .../deployment/GridDeploymentResponse.java      |   14 +-
 .../eventstorage/GridEventStorageMessage.java   |   48 +-
 .../cache/GridCacheEvictionRequest.java         |   14 +-
 .../cache/GridCacheEvictionResponse.java        |   20 +-
 .../processors/cache/GridCacheMessage.java      |   14 +-
 ...idCacheOptimisticCheckPreparedTxRequest.java |   18 +-
 ...dCacheOptimisticCheckPreparedTxResponse.java |   14 +-
 ...CachePessimisticCheckCommittedTxRequest.java |   26 +-
 ...achePessimisticCheckCommittedTxResponse.java |   14 +-
 .../distributed/GridDistributedBaseMessage.java |   34 +-
 .../distributed/GridDistributedLockRequest.java |   78 +-
 .../GridDistributedLockResponse.java            |   20 +-
 .../GridDistributedTxFinishRequest.java         |   62 +-
 .../GridDistributedTxFinishResponse.java        |   10 +-
 .../GridDistributedTxPrepareRequest.java        |   66 +-
 .../GridDistributedTxPrepareResponse.java       |   10 +-
 .../GridDistributedUnlockRequest.java           |   12 +-
 .../dht/GridDhtAffinityAssignmentRequest.java   |    6 +-
 .../dht/GridDhtAffinityAssignmentResponse.java  |   10 +-
 .../distributed/dht/GridDhtLockRequest.java     |   40 +-
 .../distributed/dht/GridDhtLockResponse.java    |   36 +-
 .../distributed/dht/GridDhtTxFinishRequest.java |   58 +-
 .../dht/GridDhtTxFinishResponse.java            |    6 +-
 .../dht/GridDhtTxPrepareRequest.java            |   56 +-
 .../dht/GridDhtTxPrepareResponse.java           |   40 +-
 .../distributed/dht/GridDhtUnlockRequest.java   |   12 +-
 .../GridDhtAtomicDeferredUpdateResponse.java    |   12 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |  116 +-
 .../dht/atomic/GridDhtAtomicUpdateResponse.java |   24 +-
 .../dht/atomic/GridNearAtomicUpdateRequest.java |   98 +-
 .../atomic/GridNearAtomicUpdateResponse.java    |   60 +-
 .../dht/preloader/GridDhtForceKeysRequest.java  |   24 +-
 .../dht/preloader/GridDhtForceKeysResponse.java |   24 +-
 .../GridDhtPartitionDemandMessage.java          |   32 +-
 .../GridDhtPartitionSupplyMessage.java          |   38 +-
 .../GridDhtPartitionsAbstractMessage.java       |   10 +-
 .../preloader/GridDhtPartitionsFullMessage.java |   14 +-
 .../GridDhtPartitionsSingleMessage.java         |    6 +-
 .../GridDhtPartitionsSingleRequest.java         |    2 +-
 .../distributed/near/GridNearGetRequest.java    |   54 +-
 .../distributed/near/GridNearGetResponse.java   |   36 +-
 .../distributed/near/GridNearLockRequest.java   |   54 +-
 .../distributed/near/GridNearLockResponse.java  |   40 +-
 .../near/GridNearTxFinishRequest.java           |   22 +-
 .../near/GridNearTxFinishResponse.java          |   14 +-
 .../near/GridNearTxPrepareRequest.java          |   40 +-
 .../near/GridNearTxPrepareResponse.java         |   44 +-
 .../distributed/near/GridNearUnlockRequest.java |    2 +-
 .../cache/query/GridCacheQueryRequest.java      |   78 +-
 .../cache/query/GridCacheQueryResponse.java     |   38 +-
 .../clock/GridClockDeltaSnapshotMessage.java    |   20 +-
 .../continuous/GridContinuousMessage.java       |   14 +-
 .../dataload/GridDataLoadRequest.java           |   60 +-
 .../dataload/GridDataLoadResponse.java          |   14 +-
 .../processors/ggfs/GridGgfsAckMessage.java     |   14 +-
 .../processors/ggfs/GridGgfsBlockKey.java       |   18 +-
 .../processors/ggfs/GridGgfsBlocksMessage.java  |   24 +-
 .../ggfs/GridGgfsCommunicationMessage.java      |    2 +-
 .../processors/ggfs/GridGgfsDeleteMessage.java  |   10 +-
 .../ggfs/GridGgfsFileAffinityRange.java         |   22 +-
 .../ggfs/GridGgfsFragmentizerRequest.java       |   16 +-
 .../ggfs/GridGgfsFragmentizerResponse.java      |    6 +-
 .../processors/ggfs/GridGgfsSyncMessage.java    |   10 +-
 .../portable/GridPortableOutputStream.java      |    7 -
 .../GridClientHandshakeRequestWrapper.java      |   16 +-
 .../GridClientHandshakeResponseWrapper.java     |    2 +-
 .../message/GridClientMessageWrapper.java       |   38 +-
 .../message/GridClientPingPacketWrapper.java    |    4 +-
 .../handlers/task/GridTaskResultRequest.java    |   10 +-
 .../handlers/task/GridTaskResultResponse.java   |   18 +-
 .../tcp/GridMemcachedMessageWrapper.java        |    4 +-
 .../protocols/tcp/GridTcpRestDirectParser.java  |   12 +-
 .../rest/protocols/tcp/GridTcpRestProtocol.java |   57 +-
 .../streamer/GridStreamerCancelRequest.java     |    6 +-
 .../streamer/GridStreamerExecutionRequest.java  |   40 +-
 .../streamer/GridStreamerResponse.java          |   10 +-
 .../org/gridgain/grid/util/GridLongList.java    |   10 +-
 .../java/org/gridgain/grid/util/GridUtils.java  |   34 +
 .../direct/GridPortableByteBufferStream.java    |  726 ++++++++++
 .../GridTcpCommunicationMessageAdapter.java     |   22 -
 .../GridTcpCommunicationMessageState.java       | 1321 ++++++------------
 .../grid/util/ipc/GridIpcToNioAdapter.java      |   15 +-
 .../grid/util/nio/GridDirectParser.java         |   11 +-
 .../grid/util/nio/GridNioMessageReader.java     |   34 -
 .../grid/util/nio/GridNioMessageWriter.java     |   41 -
 .../gridgain/grid/util/nio/GridNioServer.java   |   39 +-
 .../util/nio/GridShmemCommunicationClient.java  |   19 +-
 .../util/nio/GridTcpCommunicationClient.java    |    9 +-
 .../spi/communication/GridTestMessage.java      |   18 +-
 .../GridCommunicationSendMessageSelfTest.java   |    2 +-
 106 files changed, 2373 insertions(+), 2523 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
index 4df54a2..6e43563 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
@@ -69,7 +69,7 @@ public class JobStealingRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -77,7 +77,7 @@ public class JobStealingRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putInt(delta))
+                if (!commState.putInt(null, delta))
                     return false;
 
                 commState.idx++;
@@ -97,7 +97,7 @@ public class JobStealingRequest extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 4)
                     return false;
 
-                delta = commState.getInt();
+                delta = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 9ba7c45..16d161c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -15,13 +15,12 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.marshaller.*;
-import org.apache.ignite.product.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.thread.*;
 import org.gridgain.grid.*;
 import org.gridgain.grid.kernal.managers.eventstorage.*;
-import org.apache.ignite.spi.communication.*;
 import org.gridgain.grid.util.*;
 import org.gridgain.grid.util.direct.*;
 import org.gridgain.grid.util.future.*;
@@ -324,13 +323,6 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
 
                     ClusterNode locNode = getSpiContext().localNode();
 
-                    IgniteProductVersion locVer = locNode.version();
-
-                    IgniteProductVersion rmtVer = rmtNode.version();
-
-                    if (!locVer.equals(rmtVer))
-                        ses.addMeta(GridNioServer.DIFF_VER_NODE_ID_META_KEY, sndId);
-
                     if (ses.remoteAddress() == null)
                         return;
 
@@ -790,87 +782,6 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
         }
     };
 
-    /** Message reader. */
-    private final GridNioMessageReader msgReader = new GridNioMessageReader() {
-        /** */
-        private GridTcpMessageFactory msgFactory;
-
-        @Override public boolean read(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, ByteBuffer buf) {
-            assert msg != null;
-            assert buf != null;
-
-            msg.messageReader(this, nodeId);
-
-            boolean finished = msg.readFrom(buf);
-
-            if (finished && nodeId != null)
-                finished = getSpiContext().readDelta(nodeId, msg.getClass(), buf);
-
-            return finished;
-        }
-
-        @Nullable @Override public GridTcpMessageFactory messageFactory() {
-            if (msgFactory == null)
-                msgFactory = getSpiContext().messageFactory();
-
-            return msgFactory;
-        }
-    };
-
-    /** Message writer. */
-    private final GridNioMessageWriter msgWriter = new GridNioMessageWriter() {
-        @Override public boolean write(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, ByteBuffer buf) {
-            assert msg != null;
-            assert buf != null;
-
-            msg.messageWriter(this, nodeId);
-
-            boolean finished = msg.writeTo(buf);
-
-            if (finished && nodeId != null)
-                finished = getSpiContext().writeDelta(nodeId, msg, buf);
-
-            return finished;
-        }
-
-        @Override public int writeFully(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, OutputStream out,
-            ByteBuffer buf) throws IOException {
-            assert msg != null;
-            assert out != null;
-            assert buf != null;
-            assert buf.hasArray();
-
-            msg.messageWriter(this, nodeId);
-
-            boolean finished = false;
-            int cnt = 0;
-
-            while (!finished) {
-                finished = msg.writeTo(buf);
-
-                out.write(buf.array(), 0, buf.position());
-
-                cnt += buf.position();
-
-                buf.clear();
-            }
-
-            if (nodeId != null) {
-                while (!finished) {
-                    finished = getSpiContext().writeDelta(nodeId, msg.getClass(), buf);
-
-                    out.write(buf.array(), 0, buf.position());
-
-                    cnt += buf.position();
-
-                    buf.clear();
-                }
-            }
-
-            return cnt;
-        }
-    };
-
     /**
      * Sets address resolver.
      *
@@ -1564,9 +1475,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                         .sendQueueLimit(msgQueueLimit)
                         .directMode(true)
                         .metricsListener(metricsLsnr)
-                        .messageWriter(msgWriter)
                         .writeTimeout(sockWriteTimeout)
-                        .filters(new GridNioCodecFilter(new GridDirectParser(msgReader, this), log, true),
+                        .filters(new GridNioCodecFilter(new GridDirectParser(this), log, true),
                             new GridConnectionBytesVerifyFilter(log))
                         .build();
 
@@ -1925,7 +1835,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
             GridCommunicationClient client;
 
             try {
-                client = new GridShmemCommunicationClient(metricsLsnr, port, connTimeout, log, msgWriter);
+                client = new GridShmemCommunicationClient(metricsLsnr, port, connTimeout, log);
             }
             catch (IgniteCheckedException e) {
                 // Reconnect for the second time, if connection is not established.
@@ -2066,19 +1976,10 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                             recoveryDesc.release();
                     }
 
-                    UUID diffVerNodeId = null;
-
-                    IgniteProductVersion locVer = getSpiContext().localNode().version();
-                    IgniteProductVersion rmtVer = node.version();
-
-                    if (!locVer.equals(rmtVer))
-                        diffVerNodeId = node.id();
-
                     try {
                         Map<Integer, Object> meta = new HashMap<>();
 
                         meta.put(NODE_ID_META, node.id());
-                        meta.put(GridNioServer.DIFF_VER_NODE_ID_META_KEY, diffVerNodeId);
 
                         if (recoveryDesc != null) {
                             recoveryDesc.onHandshake(rcvCnt);
@@ -2502,9 +2403,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                     metricsLsnr,
                     log,
                     endpoint,
-                    msgWriter,
                     srvLsnr,
-                    new GridNioCodecFilter(new GridDirectParser(msgReader, TcpCommunicationSpi.this), log, true),
+                    new GridNioCodecFilter(new GridDirectParser(TcpCommunicationSpi.this), log, true),
                     new GridConnectionBytesVerifyFilter(log)
                 );
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/client/impl/connection/GridClientConnectionManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/gridgain/client/impl/connection/GridClientConnectionManagerAdapter.java
index a5a27a6..56700e7 100644
--- a/modules/core/src/main/java/org/gridgain/client/impl/connection/GridClientConnectionManagerAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/client/impl/connection/GridClientConnectionManagerAdapter.java
@@ -11,12 +11,11 @@ package org.gridgain.client.impl.connection;
 
 import org.apache.ignite.*;
 import org.apache.ignite.logger.java.*;
+import org.apache.ignite.plugin.security.*;
 import org.gridgain.client.*;
 import org.gridgain.client.impl.*;
 import org.gridgain.client.util.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.kernal.processors.rest.client.message.*;
-import org.apache.ignite.plugin.security.*;
 import org.gridgain.grid.util.direct.*;
 import org.gridgain.grid.util.nio.*;
 import org.gridgain.grid.util.nio.ssl.*;
@@ -88,44 +87,6 @@ abstract class GridClientConnectionManagerAdapter implements GridClientConnectio
     /** Marshaller ID. */
     private final Byte marshId;
 
-    /** Message writer. */
-    @SuppressWarnings("FieldCanBeLocal")
-    private final GridNioMessageWriter msgWriter = new GridNioMessageWriter() {
-        @Override public boolean write(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, ByteBuffer buf) {
-            assert msg != null;
-            assert buf != null;
-
-            msg.messageWriter(this, nodeId);
-
-            return msg.writeTo(buf);
-        }
-
-        @Override public int writeFully(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg, OutputStream out,
-            ByteBuffer buf) throws IOException {
-            assert msg != null;
-            assert out != null;
-            assert buf != null;
-            assert buf.hasArray();
-
-            msg.messageWriter(this, nodeId);
-
-            boolean finished = false;
-            int cnt = 0;
-
-            while (!finished) {
-                finished = msg.writeTo(buf);
-
-                out.write(buf.array(), 0, buf.position());
-
-                cnt += buf.position();
-
-                buf.clear();
-            }
-
-            return cnt;
-        }
-    };
-
     /**
      * @param clientId Client ID.
      * @param sslCtx SSL context to enable secured connection or {@code null} to use unsecured one.
@@ -173,23 +134,7 @@ abstract class GridClientConnectionManagerAdapter implements GridClientConnectio
 
                 GridNioFilter[] filters;
 
-                GridNioMessageReader msgReader = new GridNioMessageReader() {
-                    @Override public boolean read(@Nullable UUID nodeId, GridTcpCommunicationMessageAdapter msg,
-                        ByteBuffer buf) {
-                        assert msg != null;
-                        assert buf != null;
-
-                        msg.messageReader(this, nodeId);
-
-                        return msg.readFrom(buf);
-                    }
-
-                    @Nullable @Override public GridTcpMessageFactory messageFactory() {
-                        return null;
-                    }
-                };
-
-                GridNioFilter codecFilter = new GridNioCodecFilter(new NioParser(msgReader), gridLog, true);
+                GridNioFilter codecFilter = new GridNioCodecFilter(new NioParser(), gridLog, true);
 
                 if (sslCtx != null) {
                     GridNioSslFilter sslFilter = new GridNioSslFilter(sslCtx, gridLog);
@@ -217,7 +162,6 @@ abstract class GridClientConnectionManagerAdapter implements GridClientConnectio
                     .socketSendBufferSize(0)
                     .idleTimeout(Long.MAX_VALUE)
                     .gridName("gridClient")
-                    .messageWriter(msgWriter)
                     .daemon(cfg.isDaemon())
                     .build();
 
@@ -702,18 +646,9 @@ abstract class GridClientConnectionManagerAdapter implements GridClientConnectio
         /** Message metadata key. */
         private static final int MSG_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
 
-        /** Message reader. */
-        private final GridNioMessageReader msgReader;
-
-        /**
-         * @param msgReader Message reader.
-         */
-        NioParser(GridNioMessageReader msgReader) {
-            this.msgReader = msgReader;
-        }
-
         /** {@inheritDoc} */
-        @Nullable @Override public Object decode(GridNioSession ses, ByteBuffer buf) throws IOException, IgniteCheckedException {
+        @Nullable @Override public Object decode(GridNioSession ses, ByteBuffer buf)
+            throws IOException, IgniteCheckedException {
             GridClientFutureAdapter<?> handshakeFut = ses.meta(GridClientNioTcpConnection.SES_META_HANDSHAKE);
 
             if (handshakeFut != null) {
@@ -736,7 +671,7 @@ abstract class GridClientConnectionManagerAdapter implements GridClientConnectio
             boolean finished = false;
 
             if (buf.hasRemaining())
-                finished = msgReader.read(null, msg, buf);
+                finished = msg.readFrom(buf);
 
             if (finished)
                 return msg;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java
index 90dc740..1c0e1a4 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobCancelRequest.java
@@ -126,7 +126,7 @@ public class GridJobCancelRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -134,19 +134,19 @@ public class GridJobCancelRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(jobId))
+                if (!commState.putGridUuid(null, jobId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(sesId))
+                if (!commState.putGridUuid(null, sesId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(sys))
+                if (!commState.putBoolean(null, sys))
                     return false;
 
                 commState.idx++;
@@ -163,7 +163,7 @@ public class GridJobCancelRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid jobId0 = commState.getGridUuid();
+                IgniteUuid jobId0 = commState.getGridUuid(null);
 
                 if (jobId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -173,7 +173,7 @@ public class GridJobCancelRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                IgniteUuid sesId0 = commState.getGridUuid();
+                IgniteUuid sesId0 = commState.getGridUuid(null);
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -186,7 +186,7 @@ public class GridJobCancelRequest extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                sys = commState.getBoolean();
+                sys = commState.getBoolean(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java
index 12f7d8f..2e3eba7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequest.java
@@ -449,7 +449,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -457,61 +457,61 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(clsLdrId))
+                if (!commState.putGridUuid(null, clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putString(cpSpi))
+                if (!commState.putString(null, cpSpi))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(createTime))
+                if (!commState.putLong(null, createTime))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putEnum(depMode))
+                if (!commState.putEnum(null, depMode))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putBoolean(dynamicSiblings))
+                if (!commState.putBoolean(null, dynamicSiblings))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putBoolean(forceLocDep))
+                if (!commState.putBoolean(null, forceLocDep))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putBoolean(internal))
+                if (!commState.putBoolean(null, internal))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putByteArray(jobAttrsBytes))
+                if (!commState.putByteArray(null, jobAttrsBytes))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putByteArray(jobBytes))
+                if (!commState.putByteArray(null, jobBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putGridUuid(jobId))
+                if (!commState.putGridUuid(null, jobId))
                     return false;
 
                 commState.idx++;
@@ -519,7 +519,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
             case 10:
                 if (ldrParticipants != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(ldrParticipants.size()))
+                        if (!commState.putInt(null, ldrParticipants.size()))
                             return false;
 
                         commState.it = ldrParticipants.entrySet().iterator();
@@ -532,13 +532,13 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                         Map.Entry<UUID, IgniteUuid> e = (Map.Entry<UUID, IgniteUuid>)commState.cur;
 
                         if (!commState.keyDone) {
-                            if (!commState.putUuid(e.getKey()))
+                            if (!commState.putUuid(null, e.getKey()))
                                 return false;
 
                             commState.keyDone = true;
                         }
 
-                        if (!commState.putGridUuid(e.getValue()))
+                        if (!commState.putGridUuid(null, e.getValue()))
                             return false;
 
                         commState.keyDone = false;
@@ -548,56 +548,56 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putByteArray(sesAttrsBytes))
+                if (!commState.putByteArray(null, sesAttrsBytes))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(sesFullSup))
+                if (!commState.putBoolean(null, sesFullSup))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putGridUuid(sesId))
+                if (!commState.putGridUuid(null, sesId))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putByteArray(siblingsBytes))
+                if (!commState.putByteArray(null, siblingsBytes))
                     return false;
 
                 commState.idx++;
 
             case 15:
-                if (!commState.putLong(startTaskTime))
+                if (!commState.putLong(null, startTaskTime))
                     return false;
 
                 commState.idx++;
 
             case 16:
-                if (!commState.putString(taskClsName))
+                if (!commState.putString(null, taskClsName))
                     return false;
 
                 commState.idx++;
 
             case 17:
-                if (!commState.putString(taskName))
+                if (!commState.putString(null, taskName))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putLong(timeout))
+                if (!commState.putLong(null, timeout))
                     return false;
 
                 commState.idx++;
@@ -605,7 +605,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
             case 19:
                 if (top != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(top.size()))
+                        if (!commState.putInt(null, top.size()))
                             return false;
 
                         commState.it = top.iterator();
@@ -615,7 +615,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putUuid((UUID)commState.cur))
+                        if (!commState.putUuid(null, (UUID)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -623,14 +623,14 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 20:
-                if (!commState.putString(userVer))
+                if (!commState.putString(null, userVer))
                     return false;
 
                 commState.idx++;
@@ -647,7 +647,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid clsLdrId0 = commState.getGridUuid();
+                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -657,7 +657,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 1:
-                String cpSpi0 = commState.getString();
+                String cpSpi0 = commState.getString(null);
 
                 if (cpSpi0 == STR_NOT_READ)
                     return false;
@@ -670,7 +670,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 8)
                     return false;
 
-                createTime = commState.getLong();
+                createTime = commState.getLong(null);
 
                 commState.idx++;
 
@@ -678,7 +678,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte();
+                byte depMode0 = commState.getByte(null);
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -688,7 +688,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                dynamicSiblings = commState.getBoolean();
+                dynamicSiblings = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -696,7 +696,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                forceLocDep = commState.getBoolean();
+                forceLocDep = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -704,12 +704,12 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                internal = commState.getBoolean();
+                internal = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 7:
-                byte[] jobAttrsBytes0 = commState.getByteArray();
+                byte[] jobAttrsBytes0 = commState.getByteArray(null);
 
                 if (jobAttrsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -719,7 +719,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 8:
-                byte[] jobBytes0 = commState.getByteArray();
+                byte[] jobBytes0 = commState.getByteArray(null);
 
                 if (jobBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -729,7 +729,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 9:
-                IgniteUuid jobId0 = commState.getGridUuid();
+                IgniteUuid jobId0 = commState.getGridUuid(null);
 
                 if (jobId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -743,7 +743,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -752,7 +752,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
-                            UUID _val = commState.getUuid();
+                            UUID _val = commState.getUuid(null);
 
                             if (_val == UUID_NOT_READ)
                                 return false;
@@ -761,7 +761,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                             commState.keyDone = true;
                         }
 
-                        IgniteUuid _val = commState.getGridUuid();
+                        IgniteUuid _val = commState.getGridUuid(null);
 
                         if (_val == GRID_UUID_NOT_READ)
                             return false;
@@ -781,7 +781,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 11:
-                byte[] sesAttrsBytes0 = commState.getByteArray();
+                byte[] sesAttrsBytes0 = commState.getByteArray(null);
 
                 if (sesAttrsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -794,12 +794,12 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 1)
                     return false;
 
-                sesFullSup = commState.getBoolean();
+                sesFullSup = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 13:
-                IgniteUuid sesId0 = commState.getGridUuid();
+                IgniteUuid sesId0 = commState.getGridUuid(null);
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -809,7 +809,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 14:
-                byte[] siblingsBytes0 = commState.getByteArray();
+                byte[] siblingsBytes0 = commState.getByteArray(null);
 
                 if (siblingsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -822,12 +822,12 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 8)
                     return false;
 
-                startTaskTime = commState.getLong();
+                startTaskTime = commState.getLong(null);
 
                 commState.idx++;
 
             case 16:
-                String taskClsName0 = commState.getString();
+                String taskClsName0 = commState.getString(null);
 
                 if (taskClsName0 == STR_NOT_READ)
                     return false;
@@ -837,7 +837,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 17:
-                String taskName0 = commState.getString();
+                String taskName0 = commState.getString(null);
 
                 if (taskName0 == STR_NOT_READ)
                     return false;
@@ -850,7 +850,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong();
+                timeout = commState.getLong(null);
 
                 commState.idx++;
 
@@ -859,7 +859,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -867,7 +867,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                         top = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        UUID _val = commState.getUuid();
+                        UUID _val = commState.getUuid(null);
 
                         if (_val == UUID_NOT_READ)
                             return false;
@@ -884,7 +884,7 @@ public class GridJobExecuteRequest extends GridTcpCommunicationMessageAdapter im
                 commState.idx++;
 
             case 20:
-                String userVer0 = commState.getString();
+                String userVer0 = commState.getString(null);
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java
index 7793224..cf70842 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteRequestV2.java
@@ -129,7 +129,7 @@ public class GridJobExecuteRequestV2 extends GridJobExecuteRequest {
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -137,7 +137,7 @@ public class GridJobExecuteRequestV2 extends GridJobExecuteRequest {
 
         switch (commState.idx) {
             case 21:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
@@ -156,7 +156,7 @@ public class GridJobExecuteRequestV2 extends GridJobExecuteRequest {
 
         switch (commState.idx) {
             case 21:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java
index b605753..88e7483 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobExecuteResponse.java
@@ -221,7 +221,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -229,43 +229,43 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(gridExBytes))
+                if (!commState.putByteArray(null, gridExBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(isCancelled))
+                if (!commState.putBoolean(null, isCancelled))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putByteArray(jobAttrsBytes))
+                if (!commState.putByteArray(null, jobAttrsBytes))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putGridUuid(jobId))
+                if (!commState.putGridUuid(null, jobId))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putUuid(nodeId))
+                if (!commState.putUuid(null, nodeId))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putByteArray(resBytes))
+                if (!commState.putByteArray(null, resBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putGridUuid(sesId))
+                if (!commState.putGridUuid(null, sesId))
                     return false;
 
                 commState.idx++;
@@ -282,7 +282,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                byte[] gridExBytes0 = commState.getByteArray();
+                byte[] gridExBytes0 = commState.getByteArray(null);
 
                 if (gridExBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -295,12 +295,12 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 if (buf.remaining() < 1)
                     return false;
 
-                isCancelled = commState.getBoolean();
+                isCancelled = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 2:
-                byte[] jobAttrsBytes0 = commState.getByteArray();
+                byte[] jobAttrsBytes0 = commState.getByteArray(null);
 
                 if (jobAttrsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -310,7 +310,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 3:
-                IgniteUuid jobId0 = commState.getGridUuid();
+                IgniteUuid jobId0 = commState.getGridUuid(null);
 
                 if (jobId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -320,7 +320,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 4:
-                UUID nodeId0 = commState.getUuid();
+                UUID nodeId0 = commState.getUuid(null);
 
                 if (nodeId0 == UUID_NOT_READ)
                     return false;
@@ -330,7 +330,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 5:
-                byte[] resBytes0 = commState.getByteArray();
+                byte[] resBytes0 = commState.getByteArray(null);
 
                 if (resBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -340,7 +340,7 @@ public class GridJobExecuteResponse extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 6:
-                IgniteUuid sesId0 = commState.getGridUuid();
+                IgniteUuid sesId0 = commState.getGridUuid(null);
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java
index 663a122..a852d23 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsRequest.java
@@ -100,7 +100,7 @@ public class GridJobSiblingsRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -108,13 +108,13 @@ public class GridJobSiblingsRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(sesId))
+                if (!commState.putGridUuid(null, sesId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putByteArray(topicBytes))
+                if (!commState.putByteArray(null, topicBytes))
                     return false;
 
                 commState.idx++;
@@ -131,7 +131,7 @@ public class GridJobSiblingsRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid sesId0 = commState.getGridUuid();
+                IgniteUuid sesId0 = commState.getGridUuid(null);
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -141,7 +141,7 @@ public class GridJobSiblingsRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                byte[] topicBytes0 = commState.getByteArray();
+                byte[] topicBytes0 = commState.getByteArray(null);
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java
index b72b03d..55e17f5 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridJobSiblingsResponse.java
@@ -92,7 +92,7 @@ public class GridJobSiblingsResponse extends GridTcpCommunicationMessageAdapter
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -100,7 +100,7 @@ public class GridJobSiblingsResponse extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(siblingsBytes))
+                if (!commState.putByteArray(null, siblingsBytes))
                     return false;
 
                 commState.idx++;
@@ -117,7 +117,7 @@ public class GridJobSiblingsResponse extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                byte[] siblingsBytes0 = commState.getByteArray();
+                byte[] siblingsBytes0 = commState.getByteArray(null);
 
                 if (siblingsBytes0 == BYTE_ARR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java
index 226ebc1..15ae1ad 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskCancelRequest.java
@@ -75,7 +75,7 @@ public class GridTaskCancelRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -83,7 +83,7 @@ public class GridTaskCancelRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(sesId))
+                if (!commState.putGridUuid(null, sesId))
                     return false;
 
                 commState.idx++;
@@ -100,7 +100,7 @@ public class GridTaskCancelRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid sesId0 = commState.getGridUuid();
+                IgniteUuid sesId0 = commState.getGridUuid(null);
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java
index f9f79e0..86457da 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/GridTaskSessionRequest.java
@@ -115,7 +115,7 @@ public class GridTaskSessionRequest extends GridTcpCommunicationMessageAdapter i
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -123,19 +123,19 @@ public class GridTaskSessionRequest extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(attrsBytes))
+                if (!commState.putByteArray(null, attrsBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(jobId))
+                if (!commState.putGridUuid(null, jobId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putGridUuid(sesId))
+                if (!commState.putGridUuid(null, sesId))
                     return false;
 
                 commState.idx++;
@@ -152,7 +152,7 @@ public class GridTaskSessionRequest extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                byte[] attrsBytes0 = commState.getByteArray();
+                byte[] attrsBytes0 = commState.getByteArray(null);
 
                 if (attrsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -162,7 +162,7 @@ public class GridTaskSessionRequest extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 1:
-                IgniteUuid jobId0 = commState.getGridUuid();
+                IgniteUuid jobId0 = commState.getGridUuid(null);
 
                 if (jobId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -172,7 +172,7 @@ public class GridTaskSessionRequest extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 2:
-                IgniteUuid sesId0 = commState.getGridUuid();
+                IgniteUuid sesId0 = commState.getGridUuid(null);
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java
index d054a73..c7ca93c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointRequest.java
@@ -100,7 +100,7 @@ public class GridCheckpointRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -108,19 +108,19 @@ public class GridCheckpointRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putString(cpSpi))
+                if (!commState.putString(null, cpSpi))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putString(key))
+                if (!commState.putString(null, key))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putGridUuid(sesId))
+                if (!commState.putGridUuid(null, sesId))
                     return false;
 
                 commState.idx++;
@@ -137,7 +137,7 @@ public class GridCheckpointRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                String cpSpi0 = commState.getString();
+                String cpSpi0 = commState.getString(null);
 
                 if (cpSpi0 == STR_NOT_READ)
                     return false;
@@ -147,7 +147,7 @@ public class GridCheckpointRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                String key0 = commState.getString();
+                String key0 = commState.getString(null);
 
                 if (key0 == STR_NOT_READ)
                     return false;
@@ -157,7 +157,7 @@ public class GridCheckpointRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 2:
-                IgniteUuid sesId0 = commState.getGridUuid();
+                IgniteUuid sesId0 = commState.getGridUuid(null);
 
                 if (sesId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java
index dc5c91c..d9c11a5 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoMessage.java
@@ -214,7 +214,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -222,43 +222,43 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putMessage(msg))
+                if (!commState.putMessage(null, msg))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putLong(msgId))
+                if (!commState.putLong(null, msgId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putEnum(plc))
+                if (!commState.putEnum(null, plc))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putBoolean(skipOnTimeout))
+                if (!commState.putBoolean(null, skipOnTimeout))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putLong(timeout))
+                if (!commState.putLong(null, timeout))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putByteArray(topicBytes))
+                if (!commState.putByteArray(null, topicBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putInt(topicOrd))
+                if (!commState.putInt(null, topicOrd))
                     return false;
 
                 commState.idx++;
@@ -275,7 +275,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                Object msg0 = commState.getMessage();
+                Object msg0 = commState.getMessage(null);
 
                 if (msg0 == MSG_NOT_READ)
                     return false;
@@ -288,7 +288,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 8)
                     return false;
 
-                msgId = commState.getLong();
+                msgId = commState.getLong(null);
 
                 commState.idx++;
 
@@ -296,7 +296,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                byte plc0 = commState.getByte();
+                byte plc0 = commState.getByte(null);
 
                 plc = GridIoPolicy.fromOrdinal(plc0);
 
@@ -306,7 +306,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                skipOnTimeout = commState.getBoolean();
+                skipOnTimeout = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -314,12 +314,12 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 8)
                     return false;
 
-                timeout = commState.getLong();
+                timeout = commState.getLong(null);
 
                 commState.idx++;
 
             case 5:
-                byte[] topicBytes0 = commState.getByteArray();
+                byte[] topicBytes0 = commState.getByteArray(null);
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -332,7 +332,7 @@ public class GridIoMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 4)
                     return false;
 
-                topicOrd = commState.getInt();
+                topicOrd = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java
index 4b49798..2859016 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoUserMessage.java
@@ -226,7 +226,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -234,25 +234,25 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(bodyBytes))
+                if (!commState.putByteArray(null, bodyBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(clsLdrId))
+                if (!commState.putGridUuid(null, clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putString(depClsName))
+                if (!commState.putString(null, depClsName))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putEnum(depMode))
+                if (!commState.putEnum(null, depMode))
                     return false;
 
                 commState.idx++;
@@ -260,7 +260,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
             case 4:
                 if (ldrParties != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(ldrParties.size()))
+                        if (!commState.putInt(null, ldrParties.size()))
                             return false;
 
                         commState.it = ldrParties.entrySet().iterator();
@@ -273,13 +273,13 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                         Map.Entry<UUID, IgniteUuid> e = (Map.Entry<UUID, IgniteUuid>)commState.cur;
 
                         if (!commState.keyDone) {
-                            if (!commState.putUuid(e.getKey()))
+                            if (!commState.putUuid(null, e.getKey()))
                                 return false;
 
                             commState.keyDone = true;
                         }
 
-                        if (!commState.putGridUuid(e.getValue()))
+                        if (!commState.putGridUuid(null, e.getValue()))
                             return false;
 
                         commState.keyDone = false;
@@ -289,20 +289,20 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putByteArray(topicBytes))
+                if (!commState.putByteArray(null, topicBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putString(userVer))
+                if (!commState.putString(null, userVer))
                     return false;
 
                 commState.idx++;
@@ -319,7 +319,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                byte[] bodyBytes0 = commState.getByteArray();
+                byte[] bodyBytes0 = commState.getByteArray(null);
 
                 if (bodyBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -329,7 +329,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                IgniteUuid clsLdrId0 = commState.getGridUuid();
+                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -339,7 +339,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 2:
-                String depClsName0 = commState.getString();
+                String depClsName0 = commState.getString(null);
 
                 if (depClsName0 == STR_NOT_READ)
                     return false;
@@ -352,7 +352,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte();
+                byte depMode0 = commState.getByte(null);
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -363,7 +363,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -372,7 +372,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
-                            UUID _val = commState.getUuid();
+                            UUID _val = commState.getUuid(null);
 
                             if (_val == UUID_NOT_READ)
                                 return false;
@@ -381,7 +381,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                             commState.keyDone = true;
                         }
 
-                        IgniteUuid _val = commState.getGridUuid();
+                        IgniteUuid _val = commState.getGridUuid(null);
 
                         if (_val == GRID_UUID_NOT_READ)
                             return false;
@@ -401,7 +401,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 5:
-                byte[] topicBytes0 = commState.getByteArray();
+                byte[] topicBytes0 = commState.getByteArray(null);
 
                 if (topicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -411,7 +411,7 @@ public class GridIoUserMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 6:
-                String userVer0 = commState.getString();
+                String userVer0 = commState.getString(null);
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java
index e978940..c294a8c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentInfoBean.java
@@ -156,7 +156,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -164,19 +164,19 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(clsLdrId))
+                if (!commState.putGridUuid(null, clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putEnum(depMode))
+                if (!commState.putEnum(null, depMode))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(locDepOwner))
+                if (!commState.putBoolean(null, locDepOwner))
                     return false;
 
                 commState.idx++;
@@ -184,7 +184,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
             case 3:
                 if (participants != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(participants.size()))
+                        if (!commState.putInt(null, participants.size()))
                             return false;
 
                         commState.it = participants.entrySet().iterator();
@@ -197,13 +197,13 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                         Map.Entry<UUID, IgniteUuid> e = (Map.Entry<UUID, IgniteUuid>)commState.cur;
 
                         if (!commState.keyDone) {
-                            if (!commState.putUuid(e.getKey()))
+                            if (!commState.putUuid(null, e.getKey()))
                                 return false;
 
                             commState.keyDone = true;
                         }
 
-                        if (!commState.putGridUuid(e.getValue()))
+                        if (!commState.putGridUuid(null, e.getValue()))
                             return false;
 
                         commState.keyDone = false;
@@ -213,14 +213,14 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putString(userVer))
+                if (!commState.putString(null, userVer))
                     return false;
 
                 commState.idx++;
@@ -237,7 +237,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid clsLdrId0 = commState.getGridUuid();
+                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -250,7 +250,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte();
+                byte depMode0 = commState.getByte(null);
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -260,7 +260,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                 if (buf.remaining() < 1)
                     return false;
 
-                locDepOwner = commState.getBoolean();
+                locDepOwner = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -269,7 +269,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -278,7 +278,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
-                            UUID _val = commState.getUuid();
+                            UUID _val = commState.getUuid(null);
 
                             if (_val == UUID_NOT_READ)
                                 return false;
@@ -287,7 +287,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                             commState.keyDone = true;
                         }
 
-                        IgniteUuid _val = commState.getGridUuid();
+                        IgniteUuid _val = commState.getGridUuid(null);
 
                         if (_val == GRID_UUID_NOT_READ)
                             return false;
@@ -307,7 +307,7 @@ public class GridDeploymentInfoBean extends GridTcpCommunicationMessageAdapter i
                 commState.idx++;
 
             case 4:
-                String userVer0 = commState.getString();
+                String userVer0 = commState.getString(null);
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java
index 6565ea0..ffcd805 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentRequest.java
@@ -175,7 +175,7 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -183,13 +183,13 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putBoolean(isUndeploy))
+                if (!commState.putBoolean(null, isUndeploy))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(ldrId))
+                if (!commState.putGridUuid(null, ldrId))
                     return false;
 
                 commState.idx++;
@@ -197,7 +197,7 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
             case 2:
                 if (nodeIds != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(nodeIds.size()))
+                        if (!commState.putInt(null, nodeIds.size()))
                             return false;
 
                         commState.it = nodeIds.iterator();
@@ -207,7 +207,7 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putUuid((UUID)commState.cur))
+                        if (!commState.putUuid(null, (UUID)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -215,20 +215,20 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putByteArray(resTopicBytes))
+                if (!commState.putByteArray(null, resTopicBytes))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putString(rsrcName))
+                if (!commState.putString(null, rsrcName))
                     return false;
 
                 commState.idx++;
@@ -248,12 +248,12 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                isUndeploy = commState.getBoolean();
+                isUndeploy = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 1:
-                IgniteUuid ldrId0 = commState.getGridUuid();
+                IgniteUuid ldrId0 = commState.getGridUuid(null);
 
                 if (ldrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -267,7 +267,7 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -275,7 +275,7 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                         nodeIds = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        UUID _val = commState.getUuid();
+                        UUID _val = commState.getUuid(null);
 
                         if (_val == UUID_NOT_READ)
                             return false;
@@ -292,7 +292,7 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 3:
-                byte[] resTopicBytes0 = commState.getByteArray();
+                byte[] resTopicBytes0 = commState.getByteArray(null);
 
                 if (resTopicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -302,7 +302,7 @@ public class GridDeploymentRequest extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 4:
-                String rsrcName0 = commState.getString();
+                String rsrcName0 = commState.getString(null);
 
                 if (rsrcName0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java
index ea30da8..3d8e7ac 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentResponse.java
@@ -123,7 +123,7 @@ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -131,19 +131,19 @@ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArrayList(byteSrc))
+                if (!commState.putByteArrayList(null, byteSrc))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putString(errMsg))
+                if (!commState.putString(null, errMsg))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(success))
+                if (!commState.putBoolean(null, success))
                     return false;
 
                 commState.idx++;
@@ -160,7 +160,7 @@ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                GridByteArrayList byteSrc0 = commState.getByteArrayList();
+                GridByteArrayList byteSrc0 = commState.getByteArrayList(null);
 
                 if (byteSrc0 == BYTE_ARR_LIST_NOT_READ)
                     return false;
@@ -170,7 +170,7 @@ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                String errMsg0 = commState.getString();
+                String errMsg0 = commState.getString(null);
 
                 if (errMsg0 == STR_NOT_READ)
                     return false;
@@ -183,7 +183,7 @@ public class GridDeploymentResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                success = commState.getBoolean();
+                success = commState.getBoolean(null);
 
                 commState.idx++;
 


[03/20] incubator-ignite git commit: IGNITE-61 - Portable format in direct marshalling

Posted by vk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java
index 7a0c2fd..f5476fc 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockResponse.java
@@ -202,7 +202,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -212,7 +212,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
             case 11:
                 if (dhtVers != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(dhtVers.length))
+                        if (!commState.putInt(null, dhtVers.length))
                             return false;
 
                         commState.it = arrayIterator(dhtVers);
@@ -222,7 +222,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -230,14 +230,14 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBooleanArray(filterRes))
+                if (!commState.putBooleanArray(null, filterRes))
                     return false;
 
                 commState.idx++;
@@ -245,7 +245,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
             case 13:
                 if (mappedVers != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(mappedVers.length))
+                        if (!commState.putInt(null, mappedVers.length))
                             return false;
 
                         commState.it = arrayIterator(mappedVers);
@@ -255,7 +255,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -263,14 +263,14 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
@@ -278,7 +278,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
             case 15:
                 if (pending != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(pending.size()))
+                        if (!commState.putInt(null, pending.size()))
                             return false;
 
                         commState.it = pending.iterator();
@@ -288,7 +288,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -296,7 +296,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -321,7 +321,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -329,7 +329,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                         dhtVers = new GridCacheVersion[commState.readSize];
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;
@@ -346,7 +346,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                 commState.idx++;
 
             case 12:
-                boolean[] filterRes0 = commState.getBooleanArray();
+                boolean[] filterRes0 = commState.getBooleanArray(null);
 
                 if (filterRes0 == BOOLEAN_ARR_NOT_READ)
                     return false;
@@ -360,7 +360,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -368,7 +368,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                         mappedVers = new GridCacheVersion[commState.readSize];
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;
@@ -385,7 +385,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                 commState.idx++;
 
             case 14:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -399,7 +399,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -407,7 +407,7 @@ public class GridNearLockResponse<K, V> extends GridDistributedLockResponse<K, V
                         pending = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java
index 90cdfe6..b63b038 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishRequest.java
@@ -168,7 +168,7 @@ public class GridNearTxFinishRequest<K, V> extends GridDistributedTxFinishReques
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -176,31 +176,31 @@ public class GridNearTxFinishRequest<K, V> extends GridDistributedTxFinishReques
 
         switch (commState.idx) {
             case 20:
-                if (!commState.putBoolean(explicitLock))
+                if (!commState.putBoolean(null, explicitLock))
                     return false;
 
                 commState.idx++;
 
             case 21:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 23:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 24:
-                if (!commState.putInt(taskNameHash))
+                if (!commState.putInt(null, taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -223,12 +223,12 @@ public class GridNearTxFinishRequest<K, V> extends GridDistributedTxFinishReques
                 if (buf.remaining() < 1)
                     return false;
 
-                explicitLock = commState.getBoolean();
+                explicitLock = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 21:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -241,12 +241,12 @@ public class GridNearTxFinishRequest<K, V> extends GridDistributedTxFinishReques
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
             case 23:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -259,7 +259,7 @@ public class GridNearTxFinishRequest<K, V> extends GridDistributedTxFinishReques
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt();
+                taskNameHash = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java
index 52825bc..b093106 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxFinishResponse.java
@@ -135,7 +135,7 @@ public class GridNearTxFinishResponse<K, V> extends GridDistributedTxFinishRespo
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -143,19 +143,19 @@ public class GridNearTxFinishResponse<K, V> extends GridDistributedTxFinishRespo
 
         switch (commState.idx) {
             case 5:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(nearThreadId))
+                if (!commState.putLong(null, nearThreadId))
                     return false;
 
                 commState.idx++;
@@ -175,7 +175,7 @@ public class GridNearTxFinishResponse<K, V> extends GridDistributedTxFinishRespo
 
         switch (commState.idx) {
             case 5:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -185,7 +185,7 @@ public class GridNearTxFinishResponse<K, V> extends GridDistributedTxFinishRespo
                 commState.idx++;
 
             case 6:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -198,7 +198,7 @@ public class GridNearTxFinishResponse<K, V> extends GridDistributedTxFinishRespo
                 if (buf.remaining() < 8)
                     return false;
 
-                nearThreadId = commState.getLong();
+                nearThreadId = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
index 30b7aef..7decc5e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareRequest.java
@@ -235,7 +235,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -243,13 +243,13 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
 
         switch (commState.idx) {
             case 21:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
 
             case 22:
-                if (!commState.putBoolean(last))
+                if (!commState.putBoolean(null, last))
                     return false;
 
                 commState.idx++;
@@ -257,7 +257,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
             case 23:
                 if (lastBackups != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(lastBackups.size()))
+                        if (!commState.putInt(null, lastBackups.size()))
                             return false;
 
                         commState.it = lastBackups.iterator();
@@ -267,7 +267,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putUuid((UUID)commState.cur))
+                        if (!commState.putUuid(null, (UUID)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -275,38 +275,38 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 24:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
 
             case 25:
-                if (!commState.putBoolean(near))
+                if (!commState.putBoolean(null, near))
                     return false;
 
                 commState.idx++;
 
             case 26:
-                if (!commState.putLong(topVer))
+                if (!commState.putLong(null, topVer))
                     return false;
 
                 commState.idx++;
 
             case 27:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 28:
-                if (!commState.putInt(taskNameHash))
+                if (!commState.putInt(null, taskNameHash))
                     return false;
 
                 commState.idx++;
@@ -326,7 +326,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
 
         switch (commState.idx) {
             case 21:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -339,7 +339,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 if (buf.remaining() < 1)
                     return false;
 
-                last = commState.getBoolean();
+                last = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -348,7 +348,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -356,7 +356,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                         lastBackups = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        UUID _val = commState.getUuid();
+                        UUID _val = commState.getUuid(null);
 
                         if (_val == UUID_NOT_READ)
                             return false;
@@ -373,7 +373,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 commState.idx++;
 
             case 24:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -386,7 +386,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 if (buf.remaining() < 1)
                     return false;
 
-                near = commState.getBoolean();
+                near = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -394,12 +394,12 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 if (buf.remaining() < 8)
                     return false;
 
-                topVer = commState.getLong();
+                topVer = commState.getLong(null);
 
                 commState.idx++;
 
             case 27:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -412,7 +412,7 @@ public class GridNearTxPrepareRequest<K, V> extends GridDistributedTxPrepareRequ
                 if (buf.remaining() < 4)
                     return false;
 
-                taskNameHash = commState.getInt();
+                taskNameHash = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
index 08d7967..ea475a9 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxPrepareResponse.java
@@ -247,7 +247,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -255,13 +255,13 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
 
         switch (commState.idx) {
             case 10:
-                if (!commState.putCacheVersion(dhtVer))
+                if (!commState.putCacheVersion(null, dhtVer))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putGridUuid(futId))
+                if (!commState.putGridUuid(null, futId))
                     return false;
 
                 commState.idx++;
@@ -269,7 +269,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
             case 12:
                 if (invalidParts != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(invalidParts.size()))
+                        if (!commState.putInt(null, invalidParts.size()))
                             return false;
 
                         commState.it = invalidParts.iterator();
@@ -279,7 +279,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putInt((int)commState.cur))
+                        if (!commState.putInt(null, (int)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -287,14 +287,14 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putGridUuid(miniId))
+                if (!commState.putGridUuid(null, miniId))
                     return false;
 
                 commState.idx++;
@@ -302,7 +302,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
             case 14:
                 if (ownedValsBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(ownedValsBytes.size()))
+                        if (!commState.putInt(null, ownedValsBytes.size()))
                             return false;
 
                         commState.it = ownedValsBytes.iterator();
@@ -312,7 +312,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -320,7 +320,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -329,7 +329,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
             case 15:
                 if (pending != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(pending.size()))
+                        if (!commState.putInt(null, pending.size()))
                             return false;
 
                         commState.it = pending.iterator();
@@ -339,7 +339,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putCacheVersion((GridCacheVersion)commState.cur))
+                        if (!commState.putCacheVersion(null, (GridCacheVersion)commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -347,7 +347,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
@@ -368,7 +368,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
 
         switch (commState.idx) {
             case 10:
-                GridCacheVersion dhtVer0 = commState.getCacheVersion();
+                GridCacheVersion dhtVer0 = commState.getCacheVersion(null);
 
                 if (dhtVer0 == CACHE_VER_NOT_READ)
                     return false;
@@ -378,7 +378,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                 commState.idx++;
 
             case 11:
-                IgniteUuid futId0 = commState.getGridUuid();
+                IgniteUuid futId0 = commState.getGridUuid(null);
 
                 if (futId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -392,7 +392,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -403,7 +403,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                         if (buf.remaining() < 4)
                             return false;
 
-                        int _val = commState.getInt();
+                        int _val = commState.getInt(null);
 
                         invalidParts.add((Integer)_val);
 
@@ -417,7 +417,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                 commState.idx++;
 
             case 13:
-                IgniteUuid miniId0 = commState.getGridUuid();
+                IgniteUuid miniId0 = commState.getGridUuid(null);
 
                 if (miniId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -431,7 +431,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -439,7 +439,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                         ownedValsBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -460,7 +460,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -468,7 +468,7 @@ public class GridNearTxPrepareResponse<K, V> extends GridDistributedTxPrepareRes
                         pending = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        GridCacheVersion _val = commState.getCacheVersion();
+                        GridCacheVersion _val = commState.getCacheVersion(null);
 
                         if (_val == CACHE_VER_NOT_READ)
                             return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearUnlockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearUnlockRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearUnlockRequest.java
index 818ba66..1e2fe21 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearUnlockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearUnlockRequest.java
@@ -63,7 +63,7 @@ public class GridNearUnlockRequest<K, V> extends GridDistributedUnlockRequest<K,
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java
index 2abaae2..4318df6 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryRequest.java
@@ -486,7 +486,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -494,115 +494,115 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
 
         switch (commState.idx) {
             case 3:
-                if (!commState.putBoolean(all))
+                if (!commState.putBoolean(null, all))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(argsBytes))
+                if (!commState.putByteArray(null, argsBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putString(cacheName))
+                if (!commState.putString(null, cacheName))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putBoolean(cancel))
+                if (!commState.putBoolean(null, cancel))
                     return false;
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putString(clause))
+                if (!commState.putString(null, clause))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putString(clsName))
+                if (!commState.putString(null, clsName))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putBoolean(fields))
+                if (!commState.putBoolean(null, fields))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putLong(id))
+                if (!commState.putLong(null, id))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putBoolean(incBackups))
+                if (!commState.putBoolean(null, incBackups))
                     return false;
 
                 commState.idx++;
 
             case 12:
-                if (!commState.putBoolean(incMeta))
+                if (!commState.putBoolean(null, incMeta))
                     return false;
 
                 commState.idx++;
 
             case 13:
-                if (!commState.putByteArray(keyValFilterBytes))
+                if (!commState.putByteArray(null, keyValFilterBytes))
                     return false;
 
                 commState.idx++;
 
             case 14:
-                if (!commState.putInt(pageSize))
+                if (!commState.putInt(null, pageSize))
                     return false;
 
                 commState.idx++;
 
             case 15:
-                if (!commState.putByteArray(prjFilterBytes))
+                if (!commState.putByteArray(null, prjFilterBytes))
                     return false;
 
                 commState.idx++;
 
             case 16:
-                if (!commState.putByteArray(rdcBytes))
+                if (!commState.putByteArray(null, rdcBytes))
                     return false;
 
                 commState.idx++;
 
             case 17:
-                if (!commState.putByteArray(transBytes))
+                if (!commState.putByteArray(null, transBytes))
                     return false;
 
                 commState.idx++;
 
             case 18:
-                if (!commState.putEnum(type))
+                if (!commState.putEnum(null, type))
                     return false;
 
                 commState.idx++;
 
             case 19:
-                if (!commState.putBoolean(keepPortable))
+                if (!commState.putBoolean(null, keepPortable))
                     return false;
 
                 commState.idx++;
 
             case 20:
-                if (!commState.putUuid(subjId))
+                if (!commState.putUuid(null, subjId))
                     return false;
 
                 commState.idx++;
 
             case 21:
-                if (!commState.putInt(taskHash))
+                if (!commState.putInt(null, taskHash))
                     return false;
 
                 commState.idx++;
@@ -625,12 +625,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                all = commState.getBoolean();
+                all = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 4:
-                byte[] argsBytes0 = commState.getByteArray();
+                byte[] argsBytes0 = commState.getByteArray(null);
 
                 if (argsBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -640,7 +640,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 commState.idx++;
 
             case 5:
-                String cacheName0 = commState.getString();
+                String cacheName0 = commState.getString(null);
 
                 if (cacheName0 == STR_NOT_READ)
                     return false;
@@ -653,12 +653,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                cancel = commState.getBoolean();
+                cancel = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 7:
-                String clause0 = commState.getString();
+                String clause0 = commState.getString(null);
 
                 if (clause0 == STR_NOT_READ)
                     return false;
@@ -668,7 +668,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 commState.idx++;
 
             case 8:
-                String clsName0 = commState.getString();
+                String clsName0 = commState.getString(null);
 
                 if (clsName0 == STR_NOT_READ)
                     return false;
@@ -681,7 +681,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                fields = commState.getBoolean();
+                fields = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -689,7 +689,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 8)
                     return false;
 
-                id = commState.getLong();
+                id = commState.getLong(null);
 
                 commState.idx++;
 
@@ -697,7 +697,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                incBackups = commState.getBoolean();
+                incBackups = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -705,12 +705,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                incMeta = commState.getBoolean();
+                incMeta = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 13:
-                byte[] keyValFilterBytes0 = commState.getByteArray();
+                byte[] keyValFilterBytes0 = commState.getByteArray(null);
 
                 if (keyValFilterBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -723,12 +723,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 4)
                     return false;
 
-                pageSize = commState.getInt();
+                pageSize = commState.getInt(null);
 
                 commState.idx++;
 
             case 15:
-                byte[] prjFilterBytes0 = commState.getByteArray();
+                byte[] prjFilterBytes0 = commState.getByteArray(null);
 
                 if (prjFilterBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -738,7 +738,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 commState.idx++;
 
             case 16:
-                byte[] rdcBytes0 = commState.getByteArray();
+                byte[] rdcBytes0 = commState.getByteArray(null);
 
                 if (rdcBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -748,7 +748,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 commState.idx++;
 
             case 17:
-                byte[] transBytes0 = commState.getByteArray();
+                byte[] transBytes0 = commState.getByteArray(null);
 
                 if (transBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -761,7 +761,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                byte type0 = commState.getByte();
+                byte type0 = commState.getByte(null);
 
                 type = GridCacheQueryType.fromOrdinal(type0);
 
@@ -771,12 +771,12 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 1)
                     return false;
 
-                keepPortable = commState.getBoolean();
+                keepPortable = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 20:
-                UUID subjId0 = commState.getUuid();
+                UUID subjId0 = commState.getUuid(null);
 
                 if (subjId0 == UUID_NOT_READ)
                     return false;
@@ -789,7 +789,7 @@ public class GridCacheQueryRequest<K, V> extends GridCacheMessage<K, V> implemen
                 if (buf.remaining() < 4)
                     return false;
 
-                taskHash = commState.getInt();
+                taskHash = commState.getInt(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java
index caf783c..0254c6d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/GridCacheQueryResponse.java
@@ -229,7 +229,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -239,7 +239,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
             case 3:
                 if (dataBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(dataBytes.size()))
+                        if (!commState.putInt(null, dataBytes.size()))
                             return false;
 
                         commState.it = dataBytes.iterator();
@@ -249,7 +249,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -257,26 +257,26 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putBoolean(fields))
+                if (!commState.putBoolean(null, fields))
                     return false;
 
                 commState.idx++;
 
             case 6:
-                if (!commState.putBoolean(finished))
+                if (!commState.putBoolean(null, finished))
                     return false;
 
                 commState.idx++;
@@ -284,7 +284,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
             case 7:
                 if (metaDataBytes != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(metaDataBytes.size()))
+                        if (!commState.putInt(null, metaDataBytes.size()))
                             return false;
 
                         commState.it = metaDataBytes.iterator();
@@ -294,7 +294,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                         if (commState.cur == NULL)
                             commState.cur = commState.it.next();
 
-                        if (!commState.putByteArray((byte[])commState.cur))
+                        if (!commState.putByteArray(null, (byte[])commState.cur))
                             return false;
 
                         commState.cur = NULL;
@@ -302,14 +302,14 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putLong(reqId))
+                if (!commState.putLong(null, reqId))
                     return false;
 
                 commState.idx++;
@@ -333,7 +333,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -341,7 +341,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                         dataBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -358,7 +358,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 commState.idx++;
 
             case 4:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -371,7 +371,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 if (buf.remaining() < 1)
                     return false;
 
-                fields = commState.getBoolean();
+                fields = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -379,7 +379,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 if (buf.remaining() < 1)
                     return false;
 
-                finished = commState.getBoolean();
+                finished = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -388,7 +388,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -396,7 +396,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                         metaDataBytes = new ArrayList<>(commState.readSize);
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -416,7 +416,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 if (buf.remaining() < 8)
                     return false;
 
-                reqId = commState.getLong();
+                reqId = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java
index 28bddd8..f3a61c8 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/clock/GridClockDeltaSnapshotMessage.java
@@ -87,7 +87,7 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -97,7 +97,7 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
             case 0:
                 if (deltas != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(deltas.size()))
+                        if (!commState.putInt(null, deltas.size()))
                             return false;
 
                         commState.it = deltas.entrySet().iterator();
@@ -110,13 +110,13 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
                         Map.Entry<UUID, Long> e = (Map.Entry<UUID, Long>)commState.cur;
 
                         if (!commState.keyDone) {
-                            if (!commState.putUuid(e.getKey()))
+                            if (!commState.putUuid(null, e.getKey()))
                                 return false;
 
                             commState.keyDone = true;
                         }
 
-                        if (!commState.putLong(e.getValue()))
+                        if (!commState.putLong(null, e.getValue()))
                             return false;
 
                         commState.keyDone = false;
@@ -126,14 +126,14 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putClockDeltaVersion(snapVer))
+                if (!commState.putClockDeltaVersion(null, snapVer))
                     return false;
 
                 commState.idx++;
@@ -154,7 +154,7 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -163,7 +163,7 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
-                            UUID _val = commState.getUuid();
+                            UUID _val = commState.getUuid(null);
 
                             if (_val == UUID_NOT_READ)
                                 return false;
@@ -175,7 +175,7 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
                         if (buf.remaining() < 8)
                             return false;
 
-                        long _val = commState.getLong();
+                        long _val = commState.getLong(null);
 
                         deltas.put((UUID)commState.cur, _val);
 
@@ -192,7 +192,7 @@ public class GridClockDeltaSnapshotMessage extends GridTcpCommunicationMessageAd
                 commState.idx++;
 
             case 1:
-                GridClockDeltaVersion snapVer0 = commState.getClockDeltaVersion();
+                GridClockDeltaVersion snapVer0 = commState.getClockDeltaVersion(null);
 
                 if (snapVer0 == CLOCK_DELTA_VER_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java
index 09b7171..e87e972 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/continuous/GridContinuousMessage.java
@@ -129,7 +129,7 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -137,19 +137,19 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(dataBytes))
+                if (!commState.putByteArray(null, dataBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putUuid(routineId))
+                if (!commState.putUuid(null, routineId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putEnum(type))
+                if (!commState.putEnum(null, type))
                     return false;
 
                 commState.idx++;
@@ -166,7 +166,7 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                byte[] dataBytes0 = commState.getByteArray();
+                byte[] dataBytes0 = commState.getByteArray(null);
 
                 if (dataBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -176,7 +176,7 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
                 commState.idx++;
 
             case 1:
-                UUID routineId0 = commState.getUuid();
+                UUID routineId0 = commState.getUuid(null);
 
                 if (routineId0 == UUID_NOT_READ)
                     return false;
@@ -189,7 +189,7 @@ public class GridContinuousMessage extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                byte type0 = commState.getByte();
+                byte type0 = commState.getByte(null);
 
                 type = GridContinuousMessageType.fromOrdinal(type0);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java
index efaa153..7810633 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadRequest.java
@@ -206,7 +206,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -214,37 +214,37 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putString(cacheName))
+                if (!commState.putString(null, cacheName))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(clsLdrId))
+                if (!commState.putGridUuid(null, clsLdrId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putByteArray(colBytes))
+                if (!commState.putByteArray(null, colBytes))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putEnum(depMode))
+                if (!commState.putEnum(null, depMode))
                     return false;
 
                 commState.idx++;
 
             case 4:
-                if (!commState.putBoolean(forceLocDep))
+                if (!commState.putBoolean(null, forceLocDep))
                     return false;
 
                 commState.idx++;
 
             case 5:
-                if (!commState.putBoolean(ignoreDepOwnership))
+                if (!commState.putBoolean(null, ignoreDepOwnership))
                     return false;
 
                 commState.idx++;
@@ -252,7 +252,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
             case 6:
                 if (ldrParticipants != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(ldrParticipants.size()))
+                        if (!commState.putInt(null, ldrParticipants.size()))
                             return false;
 
                         commState.it = ldrParticipants.entrySet().iterator();
@@ -265,13 +265,13 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                         Map.Entry<UUID, IgniteUuid> e = (Map.Entry<UUID, IgniteUuid>)commState.cur;
 
                         if (!commState.keyDone) {
-                            if (!commState.putUuid(e.getKey()))
+                            if (!commState.putUuid(null, e.getKey()))
                                 return false;
 
                             commState.keyDone = true;
                         }
 
-                        if (!commState.putGridUuid(e.getValue()))
+                        if (!commState.putGridUuid(null, e.getValue()))
                             return false;
 
                         commState.keyDone = false;
@@ -281,38 +281,38 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 7:
-                if (!commState.putLong(reqId))
+                if (!commState.putLong(null, reqId))
                     return false;
 
                 commState.idx++;
 
             case 8:
-                if (!commState.putByteArray(resTopicBytes))
+                if (!commState.putByteArray(null, resTopicBytes))
                     return false;
 
                 commState.idx++;
 
             case 9:
-                if (!commState.putString(sampleClsName))
+                if (!commState.putString(null, sampleClsName))
                     return false;
 
                 commState.idx++;
 
             case 10:
-                if (!commState.putByteArray(updaterBytes))
+                if (!commState.putByteArray(null, updaterBytes))
                     return false;
 
                 commState.idx++;
 
             case 11:
-                if (!commState.putString(userVer))
+                if (!commState.putString(null, userVer))
                     return false;
 
                 commState.idx++;
@@ -328,7 +328,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
 
         switch (commState.idx) {
             case 0:
-                String cacheName0 = commState.getString();
+                String cacheName0 = commState.getString(null);
 
                 if (cacheName0 == STR_NOT_READ)
                     return false;
@@ -338,7 +338,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 1:
-                IgniteUuid clsLdrId0 = commState.getGridUuid();
+                IgniteUuid clsLdrId0 = commState.getGridUuid(null);
 
                 if (clsLdrId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -348,7 +348,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 2:
-                byte[] colBytes0 = commState.getByteArray();
+                byte[] colBytes0 = commState.getByteArray(null);
 
                 if (colBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -361,7 +361,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 1)
                     return false;
 
-                byte depMode0 = commState.getByte();
+                byte depMode0 = commState.getByte(null);
 
                 depMode = IgniteDeploymentMode.fromOrdinal(depMode0);
 
@@ -371,7 +371,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 1)
                     return false;
 
-                forceLocDep = commState.getBoolean();
+                forceLocDep = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -379,7 +379,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 1)
                     return false;
 
-                ignoreDepOwnership = commState.getBoolean();
+                ignoreDepOwnership = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -388,7 +388,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -397,7 +397,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
-                            UUID _val = commState.getUuid();
+                            UUID _val = commState.getUuid(null);
 
                             if (_val == UUID_NOT_READ)
                                 return false;
@@ -406,7 +406,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                             commState.keyDone = true;
                         }
 
-                        IgniteUuid _val = commState.getGridUuid();
+                        IgniteUuid _val = commState.getGridUuid(null);
 
                         if (_val == GRID_UUID_NOT_READ)
                             return false;
@@ -429,12 +429,12 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 if (buf.remaining() < 8)
                     return false;
 
-                reqId = commState.getLong();
+                reqId = commState.getLong(null);
 
                 commState.idx++;
 
             case 8:
-                byte[] resTopicBytes0 = commState.getByteArray();
+                byte[] resTopicBytes0 = commState.getByteArray(null);
 
                 if (resTopicBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -444,7 +444,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 9:
-                String sampleClsName0 = commState.getString();
+                String sampleClsName0 = commState.getString(null);
 
                 if (sampleClsName0 == STR_NOT_READ)
                     return false;
@@ -454,7 +454,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 10:
-                byte[] updaterBytes0 = commState.getByteArray();
+                byte[] updaterBytes0 = commState.getByteArray(null);
 
                 if (updaterBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -464,7 +464,7 @@ public class GridDataLoadRequest<K, V> extends GridTcpCommunicationMessageAdapte
                 commState.idx++;
 
             case 11:
-                String userVer0 = commState.getString();
+                String userVer0 = commState.getString(null);
 
                 if (userVer0 == STR_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java
index 4c94bd2..f726db8 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoadResponse.java
@@ -99,7 +99,7 @@ public class GridDataLoadResponse extends GridTcpCommunicationMessageAdapter {
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -107,19 +107,19 @@ public class GridDataLoadResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putBoolean(forceLocDep))
+                if (!commState.putBoolean(null, forceLocDep))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(reqId))
+                if (!commState.putLong(null, reqId))
                     return false;
 
                 commState.idx++;
@@ -136,7 +136,7 @@ public class GridDataLoadResponse extends GridTcpCommunicationMessageAdapter {
 
         switch (commState.idx) {
             case 0:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -149,7 +149,7 @@ public class GridDataLoadResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 1)
                     return false;
 
-                forceLocDep = commState.getBoolean();
+                forceLocDep = commState.getBoolean(null);
 
                 commState.idx++;
 
@@ -157,7 +157,7 @@ public class GridDataLoadResponse extends GridTcpCommunicationMessageAdapter {
                 if (buf.remaining() < 8)
                     return false;
 
-                reqId = commState.getLong();
+                reqId = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java
index d47c661..f01b397 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsAckMessage.java
@@ -125,7 +125,7 @@ public class GridGgfsAckMessage extends GridGgfsCommunicationMessage {
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -133,19 +133,19 @@ public class GridGgfsAckMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(fileId))
+                if (!commState.putGridUuid(null, fileId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(id))
+                if (!commState.putLong(null, id))
                     return false;
 
                 commState.idx++;
@@ -165,7 +165,7 @@ public class GridGgfsAckMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -175,7 +175,7 @@ public class GridGgfsAckMessage extends GridGgfsCommunicationMessage {
                 commState.idx++;
 
             case 1:
-                IgniteUuid fileId0 = commState.getGridUuid();
+                IgniteUuid fileId0 = commState.getGridUuid(null);
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -188,7 +188,7 @@ public class GridGgfsAckMessage extends GridGgfsCommunicationMessage {
                 if (buf.remaining() < 8)
                     return false;
 
-                id = commState.getLong();
+                id = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java
index 3e64ee5..563c458 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlockKey.java
@@ -176,7 +176,7 @@ public final class GridGgfsBlockKey extends GridTcpCommunicationMessageAdapter
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -184,25 +184,25 @@ public final class GridGgfsBlockKey extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putGridUuid(affKey))
+                if (!commState.putGridUuid(null, affKey))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putLong(blockId))
+                if (!commState.putLong(null, blockId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putBoolean(evictExclude))
+                if (!commState.putBoolean(null, evictExclude))
                     return false;
 
                 commState.idx++;
 
             case 3:
-                if (!commState.putGridUuid(fileId))
+                if (!commState.putGridUuid(null, fileId))
                     return false;
 
                 commState.idx++;
@@ -219,7 +219,7 @@ public final class GridGgfsBlockKey extends GridTcpCommunicationMessageAdapter
 
         switch (commState.idx) {
             case 0:
-                IgniteUuid affKey0 = commState.getGridUuid();
+                IgniteUuid affKey0 = commState.getGridUuid(null);
 
                 if (affKey0 == GRID_UUID_NOT_READ)
                     return false;
@@ -232,7 +232,7 @@ public final class GridGgfsBlockKey extends GridTcpCommunicationMessageAdapter
                 if (buf.remaining() < 8)
                     return false;
 
-                blockId = commState.getLong();
+                blockId = commState.getLong(null);
 
                 commState.idx++;
 
@@ -240,12 +240,12 @@ public final class GridGgfsBlockKey extends GridTcpCommunicationMessageAdapter
                 if (buf.remaining() < 1)
                     return false;
 
-                evictExclude = commState.getBoolean();
+                evictExclude = commState.getBoolean(null);
 
                 commState.idx++;
 
             case 3:
-                IgniteUuid fileId0 = commState.getGridUuid();
+                IgniteUuid fileId0 = commState.getGridUuid(null);
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java
index 8f1de61..2f9ea60 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsBlocksMessage.java
@@ -106,7 +106,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -116,7 +116,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
             case 0:
                 if (blocks != null) {
                     if (commState.it == null) {
-                        if (!commState.putInt(blocks.size()))
+                        if (!commState.putInt(null, blocks.size()))
                             return false;
 
                         commState.it = blocks.entrySet().iterator();
@@ -129,13 +129,13 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
                         Map.Entry<GridGgfsBlockKey, byte[]> e = (Map.Entry<GridGgfsBlockKey, byte[]>)commState.cur;
 
                         if (!commState.keyDone) {
-                            if (!commState.putMessage(e.getKey()))
+                            if (!commState.putMessage(null, e.getKey()))
                                 return false;
 
                             commState.keyDone = true;
                         }
 
-                        if (!commState.putByteArray(e.getValue()))
+                        if (!commState.putByteArray(null, e.getValue()))
                             return false;
 
                         commState.keyDone = false;
@@ -145,20 +145,20 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
 
                     commState.it = null;
                 } else {
-                    if (!commState.putInt(-1))
+                    if (!commState.putInt(null, -1))
                         return false;
                 }
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(fileId))
+                if (!commState.putGridUuid(null, fileId))
                     return false;
 
                 commState.idx++;
 
             case 2:
-                if (!commState.putLong(id))
+                if (!commState.putLong(null, id))
                     return false;
 
                 commState.idx++;
@@ -182,7 +182,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
                     if (buf.remaining() < 4)
                         return false;
 
-                    commState.readSize = commState.getInt();
+                    commState.readSize = commState.getInt(null);
                 }
 
                 if (commState.readSize >= 0) {
@@ -191,7 +191,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
 
                     for (int i = commState.readItems; i < commState.readSize; i++) {
                         if (!commState.keyDone) {
-                            Object _val = commState.getMessage();
+                            Object _val = commState.getMessage(null);
 
                             if (_val == MSG_NOT_READ)
                                 return false;
@@ -200,7 +200,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
                             commState.keyDone = true;
                         }
 
-                        byte[] _val = commState.getByteArray();
+                        byte[] _val = commState.getByteArray(null);
 
                         if (_val == BYTE_ARR_NOT_READ)
                             return false;
@@ -220,7 +220,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
                 commState.idx++;
 
             case 1:
-                IgniteUuid fileId0 = commState.getGridUuid();
+                IgniteUuid fileId0 = commState.getGridUuid(null);
 
                 if (fileId0 == GRID_UUID_NOT_READ)
                     return false;
@@ -233,7 +233,7 @@ public class GridGgfsBlocksMessage extends GridGgfsCommunicationMessage {
                 if (buf.remaining() < 8)
                     return false;
 
-                id = commState.getLong();
+                id = commState.getLong(null);
 
                 commState.idx++;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsCommunicationMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsCommunicationMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsCommunicationMessage.java
index a905c52..6bd43e9 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsCommunicationMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsCommunicationMessage.java
@@ -49,7 +49,7 @@ public abstract class GridGgfsCommunicationMessage extends GridTcpCommunicationM
         commState.setBuffer(buf);
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d21e6b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java
index c74c5e6..c913132 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsDeleteMessage.java
@@ -128,7 +128,7 @@ public class GridGgfsDeleteMessage extends GridGgfsCommunicationMessage {
             return false;
 
         if (!commState.typeWritten) {
-            if (!commState.putByte(directType()))
+            if (!commState.putByte(null, directType()))
                 return false;
 
             commState.typeWritten = true;
@@ -136,13 +136,13 @@ public class GridGgfsDeleteMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                if (!commState.putByteArray(errBytes))
+                if (!commState.putByteArray(null, errBytes))
                     return false;
 
                 commState.idx++;
 
             case 1:
-                if (!commState.putGridUuid(id))
+                if (!commState.putGridUuid(null, id))
                     return false;
 
                 commState.idx++;
@@ -162,7 +162,7 @@ public class GridGgfsDeleteMessage extends GridGgfsCommunicationMessage {
 
         switch (commState.idx) {
             case 0:
-                byte[] errBytes0 = commState.getByteArray();
+                byte[] errBytes0 = commState.getByteArray(null);
 
                 if (errBytes0 == BYTE_ARR_NOT_READ)
                     return false;
@@ -172,7 +172,7 @@ public class GridGgfsDeleteMessage extends GridGgfsCommunicationMessage {
                 commState.idx++;
 
             case 1:
-                IgniteUuid id0 = commState.getGridUuid();
+                IgniteUuid id0 = commState.getGridUuid(null);
 
                 if (id0 == GRID_UUID_NOT_READ)
                     return false;