ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [29/50] [abbrv] incubator-ignite git commit: ignite-nio - Removing message clone
Date Sun, 15 Feb 2015 08:42:11 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java
index baf6c31..d5932c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponse.java
@@ -209,7 +209,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
             return false;
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -217,37 +217,37 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
 
         switch (writer.state()) {
             case 3:
-                if (!writer.writeCollection("dataBytes", dataBytes, MessageFieldType.BYTE_ARR))
+                if (!writer.writeCollectionField("dataBytes", dataBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeByteArray("errBytes", errBytes))
+                if (!writer.writeField("errBytes", errBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 5:
-                if (!writer.writeBoolean("fields", fields))
+                if (!writer.writeField("fields", fields, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 6:
-                if (!writer.writeBoolean("finished", finished))
+                if (!writer.writeField("finished", finished, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 7:
-                if (!writer.writeCollection("metaDataBytes", metaDataBytes, MessageFieldType.BYTE_ARR))
+                if (!writer.writeCollectionField("metaDataBytes", metaDataBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 8:
-                if (!writer.writeLong("reqId", reqId))
+                if (!writer.writeField("reqId", reqId, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
@@ -266,7 +266,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
 
         switch (readState) {
             case 3:
-                dataBytes = reader.readCollection("dataBytes", MessageFieldType.BYTE_ARR);
+                dataBytes = reader.readCollectionField("dataBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -274,7 +274,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 readState++;
 
             case 4:
-                errBytes = reader.readByteArray("errBytes");
+                errBytes = reader.readField("errBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -282,7 +282,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 readState++;
 
             case 5:
-                fields = reader.readBoolean("fields");
+                fields = reader.readField("fields", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -290,7 +290,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 readState++;
 
             case 6:
-                finished = reader.readBoolean("finished");
+                finished = reader.readField("finished", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -298,7 +298,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 readState++;
 
             case 7:
-                metaDataBytes = reader.readCollection("metaDataBytes", MessageFieldType.BYTE_ARR);
+                metaDataBytes = reader.readCollectionField("metaDataBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -306,7 +306,7 @@ public class GridCacheQueryResponse<K, V> extends GridCacheMessage<K, V> impleme
                 readState++;
 
             case 8:
-                reqId = reader.readLong("reqId");
+                reqId = reader.readField("reqId", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
index 53e43e2..4aeb1b7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
@@ -257,7 +257,7 @@ public class GridCacheVersion extends MessageAdapter implements Comparable<GridC
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -265,25 +265,25 @@ public class GridCacheVersion extends MessageAdapter implements Comparable<GridC
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeLong("globalTime", globalTime))
+                if (!writer.writeField("globalTime", globalTime, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeInt("nodeOrderDrId", nodeOrderDrId))
+                if (!writer.writeField("nodeOrderDrId", nodeOrderDrId, MessageFieldType.INT))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeLong("order", order))
+                if (!writer.writeField("order", order, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeInt("topVer", topVer))
+                if (!writer.writeField("topVer", topVer, MessageFieldType.INT))
                     return false;
 
                 writer.incrementState();
@@ -299,7 +299,7 @@ public class GridCacheVersion extends MessageAdapter implements Comparable<GridC
 
         switch (readState) {
             case 0:
-                globalTime = reader.readLong("globalTime");
+                globalTime = reader.readField("globalTime", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -307,7 +307,7 @@ public class GridCacheVersion extends MessageAdapter implements Comparable<GridC
                 readState++;
 
             case 1:
-                nodeOrderDrId = reader.readInt("nodeOrderDrId");
+                nodeOrderDrId = reader.readField("nodeOrderDrId", MessageFieldType.INT);
 
                 if (!reader.isLastRead())
                     return false;
@@ -315,7 +315,7 @@ public class GridCacheVersion extends MessageAdapter implements Comparable<GridC
                 readState++;
 
             case 2:
-                order = reader.readLong("order");
+                order = reader.readField("order", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -323,7 +323,7 @@ public class GridCacheVersion extends MessageAdapter implements Comparable<GridC
                 readState++;
 
             case 3:
-                topVer = reader.readInt("topVer");
+                topVer = reader.readField("topVer", MessageFieldType.INT);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java
index 69716dd..1d7a4f2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaSnapshotMessage.java
@@ -76,7 +76,7 @@ public class GridClockDeltaSnapshotMessage extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -84,13 +84,13 @@ public class GridClockDeltaSnapshotMessage extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeMap("deltas", deltas, MessageFieldType.UUID, MessageFieldType.LONG))
+                if (!writer.writeMapField("deltas", deltas, MessageFieldType.UUID, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeMessage("snapVer", snapVer))
+                if (!writer.writeField("snapVer", snapVer, MessageFieldType.MSG))
                     return false;
 
                 writer.incrementState();
@@ -106,7 +106,7 @@ public class GridClockDeltaSnapshotMessage extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                deltas = reader.readMap("deltas", MessageFieldType.UUID, MessageFieldType.LONG, false);
+                deltas = reader.readMapField("deltas", MessageFieldType.UUID, MessageFieldType.LONG, false);
 
                 if (!reader.isLastRead())
                     return false;
@@ -114,7 +114,7 @@ public class GridClockDeltaSnapshotMessage extends MessageAdapter {
                 readState++;
 
             case 1:
-                snapVer = reader.readMessage("snapVer");
+                snapVer = reader.readField("snapVer", MessageFieldType.MSG);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaVersion.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaVersion.java
index 60448f2..25a0eb9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockDeltaVersion.java
@@ -117,7 +117,7 @@ public class GridClockDeltaVersion extends MessageAdapter implements Comparable<
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -125,13 +125,13 @@ public class GridClockDeltaVersion extends MessageAdapter implements Comparable<
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeLong("topVer", topVer))
+                if (!writer.writeField("topVer", topVer, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeLong("ver", ver))
+                if (!writer.writeField("ver", ver, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
@@ -147,7 +147,7 @@ public class GridClockDeltaVersion extends MessageAdapter implements Comparable<
 
         switch (readState) {
             case 0:
-                topVer = reader.readLong("topVer");
+                topVer = reader.readField("topVer", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -155,7 +155,7 @@ public class GridClockDeltaVersion extends MessageAdapter implements Comparable<
                 readState++;
 
             case 1:
-                ver = reader.readLong("ver");
+                ver = reader.readField("ver", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousMessage.java
index 325bcb9..d4f37e2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousMessage.java
@@ -135,7 +135,7 @@ public class GridContinuousMessage extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -143,25 +143,25 @@ public class GridContinuousMessage extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("dataBytes", dataBytes))
+                if (!writer.writeField("dataBytes", dataBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("futId", futId))
+                if (!writer.writeField("futId", futId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeUuid("routineId", routineId))
+                if (!writer.writeField("routineId", routineId, MessageFieldType.UUID))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeByte("type", type != null ? (byte)type.ordinal() : -1))
+                if (!writer.writeField("type", type != null ? (byte)type.ordinal() : -1, MessageFieldType.BYTE))
                     return false;
 
                 writer.incrementState();
@@ -177,7 +177,7 @@ public class GridContinuousMessage extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                dataBytes = reader.readByteArray("dataBytes");
+                dataBytes = reader.readField("dataBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -185,7 +185,7 @@ public class GridContinuousMessage extends MessageAdapter {
                 readState++;
 
             case 1:
-                futId = reader.readIgniteUuid("futId");
+                futId = reader.readField("futId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -193,7 +193,7 @@ public class GridContinuousMessage extends MessageAdapter {
                 readState++;
 
             case 2:
-                routineId = reader.readUuid("routineId");
+                routineId = reader.readField("routineId", MessageFieldType.UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -203,7 +203,7 @@ public class GridContinuousMessage extends MessageAdapter {
             case 3:
                 byte typeOrd;
 
-                typeOrd = reader.readByte("type");
+                typeOrd = reader.readField("type", MessageFieldType.BYTE);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java
index 2b19dc5..e5476a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadRequest.java
@@ -227,7 +227,7 @@ public class GridDataLoadRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -235,79 +235,79 @@ public class GridDataLoadRequest extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeString("cacheName", cacheName))
+                if (!writer.writeField("cacheName", cacheName, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("clsLdrId", clsLdrId))
+                if (!writer.writeField("clsLdrId", clsLdrId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeByteArray("colBytes", colBytes))
+                if (!writer.writeField("colBytes", colBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeByte("depMode", depMode != null ? (byte)depMode.ordinal() : -1))
+                if (!writer.writeField("depMode", depMode != null ? (byte)depMode.ordinal() : -1, MessageFieldType.BYTE))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeBoolean("forceLocDep", forceLocDep))
+                if (!writer.writeField("forceLocDep", forceLocDep, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 5:
-                if (!writer.writeBoolean("ignoreDepOwnership", ignoreDepOwnership))
+                if (!writer.writeField("ignoreDepOwnership", ignoreDepOwnership, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 6:
-                if (!writer.writeMap("ldrParticipants", ldrParticipants, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
+                if (!writer.writeMapField("ldrParticipants", ldrParticipants, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 7:
-                if (!writer.writeLong("reqId", reqId))
+                if (!writer.writeField("reqId", reqId, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 8:
-                if (!writer.writeByteArray("resTopicBytes", resTopicBytes))
+                if (!writer.writeField("resTopicBytes", resTopicBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 9:
-                if (!writer.writeString("sampleClsName", sampleClsName))
+                if (!writer.writeField("sampleClsName", sampleClsName, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 10:
-                if (!writer.writeBoolean("skipStore", skipStore))
+                if (!writer.writeField("skipStore", skipStore, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 11:
-                if (!writer.writeByteArray("updaterBytes", updaterBytes))
+                if (!writer.writeField("updaterBytes", updaterBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 12:
-                if (!writer.writeString("userVer", userVer))
+                if (!writer.writeField("userVer", userVer, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
@@ -323,7 +323,7 @@ public class GridDataLoadRequest extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                cacheName = reader.readString("cacheName");
+                cacheName = reader.readField("cacheName", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -331,7 +331,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 1:
-                clsLdrId = reader.readIgniteUuid("clsLdrId");
+                clsLdrId = reader.readField("clsLdrId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -339,7 +339,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 2:
-                colBytes = reader.readByteArray("colBytes");
+                colBytes = reader.readField("colBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -349,7 +349,7 @@ public class GridDataLoadRequest extends MessageAdapter {
             case 3:
                 byte depModeOrd;
 
-                depModeOrd = reader.readByte("depMode");
+                depModeOrd = reader.readField("depMode", MessageFieldType.BYTE);
 
                 if (!reader.isLastRead())
                     return false;
@@ -359,7 +359,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 4:
-                forceLocDep = reader.readBoolean("forceLocDep");
+                forceLocDep = reader.readField("forceLocDep", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -367,7 +367,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 5:
-                ignoreDepOwnership = reader.readBoolean("ignoreDepOwnership");
+                ignoreDepOwnership = reader.readField("ignoreDepOwnership", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -375,7 +375,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 6:
-                ldrParticipants = reader.readMap("ldrParticipants", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
+                ldrParticipants = reader.readMapField("ldrParticipants", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
 
                 if (!reader.isLastRead())
                     return false;
@@ -383,7 +383,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 7:
-                reqId = reader.readLong("reqId");
+                reqId = reader.readField("reqId", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -391,7 +391,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 8:
-                resTopicBytes = reader.readByteArray("resTopicBytes");
+                resTopicBytes = reader.readField("resTopicBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -399,7 +399,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 9:
-                sampleClsName = reader.readString("sampleClsName");
+                sampleClsName = reader.readField("sampleClsName", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -407,7 +407,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 10:
-                skipStore = reader.readBoolean("skipStore");
+                skipStore = reader.readField("skipStore", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -415,7 +415,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 11:
-                updaterBytes = reader.readByteArray("updaterBytes");
+                updaterBytes = reader.readField("updaterBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -423,7 +423,7 @@ public class GridDataLoadRequest extends MessageAdapter {
                 readState++;
 
             case 12:
-                userVer = reader.readString("userVer");
+                userVer = reader.readField("userVer", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadResponse.java
index 9308157..7cede1f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/GridDataLoadResponse.java
@@ -87,7 +87,7 @@ public class GridDataLoadResponse extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -95,19 +95,19 @@ public class GridDataLoadResponse extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("errBytes", errBytes))
+                if (!writer.writeField("errBytes", errBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeBoolean("forceLocDep", forceLocDep))
+                if (!writer.writeField("forceLocDep", forceLocDep, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeLong("reqId", reqId))
+                if (!writer.writeField("reqId", reqId, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
@@ -123,7 +123,7 @@ public class GridDataLoadResponse extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                errBytes = reader.readByteArray("errBytes");
+                errBytes = reader.readField("errBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -131,7 +131,7 @@ public class GridDataLoadResponse extends MessageAdapter {
                 readState++;
 
             case 1:
-                forceLocDep = reader.readBoolean("forceLocDep");
+                forceLocDep = reader.readField("forceLocDep", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -139,7 +139,7 @@ public class GridDataLoadResponse extends MessageAdapter {
                 readState++;
 
             case 2:
-                reqId = reader.readLong("reqId");
+                reqId = reader.readField("reqId", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java
index d8c0dde..e8b5c73 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java
@@ -110,7 +110,7 @@ public class IgfsAckMessage extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -118,19 +118,19 @@ public class IgfsAckMessage extends IgfsCommunicationMessage {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("errBytes", errBytes))
+                if (!writer.writeField("errBytes", errBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("fileId", fileId))
+                if (!writer.writeField("fileId", fileId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeLong("id", id))
+                if (!writer.writeField("id", id, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
@@ -149,7 +149,7 @@ public class IgfsAckMessage extends IgfsCommunicationMessage {
 
         switch (readState) {
             case 0:
-                errBytes = reader.readByteArray("errBytes");
+                errBytes = reader.readField("errBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -157,7 +157,7 @@ public class IgfsAckMessage extends IgfsCommunicationMessage {
                 readState++;
 
             case 1:
-                fileId = reader.readIgniteUuid("fileId");
+                fileId = reader.readField("fileId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -165,7 +165,7 @@ public class IgfsAckMessage extends IgfsCommunicationMessage {
                 readState++;
 
             case 2:
-                id = reader.readLong("id");
+                id = reader.readField("id", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
index 692992c..528a643 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
@@ -162,7 +162,7 @@ public final class IgfsBlockKey extends MessageAdapter implements Externalizable
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -170,25 +170,25 @@ public final class IgfsBlockKey extends MessageAdapter implements Externalizable
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("affKey", affKey))
+                if (!writer.writeField("affKey", affKey, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeLong("blockId", blockId))
+                if (!writer.writeField("blockId", blockId, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeBoolean("evictExclude", evictExclude))
+                if (!writer.writeField("evictExclude", evictExclude, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeIgniteUuid("fileId", fileId))
+                if (!writer.writeField("fileId", fileId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
@@ -204,7 +204,7 @@ public final class IgfsBlockKey extends MessageAdapter implements Externalizable
 
         switch (readState) {
             case 0:
-                affKey = reader.readIgniteUuid("affKey");
+                affKey = reader.readField("affKey", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -212,7 +212,7 @@ public final class IgfsBlockKey extends MessageAdapter implements Externalizable
                 readState++;
 
             case 1:
-                blockId = reader.readLong("blockId");
+                blockId = reader.readField("blockId", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -220,7 +220,7 @@ public final class IgfsBlockKey extends MessageAdapter implements Externalizable
                 readState++;
 
             case 2:
-                evictExclude = reader.readBoolean("evictExclude");
+                evictExclude = reader.readField("evictExclude", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -228,7 +228,7 @@ public final class IgfsBlockKey extends MessageAdapter implements Externalizable
                 readState++;
 
             case 3:
-                fileId = reader.readIgniteUuid("fileId");
+                fileId = reader.readField("fileId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java
index 8565cfa..88c47c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java
@@ -91,7 +91,7 @@ public class IgfsBlocksMessage extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -99,19 +99,19 @@ public class IgfsBlocksMessage extends IgfsCommunicationMessage {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeMap("blocks", blocks, MessageFieldType.MSG, MessageFieldType.BYTE_ARR))
+                if (!writer.writeMapField("blocks", blocks, MessageFieldType.MSG, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("fileId", fileId))
+                if (!writer.writeField("fileId", fileId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeLong("id", id))
+                if (!writer.writeField("id", id, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
@@ -130,7 +130,7 @@ public class IgfsBlocksMessage extends IgfsCommunicationMessage {
 
         switch (readState) {
             case 0:
-                blocks = reader.readMap("blocks", MessageFieldType.MSG, MessageFieldType.BYTE_ARR, false);
+                blocks = reader.readMapField("blocks", MessageFieldType.MSG, MessageFieldType.BYTE_ARR, false);
 
                 if (!reader.isLastRead())
                     return false;
@@ -138,7 +138,7 @@ public class IgfsBlocksMessage extends IgfsCommunicationMessage {
                 readState++;
 
             case 1:
-                fileId = reader.readIgniteUuid("fileId");
+                fileId = reader.readField("fileId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -146,7 +146,7 @@ public class IgfsBlocksMessage extends IgfsCommunicationMessage {
                 readState++;
 
             case 2:
-                id = reader.readLong("id");
+                id = reader.readField("id", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java
index 4e00704..4723df1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java
@@ -53,7 +53,7 @@ public abstract class IgfsCommunicationMessage extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java
index 24b887f..e2d7d7e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java
@@ -114,7 +114,7 @@ public class IgfsDeleteMessage extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -122,13 +122,13 @@ public class IgfsDeleteMessage extends IgfsCommunicationMessage {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("errBytes", errBytes))
+                if (!writer.writeField("errBytes", errBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("id", id))
+                if (!writer.writeField("id", id, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
@@ -147,7 +147,7 @@ public class IgfsDeleteMessage extends IgfsCommunicationMessage {
 
         switch (readState) {
             case 0:
-                errBytes = reader.readByteArray("errBytes");
+                errBytes = reader.readField("errBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -155,7 +155,7 @@ public class IgfsDeleteMessage extends IgfsCommunicationMessage {
                 readState++;
 
             case 1:
-                id = reader.readIgniteUuid("id");
+                id = reader.readField("id", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java
index 2b9aaae..1cc66ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java
@@ -267,7 +267,7 @@ public class IgfsFileAffinityRange extends MessageAdapter implements Externaliza
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -275,31 +275,31 @@ public class IgfsFileAffinityRange extends MessageAdapter implements Externaliza
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("affKey", affKey))
+                if (!writer.writeField("affKey", affKey, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeBoolean("done", done))
+                if (!writer.writeField("done", done, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeLong("endOff", endOff))
+                if (!writer.writeField("endOff", endOff, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeLong("startOff", startOff))
+                if (!writer.writeField("startOff", startOff, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeInt("status", status))
+                if (!writer.writeField("status", status, MessageFieldType.INT))
                     return false;
 
                 writer.incrementState();
@@ -315,7 +315,7 @@ public class IgfsFileAffinityRange extends MessageAdapter implements Externaliza
 
         switch (readState) {
             case 0:
-                affKey = reader.readIgniteUuid("affKey");
+                affKey = reader.readField("affKey", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -323,7 +323,7 @@ public class IgfsFileAffinityRange extends MessageAdapter implements Externaliza
                 readState++;
 
             case 1:
-                done = reader.readBoolean("done");
+                done = reader.readField("done", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -331,7 +331,7 @@ public class IgfsFileAffinityRange extends MessageAdapter implements Externaliza
                 readState++;
 
             case 2:
-                endOff = reader.readLong("endOff");
+                endOff = reader.readField("endOff", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -339,7 +339,7 @@ public class IgfsFileAffinityRange extends MessageAdapter implements Externaliza
                 readState++;
 
             case 3:
-                startOff = reader.readLong("startOff");
+                startOff = reader.readField("startOff", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -347,7 +347,7 @@ public class IgfsFileAffinityRange extends MessageAdapter implements Externaliza
                 readState++;
 
             case 4:
-                status = reader.readInt("status");
+                status = reader.readField("status", MessageFieldType.INT);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java
index aa21a8c..65eadd1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java
@@ -86,7 +86,7 @@ public class IgfsFragmentizerRequest extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -94,13 +94,13 @@ public class IgfsFragmentizerRequest extends IgfsCommunicationMessage {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("fileId", fileId))
+                if (!writer.writeField("fileId", fileId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeCollection("fragmentRanges", fragmentRanges, MessageFieldType.MSG))
+                if (!writer.writeCollectionField("fragmentRanges", fragmentRanges, MessageFieldType.MSG))
                     return false;
 
                 writer.incrementState();
@@ -119,7 +119,7 @@ public class IgfsFragmentizerRequest extends IgfsCommunicationMessage {
 
         switch (readState) {
             case 0:
-                fileId = reader.readIgniteUuid("fileId");
+                fileId = reader.readField("fileId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -127,7 +127,7 @@ public class IgfsFragmentizerRequest extends IgfsCommunicationMessage {
                 readState++;
 
             case 1:
-                fragmentRanges = reader.readCollection("fragmentRanges", MessageFieldType.MSG);
+                fragmentRanges = reader.readCollectionField("fragmentRanges", MessageFieldType.MSG);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java
index 7ab4e02..e31fa4b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java
@@ -62,7 +62,7 @@ public class IgfsFragmentizerResponse extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -70,7 +70,7 @@ public class IgfsFragmentizerResponse extends IgfsCommunicationMessage {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("fileId", fileId))
+                if (!writer.writeField("fileId", fileId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
@@ -89,7 +89,7 @@ public class IgfsFragmentizerResponse extends IgfsCommunicationMessage {
 
         switch (readState) {
             case 0:
-                fileId = reader.readIgniteUuid("fileId");
+                fileId = reader.readField("fileId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java
index e4123d0..42f5456 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java
@@ -79,7 +79,7 @@ public class IgfsSyncMessage extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -87,13 +87,13 @@ public class IgfsSyncMessage extends IgfsCommunicationMessage {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeLong("order", order))
+                if (!writer.writeField("order", order, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeBoolean("res", res))
+                if (!writer.writeField("res", res, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
@@ -112,7 +112,7 @@ public class IgfsSyncMessage extends IgfsCommunicationMessage {
 
         switch (readState) {
             case 0:
-                order = reader.readLong("order");
+                order = reader.readField("order", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -120,7 +120,7 @@ public class IgfsSyncMessage extends IgfsCommunicationMessage {
                 readState++;
 
             case 1:
-                res = reader.readBoolean("res");
+                res = reader.readField("res", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java
index 8369828..ba31c0e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java
@@ -103,7 +103,7 @@ public class GridTaskResultRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -111,13 +111,13 @@ public class GridTaskResultRequest extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("taskId", taskId))
+                if (!writer.writeField("taskId", taskId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeByteArray("topicBytes", topicBytes))
+                if (!writer.writeField("topicBytes", topicBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
@@ -133,7 +133,7 @@ public class GridTaskResultRequest extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                taskId = reader.readIgniteUuid("taskId");
+                taskId = reader.readField("taskId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -141,7 +141,7 @@ public class GridTaskResultRequest extends MessageAdapter {
                 readState++;
 
             case 1:
-                topicBytes = reader.readByteArray("topicBytes");
+                topicBytes = reader.readField("topicBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java
index 68f5afa..5be8992 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java
@@ -121,7 +121,7 @@ public class GridTaskResultResponse extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -129,25 +129,25 @@ public class GridTaskResultResponse extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeString("err", err))
+                if (!writer.writeField("err", err, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeBoolean("finished", finished))
+                if (!writer.writeField("finished", finished, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeBoolean("found", found))
+                if (!writer.writeField("found", found, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeByteArray("resBytes", resBytes))
+                if (!writer.writeField("resBytes", resBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
@@ -163,7 +163,7 @@ public class GridTaskResultResponse extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                err = reader.readString("err");
+                err = reader.readField("err", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -171,7 +171,7 @@ public class GridTaskResultResponse extends MessageAdapter {
                 readState++;
 
             case 1:
-                finished = reader.readBoolean("finished");
+                finished = reader.readField("finished", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -179,7 +179,7 @@ public class GridTaskResultResponse extends MessageAdapter {
                 readState++;
 
             case 2:
-                found = reader.readBoolean("found");
+                found = reader.readField("found", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -187,7 +187,7 @@ public class GridTaskResultResponse extends MessageAdapter {
                 readState++;
 
             case 3:
-                resBytes = reader.readByteArray("resBytes");
+                resBytes = reader.readField("resBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java
index 2fbdd68..cf5a3a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java
@@ -59,7 +59,7 @@ public class GridStreamerCancelRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -67,7 +67,7 @@ public class GridStreamerCancelRequest extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("cancelledFutId", cancelledFutId))
+                if (!writer.writeField("cancelledFutId", cancelledFutId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
@@ -83,7 +83,7 @@ public class GridStreamerCancelRequest extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                cancelledFutId = reader.readIgniteUuid("cancelledFutId");
+                cancelledFutId = reader.readField("cancelledFutId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
index 7d559e9..f9f6123 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
@@ -154,7 +154,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -162,43 +162,43 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("batchBytes", batchBytes))
+                if (!writer.writeField("batchBytes", batchBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("clsLdrId", clsLdrId))
+                if (!writer.writeField("clsLdrId", clsLdrId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeByte("depMode", depMode != null ? (byte)depMode.ordinal() : -1))
+                if (!writer.writeField("depMode", depMode != null ? (byte)depMode.ordinal() : -1, MessageFieldType.BYTE))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeBoolean("forceLocDep", forceLocDep))
+                if (!writer.writeField("forceLocDep", forceLocDep, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeMap("ldrParticipants", ldrParticipants, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
+                if (!writer.writeMapField("ldrParticipants", ldrParticipants, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 5:
-                if (!writer.writeString("sampleClsName", sampleClsName))
+                if (!writer.writeField("sampleClsName", sampleClsName, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 6:
-                if (!writer.writeString("userVer", userVer))
+                if (!writer.writeField("userVer", userVer, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
@@ -214,7 +214,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                batchBytes = reader.readByteArray("batchBytes");
+                batchBytes = reader.readField("batchBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -222,7 +222,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
                 readState++;
 
             case 1:
-                clsLdrId = reader.readIgniteUuid("clsLdrId");
+                clsLdrId = reader.readField("clsLdrId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -232,7 +232,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
             case 2:
                 byte depModeOrd;
 
-                depModeOrd = reader.readByte("depMode");
+                depModeOrd = reader.readField("depMode", MessageFieldType.BYTE);
 
                 if (!reader.isLastRead())
                     return false;
@@ -242,7 +242,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
                 readState++;
 
             case 3:
-                forceLocDep = reader.readBoolean("forceLocDep");
+                forceLocDep = reader.readField("forceLocDep", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -250,7 +250,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
                 readState++;
 
             case 4:
-                ldrParticipants = reader.readMap("ldrParticipants", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
+                ldrParticipants = reader.readMapField("ldrParticipants", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
 
                 if (!reader.isLastRead())
                     return false;
@@ -258,7 +258,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
                 readState++;
 
             case 5:
-                sampleClsName = reader.readString("sampleClsName");
+                sampleClsName = reader.readField("sampleClsName", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -266,7 +266,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
                 readState++;
 
             case 6:
-                userVer = reader.readString("userVer");
+                userVer = reader.readField("userVer", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java
index ff41bc9..fafddf0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java
@@ -79,7 +79,7 @@ public class GridStreamerResponse extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -87,13 +87,13 @@ public class GridStreamerResponse extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("errBytes", errBytes))
+                if (!writer.writeField("errBytes", errBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("futId", futId))
+                if (!writer.writeField("futId", futId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
@@ -109,7 +109,7 @@ public class GridStreamerResponse extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                errBytes = reader.readByteArray("errBytes");
+                errBytes = reader.readField("errBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -117,7 +117,7 @@ public class GridStreamerResponse extends MessageAdapter {
                 readState++;
 
             case 1:
-                futId = reader.readIgniteUuid("futId");
+                futId = reader.readField("futId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java
index 84b07a4..2dc9fd3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java
@@ -411,7 +411,7 @@ public class GridByteArrayList extends MessageAdapter implements Externalizable
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -419,13 +419,13 @@ public class GridByteArrayList extends MessageAdapter implements Externalizable
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("data", data))
+                if (!writer.writeField("data", data, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeInt("size", size))
+                if (!writer.writeField("size", size, MessageFieldType.INT))
                     return false;
 
                 writer.incrementState();
@@ -441,7 +441,7 @@ public class GridByteArrayList extends MessageAdapter implements Externalizable
 
         switch (readState) {
             case 0:
-                data = reader.readByteArray("data");
+                data = reader.readField("data", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -449,7 +449,7 @@ public class GridByteArrayList extends MessageAdapter implements Externalizable
                 readState++;
 
             case 1:
-                size = reader.readInt("size");
+                size = reader.readField("size", MessageFieldType.INT);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java
index 8a9fc6c..6a10a97 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java
@@ -509,7 +509,7 @@ public class GridLongList extends MessageAdapter implements Externalizable {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -517,13 +517,13 @@ public class GridLongList extends MessageAdapter implements Externalizable {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeLongArray("arr", arr))
+                if (!writer.writeField("arr", arr, MessageFieldType.LONG_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeInt("idx", idx))
+                if (!writer.writeField("idx", idx, MessageFieldType.INT))
                     return false;
 
                 writer.incrementState();
@@ -539,7 +539,7 @@ public class GridLongList extends MessageAdapter implements Externalizable {
 
         switch (readState) {
             case 0:
-                arr = reader.readLongArray("arr");
+                arr = reader.readField("arr", MessageFieldType.LONG_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -547,7 +547,7 @@ public class GridLongList extends MessageAdapter implements Externalizable {
                 readState++;
 
             case 1:
-                idx = reader.readInt("idx");
+                idx = reader.readField("idx", MessageFieldType.INT);
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
index aa81627..2cc3954 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
@@ -17,8 +17,6 @@
 
 package org.apache.ignite.plugin.extensions.communication;
 
-import org.apache.ignite.lang.*;
-
 import java.nio.*;
 import java.util.*;
 
@@ -29,179 +27,20 @@ import java.util.*;
  */
 public interface MessageReader {
     /**
-     * Sets but buffer to read from.
+     * Sets byte buffer to read from.
      *
      * @param buf Byte buffer.
      */
     public void setBuffer(ByteBuffer buf);
 
     /**
-     * Reads {@code byte} value.
-     *
-     * @param name Field name.
-     * @return {@code byte} value.
-     */
-    public byte readByte(String name);
-
-    /**
-     * Reads {@code short} value.
-     *
-     * @param name Field name.
-     * @return {@code short} value.
-     */
-    public short readShort(String name);
-
-    /**
-     * Reads {@code int} value.
-     *
-     * @param name Field name.
-     * @return {@code int} value.
-     */
-    public int readInt(String name);
-
-    /**
-     * Reads {@code long} value.
-     *
-     * @param name Field name.
-     * @return {@code long} value.
-     */
-    public long readLong(String name);
-
-    /**
-     * Reads {@code float} value.
-     *
-     * @param name Field name.
-     * @return {@code float} value.
-     */
-    public float readFloat(String name);
-
-    /**
-     * Reads {@code double} value.
-     *
-     * @param name Field name.
-     * @return {@code double} value.
-     */
-    public double readDouble(String name);
-
-    /**
-     * Reads {@code char} value.
-     *
-     * @param name Field name.
-     * @return {@code char} value.
-     */
-    public char readChar(String name);
-
-    /**
-     * Reads {@code boolean} value.
-     *
-     * @param name Field name.
-     * @return {@code boolean} value.
-     */
-    public boolean readBoolean(String name);
-
-    /**
-     * Reads {@code byte} array.
-     *
-     * @param name Field name.
-     * @return {@code byte} array.
-     */
-    public byte[] readByteArray(String name);
-
-    /**
-     * Reads {@code short} array.
-     *
-     * @param name Field name.
-     * @return {@code short} array.
-     */
-    public short[] readShortArray(String name);
-
-    /**
-     * Reads {@code int} array.
-     *
-     * @param name Field name.
-     * @return {@code int} array.
-     */
-    public int[] readIntArray(String name);
-
-    /**
-     * Reads {@code long} array.
-     *
-     * @param name Field name.
-     * @return {@code long} array.
-     */
-    public long[] readLongArray(String name);
-
-    /**
-     * Reads {@code float} array.
-     *
-     * @param name Field name.
-     * @return {@code float} array.
-     */
-    public float[] readFloatArray(String name);
-
-    /**
-     * Reads {@code double} array.
-     *
-     * @param name Field name.
-     * @return {@code double} array.
-     */
-    public double[] readDoubleArray(String name);
-
-    /**
-     * Reads {@code char} array.
-     *
-     * @param name Field name.
-     * @return {@code char} array.
-     */
-    public char[] readCharArray(String name);
-
-    /**
-     * Reads {@code boolean} array.
-     *
-     * @param name Field name.
-     * @return {@code boolean} array.
-     */
-    public boolean[] readBooleanArray(String name);
-
-    /**
-     * Reads {@link String}.
-     *
-     * @param name Field name.
-     * @return {@link String}.
-     */
-    public String readString(String name);
-
-    /**
-     * Reads {@link BitSet}.
-     *
-     * @param name Field name.
-     * @return {@link BitSet}.
-     */
-    public BitSet readBitSet(String name);
-
-    /**
-     * Reads {@link UUID}.
-     *
-     * @param name Field name.
-     * @return {@link UUID}.
-     */
-    public UUID readUuid(String name);
-
-    /**
-     * Reads {@link IgniteUuid}.
-     *
-     * @param name Field name.
-     * @return {@link IgniteUuid}.
-     */
-    public IgniteUuid readIgniteUuid(String name);
-
-    /**
-     * Reads nested message.
+     * Reads field.
      *
      * @param name Field name.
-     * @return Message.
+     * @param type Field type.
+     * @return Field value.
      */
-    public <T extends MessageAdapter> T readMessage(String name);
+    public <T> T readField(String name, MessageFieldType type);
 
     /**
      * Reads array of objects.
@@ -211,7 +50,7 @@ public interface MessageReader {
      * @param itemCls Array component class.
      * @return Array of objects.
      */
-    public <T> T[] readObjectArray(String name, MessageFieldType itemType, Class<T> itemCls);
+    public <T> T[] readArrayField(String name, MessageFieldType itemType, Class<T> itemCls);
 
     /**
      * Reads collection.
@@ -220,7 +59,7 @@ public interface MessageReader {
      * @param itemType Collection item type.
      * @return Collection.
      */
-    public <C extends Collection<?>> C readCollection(String name, MessageFieldType itemType);
+    public <C extends Collection<?>> C readCollectionField(String name, MessageFieldType itemType);
 
     /**
      * Reads map.
@@ -231,7 +70,7 @@ public interface MessageReader {
      * @param linked Whether {@link LinkedHashMap} should be created.
      * @return Map.
      */
-    public <M extends Map<?, ?>> M readMap(String name, MessageFieldType keyType, MessageFieldType valType,
+    public <M extends Map<?, ?>> M readMapField(String name, MessageFieldType keyType, MessageFieldType valType,
         boolean linked);
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java
index a70be8f..ab3b384 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java
@@ -17,8 +17,6 @@
 
 package org.apache.ignite.plugin.extensions.communication;
 
-import org.apache.ignite.lang.*;
-
 import java.nio.*;
 import java.util.*;
 
@@ -29,200 +27,29 @@ import java.util.*;
  */
 public interface MessageWriter {
     /**
-     * Sets but buffer to write to.
+     * Sets byte buffer to write to.
      *
      * @param buf Byte buffer.
      */
     public void setBuffer(ByteBuffer buf);
 
     /**
-     * Writes {@code byte} value.
-     *
-     * @param name Field name.
-     * @param val {@code byte} value.
-     * @return Whether value was fully written.
-     */
-    public boolean writeByte(String name, byte val);
-
-    /**
-     * Writes {@code short} value.
-     *
-     * @param name Field name.
-     * @param val {@code short} value.
-     * @return Whether value was fully written.
-     */
-    public boolean writeShort(String name, short val);
-
-    /**
-     * Writes {@code int} value.
-     *
-     * @param name Field name.
-     * @param val {@code int} value.
-     * @return Whether value was fully written.
-     */
-    public boolean writeInt(String name, int val);
-
-    /**
-     * Writes {@code long} value.
-     *
-     * @param name Field name.
-     * @param val {@code long} value.
-     * @return Whether value was fully written.
-     */
-    public boolean writeLong(String name, long val);
-
-    /**
-     * Writes {@code float} value.
-     *
-     * @param name Field name.
-     * @param val {@code float} value.
-     * @return Whether value was fully written.
-     */
-    public boolean writeFloat(String name, float val);
-
-    /**
-     * Writes {@code double} value.
-     *
-     * @param name Field name.
-     * @param val {@code double} value.
-     * @return Whether value was fully written.
-     */
-    public boolean writeDouble(String name, double val);
-
-    /**
-     * Writes {@code char} value.
-     *
-     * @param name Field name.
-     * @param val {@code char} value.
-     * @return Whether value was fully written.
-     */
-    public boolean writeChar(String name, char val);
-
-    /**
-     * Writes {@code boolean} value.
-     *
-     * @param name Field name.
-     * @param val {@code boolean} value.
-     * @return Whether value was fully written.
-     */
-    public boolean writeBoolean(String name, boolean val);
-
-    /**
-     * Writes {@code byte} array.
-     *
-     * @param name Field name.
-     * @param val {@code byte} array.
-     * @return Whether array was fully written.
-     */
-    public boolean writeByteArray(String name, byte[] val);
-
-    /**
-     * Writes {@code short} array.
-     *
-     * @param name Field name.
-     * @param val {@code short} array.
-     * @return Whether array was fully written.
-     */
-    public boolean writeShortArray(String name, short[] val);
-
-    /**
-     * Writes {@code int} array.
-     *
-     * @param name Field name.
-     * @param val {@code int} array.
-     * @return Whether array was fully written.
-     */
-    public boolean writeIntArray(String name, int[] val);
-
-    /**
-     * Writes {@code long} array.
+     * Writes message type.
      *
-     * @param name Field name.
-     * @param val {@code long} array.
-     * @return Whether array was fully written.
-     */
-    public boolean writeLongArray(String name, long[] val);
-
-    /**
-     * Writes {@code float} array.
-     *
-     * @param name Field name.
-     * @param val {@code float} array.
-     * @return Whether array was fully written.
-     */
-    public boolean writeFloatArray(String name, float[] val);
-
-    /**
-     * Writes {@code double} array.
-     *
-     * @param name Field name.
-     * @param val {@code double} array.
-     * @return Whether array was fully written.
-     */
-    public boolean writeDoubleArray(String name, double[] val);
-
-    /**
-     * Writes {@code char} array.
-     *
-     * @param name Field name.
-     * @param val {@code char} array.
-     * @return Whether array was fully written.
+     * @param msgType Message type.
+     * @return Whether message type was written.
      */
-    public boolean writeCharArray(String name, char[] val);
+    public boolean writeMessageType(byte msgType);
 
     /**
-     * Writes {@code boolean} array.
+     * Writes field.
      *
      * @param name Field name.
-     * @param val {@code boolean} array.
-     * @return Whether array was fully written.
+     * @param val Field value.
+     * @param type Field type.
+     * @return Whether field was fully written.
      */
-    public boolean writeBooleanArray(String name, boolean[] val);
-
-    /**
-     * Writes {@link String}.
-     *
-     * @param name Field name.
-     * @param val {@link String}.
-     * @return Whether value was fully written.
-     */
-    public boolean writeString(String name, String val);
-
-    /**
-     * Writes {@link BitSet}.
-     *
-     * @param name Field name.
-     * @param val {@link BitSet}.
-     * @return Whether value was fully written.
-     */
-    public boolean writeBitSet(String name, BitSet val);
-
-    /**
-     * Writes {@link UUID}.
-     *
-     * @param name Field name.
-     * @param val {@link UUID}.
-     * @return Whether value was fully written.
-     */
-    public boolean writeUuid(String name, UUID val);
-
-    /**
-     * Writes {@link IgniteUuid}.
-     *
-     * @param name Field name.
-     * @param val {@link IgniteUuid}.
-     * @return Whether value was fully written.
-     */
-    public boolean writeIgniteUuid(String name, IgniteUuid val);
-
-    /**
-     * Writes nested message.
-     *
-     * @param name Field name.
-     * @param val Message.
-     * @return Whether value was fully written.
-     */
-    public boolean writeMessage(String name, MessageAdapter val);
+    public boolean writeField(String name, Object val, MessageFieldType type);
 
     /**
      * Writes array of objects.
@@ -232,7 +59,7 @@ public interface MessageWriter {
      * @param itemType Array component type.
      * @return Whether array was fully written.
      */
-    public <T> boolean writeObjectArray(String name, T[] arr, MessageFieldType itemType);
+    public <T> boolean writeArrayField(String name, T[] arr, MessageFieldType itemType);
 
     /**
      * Writes collection.
@@ -242,7 +69,7 @@ public interface MessageWriter {
      * @param itemType Collection item type.
      * @return Whether value was fully written.
      */
-    public <T> boolean writeCollection(String name, Collection<T> col, MessageFieldType itemType);
+    public <T> boolean writeCollectionField(String name, Collection<T> col, MessageFieldType itemType);
 
     /**
      * Writes map.
@@ -253,20 +80,45 @@ public interface MessageWriter {
      * @param valType Map value type.
      * @return Whether value was fully written.
      */
-    public <K, V> boolean writeMap(String name, Map<K, V> map, MessageFieldType keyType,
+    public <K, V> boolean writeMapField(String name, Map<K, V> map, MessageFieldType keyType,
         MessageFieldType valType);
 
+    /**
+     * @return Whether type for current message is already written.
+     */
     public boolean isTypeWritten();
 
+    /**
+     * Callback called after message type is written.
+     */
     public void onTypeWritten();
 
+    /**
+     * Gets current state.
+     *
+     * @return State.
+     */
     public int state();
 
+    /**
+     * Increments state.
+     */
     public void incrementState();
 
+    /**
+     * Callback called before inner message is written.
+     */
     public void beforeInnerMessageWrite();
 
+    /**
+     * Callback called after inner message is written.
+     *
+     * @param finished Whether inner message was fully written.
+     */
     public void afterInnerMessageWrite(boolean finished);
 
+    /**
+     * Resets the state of this writer.
+     */
     public void reset();
 }


Mime
View raw message