ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [33/50] [abbrv] incubator-ignite git commit: ignite-nio - Removing message clone
Date Sun, 15 Feb 2015 08:42:15 GMT
ignite-nio - Removing message clone


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

Branch: refs/heads/sprint-1
Commit: af8edc04c356be979e4e10c6ed3574c43a547dfa
Parents: 3a05bf1
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Sat Feb 14 22:39:52 2015 -0800
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Sat Feb 14 22:39:52 2015 -0800

----------------------------------------------------------------------
 .../CommunicationMessageCodeGenerator.java      |   2 +-
 .../ignite/internal/GridJobCancelRequest.java   |  14 +-
 .../ignite/internal/GridJobExecuteRequest.java  |  86 +++----
 .../ignite/internal/GridJobExecuteResponse.java |  30 +--
 .../ignite/internal/GridJobSiblingsRequest.java |  10 +-
 .../internal/GridJobSiblingsResponse.java       |   6 +-
 .../ignite/internal/GridTaskCancelRequest.java  |   6 +-
 .../ignite/internal/GridTaskSessionRequest.java |  14 +-
 .../internal/direct/DirectMessageReader.java    | 219 ++++++------------
 .../internal/direct/DirectMessageWriter.java    | 179 +++++++--------
 .../checkpoint/GridCheckpointRequest.java       |  14 +-
 .../managers/communication/GridIoMessage.java   |  30 +--
 .../communication/GridIoUserMessage.java        |  30 +--
 .../deployment/GridDeploymentInfoBean.java      |  22 +-
 .../deployment/GridDeploymentRequest.java       |  22 +-
 .../deployment/GridDeploymentResponse.java      |  14 +-
 .../eventstorage/GridEventStorageMessage.java   |  38 ++--
 .../cache/GridCacheEvictionRequest.java         |  14 +-
 .../cache/GridCacheEvictionResponse.java        |  14 +-
 .../processors/cache/GridCacheMessage.java      |  14 +-
 .../processors/cache/GridCacheValueBytes.java   |  10 +-
 ...idCacheOptimisticCheckPreparedTxRequest.java |  22 +-
 ...dCacheOptimisticCheckPreparedTxResponse.java |  14 +-
 ...CachePessimisticCheckCommittedTxRequest.java |  30 +--
 ...achePessimisticCheckCommittedTxResponse.java |  18 +-
 .../distributed/GridCacheTtlUpdateRequest.java  |  26 +--
 .../distributed/GridDistributedBaseMessage.java |  22 +-
 .../distributed/GridDistributedLockRequest.java |  66 +++---
 .../GridDistributedLockResponse.java            |  14 +-
 .../GridDistributedTxFinishRequest.java         |  54 ++---
 .../GridDistributedTxFinishResponse.java        |  10 +-
 .../GridDistributedTxPrepareRequest.java        |  58 ++---
 .../GridDistributedTxPrepareResponse.java       |  10 +-
 .../GridDistributedUnlockRequest.java           |   6 +-
 .../dht/GridDhtAffinityAssignmentRequest.java   |   6 +-
 .../dht/GridDhtAffinityAssignmentResponse.java  |  10 +-
 .../distributed/dht/GridDhtLockRequest.java     |  38 ++--
 .../distributed/dht/GridDhtLockResponse.java    |  18 +-
 .../distributed/dht/GridDhtTxFinishRequest.java |  54 ++---
 .../dht/GridDhtTxFinishResponse.java            |   6 +-
 .../dht/GridDhtTxPrepareRequest.java            |  50 ++---
 .../dht/GridDhtTxPrepareResponse.java           |  22 +-
 .../distributed/dht/GridDhtUnlockRequest.java   |   6 +-
 .../GridDhtAtomicDeferredUpdateResponse.java    |   6 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |  82 +++----
 .../dht/atomic/GridDhtAtomicUpdateResponse.java |  18 +-
 .../dht/atomic/GridNearAtomicUpdateRequest.java |  78 +++----
 .../atomic/GridNearAtomicUpdateResponse.java    |  46 ++--
 .../dht/preloader/GridDhtForceKeysRequest.java  |  18 +-
 .../dht/preloader/GridDhtForceKeysResponse.java |  18 +-
 .../GridDhtPartitionDemandMessage.java          |  26 +--
 .../preloader/GridDhtPartitionExchangeId.java   |  14 +-
 .../GridDhtPartitionSupplyMessage.java          |  26 +--
 .../GridDhtPartitionsAbstractMessage.java       |  10 +-
 .../preloader/GridDhtPartitionsFullMessage.java |  10 +-
 .../GridDhtPartitionsSingleMessage.java         |   6 +-
 .../GridDhtPartitionsSingleRequest.java         |   2 +-
 .../distributed/near/GridNearGetRequest.java    |  46 ++--
 .../distributed/near/GridNearGetResponse.java   |  30 +--
 .../distributed/near/GridNearLockRequest.java   |  50 ++---
 .../distributed/near/GridNearLockResponse.java  |  22 +-
 .../near/GridNearTxFinishRequest.java           |  26 +--
 .../near/GridNearTxFinishResponse.java          |  14 +-
 .../near/GridNearTxPrepareRequest.java          |  34 +--
 .../near/GridNearTxPrepareResponse.java         |  26 +--
 .../distributed/near/GridNearUnlockRequest.java |   2 +-
 .../cache/query/GridCacheQueryRequest.java      |  78 +++----
 .../cache/query/GridCacheQueryResponse.java     |  26 +--
 .../cache/version/GridCacheVersion.java         |  18 +-
 .../clock/GridClockDeltaSnapshotMessage.java    |  10 +-
 .../processors/clock/GridClockDeltaVersion.java |  10 +-
 .../continuous/GridContinuousMessage.java       |  18 +-
 .../dataload/GridDataLoadRequest.java           |  54 ++---
 .../dataload/GridDataLoadResponse.java          |  14 +-
 .../processors/igfs/IgfsAckMessage.java         |  14 +-
 .../internal/processors/igfs/IgfsBlockKey.java  |  18 +-
 .../processors/igfs/IgfsBlocksMessage.java      |  14 +-
 .../igfs/IgfsCommunicationMessage.java          |   2 +-
 .../processors/igfs/IgfsDeleteMessage.java      |  10 +-
 .../processors/igfs/IgfsFileAffinityRange.java  |  22 +-
 .../igfs/IgfsFragmentizerRequest.java           |  10 +-
 .../igfs/IgfsFragmentizerResponse.java          |   6 +-
 .../processors/igfs/IgfsSyncMessage.java        |  10 +-
 .../handlers/task/GridTaskResultRequest.java    |  10 +-
 .../handlers/task/GridTaskResultResponse.java   |  18 +-
 .../streamer/GridStreamerCancelRequest.java     |   6 +-
 .../streamer/GridStreamerExecutionRequest.java  |  30 +--
 .../streamer/GridStreamerResponse.java          |  10 +-
 .../ignite/internal/util/GridByteArrayList.java |  10 +-
 .../ignite/internal/util/GridLongList.java      |  10 +-
 .../extensions/communication/MessageReader.java | 177 +--------------
 .../extensions/communication/MessageWriter.java | 224 ++++---------------
 .../jobstealing/JobStealingRequest.java         |   6 +-
 93 files changed, 1194 insertions(+), 1599 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java b/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java
index 97ccc4d..0a1d6de 100644
--- a/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java
+++ b/modules/codegen/src/main/java/org/apache/ignite/codegen/CommunicationMessageCodeGenerator.java
@@ -414,7 +414,7 @@ public class CommunicationMessageCodeGenerator {
 
             indent++;
 
-            returnFalseIfFailed(code, "writer.writeByte", "null", "directType()");
+            returnFalseIfFailed(code, "writer.writeMessageType", "directType()");
 
             code.add(EMPTY);
             code.add(builder().a("writer.onTypeWritten();").toString());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/GridJobCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobCancelRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobCancelRequest.java
index 4f9baff..74e57e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobCancelRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobCancelRequest.java
@@ -114,7 +114,7 @@ public class GridJobCancelRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -122,19 +122,19 @@ public class GridJobCancelRequest extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("jobId", jobId))
+                if (!writer.writeField("jobId", jobId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("sesId", sesId))
+                if (!writer.writeField("sesId", sesId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeBoolean("sys", sys))
+                if (!writer.writeField("sys", sys, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
@@ -150,7 +150,7 @@ public class GridJobCancelRequest extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                jobId = reader.readIgniteUuid("jobId");
+                jobId = reader.readField("jobId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -158,7 +158,7 @@ public class GridJobCancelRequest extends MessageAdapter {
                 readState++;
 
             case 1:
-                sesId = reader.readIgniteUuid("sesId");
+                sesId = reader.readField("sesId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -166,7 +166,7 @@ public class GridJobCancelRequest extends MessageAdapter {
                 readState++;
 
             case 2:
-                sys = reader.readBoolean("sys");
+                sys = reader.readField("sys", 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/GridJobExecuteRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java
index eef9f78..12b29c3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteRequest.java
@@ -416,7 +416,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -424,127 +424,127 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("clsLdrId", clsLdrId))
+                if (!writer.writeField("clsLdrId", clsLdrId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeString("cpSpi", cpSpi))
+                if (!writer.writeField("cpSpi", cpSpi, MessageFieldType.STRING))
                     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("dynamicSiblings", dynamicSiblings))
+                if (!writer.writeField("dynamicSiblings", dynamicSiblings, MessageFieldType.BOOLEAN))
                     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("internal", internal))
+                if (!writer.writeField("internal", internal, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 6:
-                if (!writer.writeByteArray("jobAttrsBytes", jobAttrsBytes))
+                if (!writer.writeField("jobAttrsBytes", jobAttrsBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 7:
-                if (!writer.writeByteArray("jobBytes", jobBytes))
+                if (!writer.writeField("jobBytes", jobBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 8:
-                if (!writer.writeIgniteUuid("jobId", jobId))
+                if (!writer.writeField("jobId", jobId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 9:
-                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 10:
-                if (!writer.writeByteArray("sesAttrsBytes", sesAttrsBytes))
+                if (!writer.writeField("sesAttrsBytes", sesAttrsBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 11:
-                if (!writer.writeBoolean("sesFullSup", sesFullSup))
+                if (!writer.writeField("sesFullSup", sesFullSup, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 12:
-                if (!writer.writeIgniteUuid("sesId", sesId))
+                if (!writer.writeField("sesId", sesId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 13:
-                if (!writer.writeByteArray("siblingsBytes", siblingsBytes))
+                if (!writer.writeField("siblingsBytes", siblingsBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 14:
-                if (!writer.writeLong("startTaskTime", startTaskTime))
+                if (!writer.writeField("startTaskTime", startTaskTime, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 15:
-                if (!writer.writeUuid("subjId", subjId))
+                if (!writer.writeField("subjId", subjId, MessageFieldType.UUID))
                     return false;
 
                 writer.incrementState();
 
             case 16:
-                if (!writer.writeString("taskClsName", taskClsName))
+                if (!writer.writeField("taskClsName", taskClsName, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 17:
-                if (!writer.writeString("taskName", taskName))
+                if (!writer.writeField("taskName", taskName, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 18:
-                if (!writer.writeLong("timeout", timeout))
+                if (!writer.writeField("timeout", timeout, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 19:
-                if (!writer.writeCollection("top", top, MessageFieldType.UUID))
+                if (!writer.writeCollectionField("top", top, MessageFieldType.UUID))
                     return false;
 
                 writer.incrementState();
 
             case 20:
-                if (!writer.writeString("userVer", userVer))
+                if (!writer.writeField("userVer", userVer, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
@@ -560,7 +560,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
 
         switch (readState) {
             case 0:
-                clsLdrId = reader.readIgniteUuid("clsLdrId");
+                clsLdrId = reader.readField("clsLdrId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -568,7 +568,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 1:
-                cpSpi = reader.readString("cpSpi");
+                cpSpi = reader.readField("cpSpi", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -578,7 +578,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
             case 2:
                 byte depModeOrd;
 
-                depModeOrd = reader.readByte("depMode");
+                depModeOrd = reader.readField("depMode", MessageFieldType.BYTE);
 
                 if (!reader.isLastRead())
                     return false;
@@ -588,7 +588,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 3:
-                dynamicSiblings = reader.readBoolean("dynamicSiblings");
+                dynamicSiblings = reader.readField("dynamicSiblings", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -596,7 +596,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 4:
-                forceLocDep = reader.readBoolean("forceLocDep");
+                forceLocDep = reader.readField("forceLocDep", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -604,7 +604,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 5:
-                internal = reader.readBoolean("internal");
+                internal = reader.readField("internal", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -612,7 +612,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 6:
-                jobAttrsBytes = reader.readByteArray("jobAttrsBytes");
+                jobAttrsBytes = reader.readField("jobAttrsBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -620,7 +620,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 7:
-                jobBytes = reader.readByteArray("jobBytes");
+                jobBytes = reader.readField("jobBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -628,7 +628,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 8:
-                jobId = reader.readIgniteUuid("jobId");
+                jobId = reader.readField("jobId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -636,7 +636,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 9:
-                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;
@@ -644,7 +644,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 10:
-                sesAttrsBytes = reader.readByteArray("sesAttrsBytes");
+                sesAttrsBytes = reader.readField("sesAttrsBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -652,7 +652,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 11:
-                sesFullSup = reader.readBoolean("sesFullSup");
+                sesFullSup = reader.readField("sesFullSup", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -660,7 +660,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 12:
-                sesId = reader.readIgniteUuid("sesId");
+                sesId = reader.readField("sesId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -668,7 +668,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 13:
-                siblingsBytes = reader.readByteArray("siblingsBytes");
+                siblingsBytes = reader.readField("siblingsBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -676,7 +676,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 14:
-                startTaskTime = reader.readLong("startTaskTime");
+                startTaskTime = reader.readField("startTaskTime", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -684,7 +684,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 15:
-                subjId = reader.readUuid("subjId");
+                subjId = reader.readField("subjId", MessageFieldType.UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -692,7 +692,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 16:
-                taskClsName = reader.readString("taskClsName");
+                taskClsName = reader.readField("taskClsName", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -700,7 +700,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 17:
-                taskName = reader.readString("taskName");
+                taskName = reader.readField("taskName", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -708,7 +708,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 18:
-                timeout = reader.readLong("timeout");
+                timeout = reader.readField("timeout", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -716,7 +716,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 19:
-                top = reader.readCollection("top", MessageFieldType.UUID);
+                top = reader.readCollectionField("top", MessageFieldType.UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -724,7 +724,7 @@ public class GridJobExecuteRequest extends MessageAdapter implements GridTaskMes
                 readState++;
 
             case 20:
-                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/GridJobExecuteResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteResponse.java
index fb0f72d..d9f0518 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobExecuteResponse.java
@@ -209,7 +209,7 @@ public class GridJobExecuteResponse extends MessageAdapter implements GridTaskMe
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -217,43 +217,43 @@ public class GridJobExecuteResponse extends MessageAdapter implements GridTaskMe
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("gridExBytes", gridExBytes))
+                if (!writer.writeField("gridExBytes", gridExBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeBoolean("isCancelled", isCancelled))
+                if (!writer.writeField("isCancelled", isCancelled, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeByteArray("jobAttrsBytes", jobAttrsBytes))
+                if (!writer.writeField("jobAttrsBytes", jobAttrsBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeIgniteUuid("jobId", jobId))
+                if (!writer.writeField("jobId", jobId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeUuid("nodeId", nodeId))
+                if (!writer.writeField("nodeId", nodeId, MessageFieldType.UUID))
                     return false;
 
                 writer.incrementState();
 
             case 5:
-                if (!writer.writeByteArray("resBytes", resBytes))
+                if (!writer.writeField("resBytes", resBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 6:
-                if (!writer.writeIgniteUuid("sesId", sesId))
+                if (!writer.writeField("sesId", sesId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
@@ -269,7 +269,7 @@ public class GridJobExecuteResponse extends MessageAdapter implements GridTaskMe
 
         switch (readState) {
             case 0:
-                gridExBytes = reader.readByteArray("gridExBytes");
+                gridExBytes = reader.readField("gridExBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -277,7 +277,7 @@ public class GridJobExecuteResponse extends MessageAdapter implements GridTaskMe
                 readState++;
 
             case 1:
-                isCancelled = reader.readBoolean("isCancelled");
+                isCancelled = reader.readField("isCancelled", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -285,7 +285,7 @@ public class GridJobExecuteResponse extends MessageAdapter implements GridTaskMe
                 readState++;
 
             case 2:
-                jobAttrsBytes = reader.readByteArray("jobAttrsBytes");
+                jobAttrsBytes = reader.readField("jobAttrsBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -293,7 +293,7 @@ public class GridJobExecuteResponse extends MessageAdapter implements GridTaskMe
                 readState++;
 
             case 3:
-                jobId = reader.readIgniteUuid("jobId");
+                jobId = reader.readField("jobId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -301,7 +301,7 @@ public class GridJobExecuteResponse extends MessageAdapter implements GridTaskMe
                 readState++;
 
             case 4:
-                nodeId = reader.readUuid("nodeId");
+                nodeId = reader.readField("nodeId", MessageFieldType.UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -309,7 +309,7 @@ public class GridJobExecuteResponse extends MessageAdapter implements GridTaskMe
                 readState++;
 
             case 5:
-                resBytes = reader.readByteArray("resBytes");
+                resBytes = reader.readField("resBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -317,7 +317,7 @@ public class GridJobExecuteResponse extends MessageAdapter implements GridTaskMe
                 readState++;
 
             case 6:
-                sesId = reader.readIgniteUuid("sesId");
+                sesId = reader.readField("sesId", 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/GridJobSiblingsRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingsRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingsRequest.java
index 6ef7102..3b1344b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingsRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingsRequest.java
@@ -88,7 +88,7 @@ public class GridJobSiblingsRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -96,13 +96,13 @@ public class GridJobSiblingsRequest extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("sesId", sesId))
+                if (!writer.writeField("sesId", sesId, 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();
@@ -118,7 +118,7 @@ public class GridJobSiblingsRequest extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                sesId = reader.readIgniteUuid("sesId");
+                sesId = reader.readField("sesId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -126,7 +126,7 @@ public class GridJobSiblingsRequest 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/GridJobSiblingsResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingsResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingsResponse.java
index 77032fc..0794b5b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingsResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingsResponse.java
@@ -81,7 +81,7 @@ public class GridJobSiblingsResponse extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -89,7 +89,7 @@ public class GridJobSiblingsResponse extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("siblingsBytes", siblingsBytes))
+                if (!writer.writeField("siblingsBytes", siblingsBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
@@ -105,7 +105,7 @@ public class GridJobSiblingsResponse extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                siblingsBytes = reader.readByteArray("siblingsBytes");
+                siblingsBytes = reader.readField("siblingsBytes", 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/GridTaskCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTaskCancelRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTaskCancelRequest.java
index 2501522..9fa17c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridTaskCancelRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTaskCancelRequest.java
@@ -65,7 +65,7 @@ public class GridTaskCancelRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -73,7 +73,7 @@ public class GridTaskCancelRequest extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("sesId", sesId))
+                if (!writer.writeField("sesId", sesId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
@@ -89,7 +89,7 @@ public class GridTaskCancelRequest extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                sesId = reader.readIgniteUuid("sesId");
+                sesId = reader.readField("sesId", 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/GridTaskSessionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionRequest.java
index 214c2f1..a827419 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionRequest.java
@@ -102,7 +102,7 @@ public class GridTaskSessionRequest extends MessageAdapter implements GridTaskMe
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -110,19 +110,19 @@ public class GridTaskSessionRequest extends MessageAdapter implements GridTaskMe
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("attrsBytes", attrsBytes))
+                if (!writer.writeField("attrsBytes", attrsBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("jobId", jobId))
+                if (!writer.writeField("jobId", jobId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeIgniteUuid("sesId", sesId))
+                if (!writer.writeField("sesId", sesId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
@@ -138,7 +138,7 @@ public class GridTaskSessionRequest extends MessageAdapter implements GridTaskMe
 
         switch (readState) {
             case 0:
-                attrsBytes = reader.readByteArray("attrsBytes");
+                attrsBytes = reader.readField("attrsBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -146,7 +146,7 @@ public class GridTaskSessionRequest extends MessageAdapter implements GridTaskMe
                 readState++;
 
             case 1:
-                jobId = reader.readIgniteUuid("jobId");
+                jobId = reader.readField("jobId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -154,7 +154,7 @@ public class GridTaskSessionRequest extends MessageAdapter implements GridTaskMe
                 readState++;
 
             case 2:
-                sesId = reader.readIgniteUuid("sesId");
+                sesId = reader.readField("sesId", 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/direct/DirectMessageReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
index 0e6ef5b..40123ca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageReader.java
@@ -17,9 +17,7 @@
 
 package org.apache.ignite.internal.direct;
 
-import org.apache.ignite.lang.*;
 import org.apache.ignite.plugin.extensions.communication.*;
-import org.jetbrains.annotations.*;
 
 import java.nio.*;
 import java.util.*;
@@ -47,196 +45,127 @@ public class DirectMessageReader implements MessageReader {
     }
 
     /** {@inheritDoc} */
-    @Override public byte readByte(String name) {
-        byte val = stream.readByte();
+    @SuppressWarnings("unchecked")
+    @Override public <T> T readField(String name, MessageFieldType type) {
+        Object val;
 
-        lastRead = stream.lastFinished();
-
-        return val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public short readShort(String name) {
-        short val = stream.readShort();
-
-        lastRead = stream.lastFinished();
-
-        return val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int readInt(String name) {
-        int val = stream.readInt();
-
-        lastRead = stream.lastFinished();
-
-        return val;
-    }
+        switch (type) {
+            case BYTE:
+                val = stream.readByte();
 
-    /** {@inheritDoc} */
-    @Override public long readLong(String name) {
-        long val = stream.readLong();
+                break;
 
-        lastRead = stream.lastFinished();
+            case SHORT:
+                val = stream.readShort();
 
-        return val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public float readFloat(String name) {
-        float val = stream.readFloat();
+                break;
 
-        lastRead = stream.lastFinished();
-
-        return val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public double readDouble(String name) {
-        double val = stream.readDouble();
-
-        lastRead = stream.lastFinished();
-
-        return val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public char readChar(String name) {
-        char val = stream.readChar();
-
-        lastRead = stream.lastFinished();
-
-        return val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean readBoolean(String name) {
-        boolean val = stream.readBoolean();
-
-        lastRead = stream.lastFinished();
+            case INT:
+                val = stream.readInt();
 
-        return val;
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Nullable @Override public byte[] readByteArray(String name) {
-        byte[] arr = stream.readByteArray();
+            case LONG:
+                val = stream.readLong();
 
-        lastRead = stream.lastFinished();
+                break;
 
-        return arr;
-    }
+            case FLOAT:
+                val = stream.readFloat();
 
-    /** {@inheritDoc} */
-    @Nullable @Override public short[] readShortArray(String name) {
-        short[] arr = stream.readShortArray();
+                break;
 
-        lastRead = stream.lastFinished();
+            case DOUBLE:
+                val = stream.readDouble();
 
-        return arr;
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Nullable @Override public int[] readIntArray(String name) {
-        int[] arr = stream.readIntArray();
+            case CHAR:
+                val = stream.readChar();
 
-        lastRead = stream.lastFinished();
+                break;
 
-        return arr;
-    }
+            case BOOLEAN:
+                val = stream.readBoolean();
 
-    /** {@inheritDoc} */
-    @Nullable @Override public long[] readLongArray(String name) {
-        long[] arr = stream.readLongArray();
+                break;
 
-        lastRead = stream.lastFinished();
+            case BYTE_ARR:
+                val = stream.readByteArray();
 
-        return arr;
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Nullable @Override public float[] readFloatArray(String name) {
-        float[] arr = stream.readFloatArray();
+            case SHORT_ARR:
+                val = stream.readShortArray();
 
-        lastRead = stream.lastFinished();
+                break;
 
-        return arr;
-    }
+            case INT_ARR:
+                val = stream.readIntArray();
 
-    /** {@inheritDoc} */
-    @Nullable @Override public double[] readDoubleArray(String name) {
-        double[] arr = stream.readDoubleArray();
+                break;
 
-        lastRead = stream.lastFinished();
+            case LONG_ARR:
+                val = stream.readLongArray();
 
-        return arr;
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Nullable @Override public char[] readCharArray(String name) {
-        char[] arr = stream.readCharArray();
+            case FLOAT_ARR:
+                val = stream.readFloatArray();
 
-        lastRead = stream.lastFinished();
+                break;
 
-        return arr;
-    }
+            case DOUBLE_ARR:
+                val = stream.readDoubleArray();
 
-    /** {@inheritDoc} */
-    @Nullable @Override public boolean[] readBooleanArray(String name) {
-        boolean[] arr = stream.readBooleanArray();
+                break;
 
-        lastRead = stream.lastFinished();
+            case CHAR_ARR:
+                val = stream.readCharArray();
 
-        return arr;
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public String readString(String name) {
-        String val = stream.readString();
+            case BOOLEAN_ARR:
+                val = stream.readBooleanArray();
 
-        lastRead = stream.lastFinished();
+                break;
 
-        return val;
-    }
+            case STRING:
+                val = stream.readString();
 
-    /** {@inheritDoc} */
-    @Override public BitSet readBitSet(String name) {
-        BitSet val = stream.readBitSet();
+                break;
 
-        lastRead = stream.lastFinished();
+            case BIT_SET:
+                val = stream.readBitSet();
 
-        return val;
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public UUID readUuid(String name) {
-        UUID val = stream.readUuid();
+            case UUID:
+                val = stream.readUuid();
 
-        lastRead = stream.lastFinished();
+                break;
 
-        return val;
-    }
+            case IGNITE_UUID:
+                val = stream.readIgniteUuid();
 
-    /** {@inheritDoc} */
-    @Override public IgniteUuid readIgniteUuid(String name) {
-        IgniteUuid val = stream.readIgniteUuid();
+                break;
 
-        lastRead = stream.lastFinished();
+            case MSG:
+                val = stream.readMessage();
 
-        return val;
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Nullable @Override public <T extends MessageAdapter> T readMessage(String name) {
-        T msg = stream.readMessage();
+            default:
+                throw new IllegalStateException("Unknown field type: " + type);
+        }
 
         lastRead = stream.lastFinished();
 
-        return msg;
+        return (T)val;
     }
 
     /** {@inheritDoc} */
-    @Override public <T> T[] readObjectArray(String name, MessageFieldType itemType, Class<T> itemCls) {
+    @Override public <T> T[] readArrayField(String name, MessageFieldType itemType, Class<T> itemCls) {
         T[] msg = stream.readObjectArray(itemType, itemCls);
 
         lastRead = stream.lastFinished();
@@ -245,7 +174,7 @@ public class DirectMessageReader implements MessageReader {
     }
 
     /** {@inheritDoc} */
-    @Override public <C extends Collection<?>> C readCollection(String name, MessageFieldType itemType) {
+    @Override public <C extends Collection<?>> C readCollectionField(String name, MessageFieldType itemType) {
         C col = stream.readCollection(itemType);
 
         lastRead = stream.lastFinished();
@@ -254,7 +183,7 @@ public class DirectMessageReader implements MessageReader {
     }
 
     /** {@inheritDoc} */
-    @Override public <M extends Map<?, ?>> M readMap(String name, MessageFieldType keyType,
+    @Override public <M extends Map<?, ?>> M readMapField(String name, MessageFieldType keyType,
         MessageFieldType valType, boolean linked) {
         M map = stream.readMap(keyType, valType, linked);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
index ced0889..f4efc0a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
@@ -40,168 +40,143 @@ public class DirectMessageWriter implements MessageWriter {
     }
 
     /** {@inheritDoc} */
-    @Override public boolean writeByte(String name, byte val) {
-        stream.writeByte(val);
+    @Override public boolean writeMessageType(byte msgType) {
+        stream.writeByte(msgType);
 
         return stream.lastFinished();
     }
 
     /** {@inheritDoc} */
-    @Override public boolean writeShort(String name, short val) {
-        stream.writeShort(val);
+    @Override public boolean writeField(String name, Object val, MessageFieldType type) {
+        switch (type) {
+            case BYTE:
+                stream.writeByte((byte)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeInt(String name, int val) {
-        stream.writeInt(val);
+            case SHORT:
+                stream.writeShort((short)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeLong(String name, long val) {
-        stream.writeLong(val);
+            case INT:
+                stream.writeInt((int)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeFloat(String name, float val) {
-        stream.writeFloat(val);
+            case LONG:
+                stream.writeLong((long)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeDouble(String name, double val) {
-        stream.writeDouble(val);
+            case FLOAT:
+                stream.writeFloat((float)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeChar(String name, char val) {
-        stream.writeChar(val);
+            case DOUBLE:
+                stream.writeDouble((double)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeBoolean(String name, boolean val) {
-        stream.writeBoolean(val);
+            case CHAR:
+                stream.writeChar((char)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeByteArray(String name, @Nullable byte[] val) {
-        stream.writeByteArray(val);
+            case BOOLEAN:
+                stream.writeBoolean((boolean)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeShortArray(String name, @Nullable short[] val) {
-        stream.writeShortArray(val);
+            case BYTE_ARR:
+                stream.writeByteArray((byte[])val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeIntArray(String name, @Nullable int[] val) {
-        stream.writeIntArray(val);
+            case SHORT_ARR:
+                stream.writeShortArray((short[])val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeLongArray(String name, @Nullable long[] val) {
-        stream.writeLongArray(val);
+            case INT_ARR:
+                stream.writeIntArray((int[])val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeFloatArray(String name, @Nullable float[] val) {
-        stream.writeFloatArray(val);
+            case LONG_ARR:
+                stream.writeLongArray((long[])val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeDoubleArray(String name, @Nullable double[] val) {
-        stream.writeDoubleArray(val);
+            case FLOAT_ARR:
+                stream.writeFloatArray((float[])val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeCharArray(String name, @Nullable char[] val) {
-        stream.writeCharArray(val);
+            case DOUBLE_ARR:
+                stream.writeDoubleArray((double[])val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeBooleanArray(String name, @Nullable boolean[] val) {
-        stream.writeBooleanArray(val);
+            case CHAR_ARR:
+                stream.writeCharArray((char[])val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeString(String name, String val) {
-        stream.writeString(val);
+            case BOOLEAN_ARR:
+                stream.writeBooleanArray((boolean[])val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeBitSet(String name, BitSet val) {
-        stream.writeBitSet(val);
+            case STRING:
+                stream.writeString((String)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeUuid(String name, UUID val) {
-        stream.writeUuid(val);
+            case BIT_SET:
+                stream.writeBitSet((BitSet)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeIgniteUuid(String name, IgniteUuid val) {
-        stream.writeIgniteUuid(val);
+            case UUID:
+                stream.writeUuid((UUID)val);
 
-        return stream.lastFinished();
-    }
+                break;
 
-    /** {@inheritDoc} */
-    @Override public boolean writeMessage(String name, @Nullable MessageAdapter msg) {
-        stream.writeMessage(msg, this);
+            case IGNITE_UUID:
+                stream.writeIgniteUuid((IgniteUuid)val);
+
+                break;
+
+            case MSG:
+                stream.writeMessage((MessageAdapter)val, this);
+
+                break;
+
+            default:
+                throw new IllegalStateException("Unknown field type: " + type);
+        }
 
         return stream.lastFinished();
     }
 
     /** {@inheritDoc} */
-    @Override public <T> boolean writeObjectArray(String name, T[] arr, MessageFieldType itemType) {
+    @Override public <T> boolean writeArrayField(String name, T[] arr, MessageFieldType itemType) {
         stream.writeObjectArray(arr, itemType, this);
 
         return stream.lastFinished();
     }
 
     /** {@inheritDoc} */
-    @Override public <T> boolean writeCollection(String name, Collection<T> col, MessageFieldType itemType) {
+    @Override public <T> boolean writeCollectionField(String name, Collection<T> col, MessageFieldType itemType) {
         stream.writeCollection(col, itemType, this);
 
         return stream.lastFinished();
     }
 
     /** {@inheritDoc} */
-    @Override public <K, V> boolean writeMap(String name, Map<K, V> map, MessageFieldType keyType,
+    @Override public <K, V> boolean writeMapField(String name, Map<K, V> map, MessageFieldType keyType,
         MessageFieldType valType) {
         stream.writeMap(map, keyType, valType, this);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af8edc04/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointRequest.java
index 9962c1f..ec2e25c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointRequest.java
@@ -88,7 +88,7 @@ public class GridCheckpointRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -96,19 +96,19 @@ public class GridCheckpointRequest extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeString("cpSpi", cpSpi))
+                if (!writer.writeField("cpSpi", cpSpi, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeString("key", key))
+                if (!writer.writeField("key", key, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeIgniteUuid("sesId", sesId))
+                if (!writer.writeField("sesId", sesId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
@@ -124,7 +124,7 @@ public class GridCheckpointRequest extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                cpSpi = reader.readString("cpSpi");
+                cpSpi = reader.readField("cpSpi", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -132,7 +132,7 @@ public class GridCheckpointRequest extends MessageAdapter {
                 readState++;
 
             case 1:
-                key = reader.readString("key");
+                key = reader.readField("key", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -140,7 +140,7 @@ public class GridCheckpointRequest extends MessageAdapter {
                 readState++;
 
             case 2:
-                sesId = reader.readIgniteUuid("sesId");
+                sesId = reader.readField("sesId", 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/managers/communication/GridIoMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
index a74850f..fcbc917 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java
@@ -183,7 +183,7 @@ public class GridIoMessage extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -191,43 +191,43 @@ public class GridIoMessage extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeMessage("msg", msg))
+                if (!writer.writeField("msg", msg, MessageFieldType.MSG))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeBoolean("ordered", ordered))
+                if (!writer.writeField("ordered", ordered, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeByte("plc", plc != null ? (byte)plc.ordinal() : -1))
+                if (!writer.writeField("plc", plc != null ? (byte)plc.ordinal() : -1, MessageFieldType.BYTE))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeBoolean("skipOnTimeout", skipOnTimeout))
+                if (!writer.writeField("skipOnTimeout", skipOnTimeout, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeLong("timeout", timeout))
+                if (!writer.writeField("timeout", timeout, MessageFieldType.LONG))
                     return false;
 
                 writer.incrementState();
 
             case 5:
-                if (!writer.writeByteArray("topicBytes", topicBytes))
+                if (!writer.writeField("topicBytes", topicBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 6:
-                if (!writer.writeInt("topicOrd", topicOrd))
+                if (!writer.writeField("topicOrd", topicOrd, MessageFieldType.INT))
                     return false;
 
                 writer.incrementState();
@@ -243,7 +243,7 @@ public class GridIoMessage extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                msg = reader.readMessage("msg");
+                msg = reader.readField("msg", MessageFieldType.MSG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -251,7 +251,7 @@ public class GridIoMessage extends MessageAdapter {
                 readState++;
 
             case 1:
-                ordered = reader.readBoolean("ordered");
+                ordered = reader.readField("ordered", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -261,7 +261,7 @@ public class GridIoMessage extends MessageAdapter {
             case 2:
                 byte plcOrd;
 
-                plcOrd = reader.readByte("plc");
+                plcOrd = reader.readField("plc", MessageFieldType.BYTE);
 
                 if (!reader.isLastRead())
                     return false;
@@ -271,7 +271,7 @@ public class GridIoMessage extends MessageAdapter {
                 readState++;
 
             case 3:
-                skipOnTimeout = reader.readBoolean("skipOnTimeout");
+                skipOnTimeout = reader.readField("skipOnTimeout", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -279,7 +279,7 @@ public class GridIoMessage extends MessageAdapter {
                 readState++;
 
             case 4:
-                timeout = reader.readLong("timeout");
+                timeout = reader.readField("timeout", MessageFieldType.LONG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -287,7 +287,7 @@ public class GridIoMessage extends MessageAdapter {
                 readState++;
 
             case 5:
-                topicBytes = reader.readByteArray("topicBytes");
+                topicBytes = reader.readField("topicBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -295,7 +295,7 @@ public class GridIoMessage extends MessageAdapter {
                 readState++;
 
             case 6:
-                topicOrd = reader.readInt("topicOrd");
+                topicOrd = reader.readField("topicOrd", 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/managers/communication/GridIoUserMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
index 786f11a..7b3d292 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoUserMessage.java
@@ -207,7 +207,7 @@ public class GridIoUserMessage extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -215,43 +215,43 @@ public class GridIoUserMessage extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeByteArray("bodyBytes", bodyBytes))
+                if (!writer.writeField("bodyBytes", bodyBytes, 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.writeString("depClsName", depClsName))
+                if (!writer.writeField("depClsName", depClsName, MessageFieldType.STRING))
                     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.writeMap("ldrParties", ldrParties, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
+                if (!writer.writeMapField("ldrParties", ldrParties, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 5:
-                if (!writer.writeByteArray("topicBytes", topicBytes))
+                if (!writer.writeField("topicBytes", topicBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 6:
-                if (!writer.writeString("userVer", userVer))
+                if (!writer.writeField("userVer", userVer, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
@@ -267,7 +267,7 @@ public class GridIoUserMessage extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                bodyBytes = reader.readByteArray("bodyBytes");
+                bodyBytes = reader.readField("bodyBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -275,7 +275,7 @@ public class GridIoUserMessage extends MessageAdapter {
                 readState++;
 
             case 1:
-                clsLdrId = reader.readIgniteUuid("clsLdrId");
+                clsLdrId = reader.readField("clsLdrId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -283,7 +283,7 @@ public class GridIoUserMessage extends MessageAdapter {
                 readState++;
 
             case 2:
-                depClsName = reader.readString("depClsName");
+                depClsName = reader.readField("depClsName", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -293,7 +293,7 @@ public class GridIoUserMessage extends MessageAdapter {
             case 3:
                 byte depModeOrd;
 
-                depModeOrd = reader.readByte("depMode");
+                depModeOrd = reader.readField("depMode", MessageFieldType.BYTE);
 
                 if (!reader.isLastRead())
                     return false;
@@ -303,7 +303,7 @@ public class GridIoUserMessage extends MessageAdapter {
                 readState++;
 
             case 4:
-                ldrParties = reader.readMap("ldrParties", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
+                ldrParties = reader.readMapField("ldrParties", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
 
                 if (!reader.isLastRead())
                     return false;
@@ -311,7 +311,7 @@ public class GridIoUserMessage extends MessageAdapter {
                 readState++;
 
             case 5:
-                topicBytes = reader.readByteArray("topicBytes");
+                topicBytes = reader.readField("topicBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -319,7 +319,7 @@ public class GridIoUserMessage 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/managers/deployment/GridDeploymentInfoBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
index 59968a9..98f1347 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
@@ -142,7 +142,7 @@ public class GridDeploymentInfoBean extends MessageAdapter implements GridDeploy
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -150,31 +150,31 @@ public class GridDeploymentInfoBean extends MessageAdapter implements GridDeploy
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("clsLdrId", clsLdrId))
+                if (!writer.writeField("clsLdrId", clsLdrId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                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 2:
-                if (!writer.writeBoolean("locDepOwner", locDepOwner))
+                if (!writer.writeField("locDepOwner", locDepOwner, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeMap("participants", participants, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
+                if (!writer.writeMapField("participants", participants, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeString("userVer", userVer))
+                if (!writer.writeField("userVer", userVer, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
@@ -190,7 +190,7 @@ public class GridDeploymentInfoBean extends MessageAdapter implements GridDeploy
 
         switch (readState) {
             case 0:
-                clsLdrId = reader.readIgniteUuid("clsLdrId");
+                clsLdrId = reader.readField("clsLdrId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -200,7 +200,7 @@ public class GridDeploymentInfoBean extends MessageAdapter implements GridDeploy
             case 1:
                 byte depModeOrd;
 
-                depModeOrd = reader.readByte("depMode");
+                depModeOrd = reader.readField("depMode", MessageFieldType.BYTE);
 
                 if (!reader.isLastRead())
                     return false;
@@ -210,7 +210,7 @@ public class GridDeploymentInfoBean extends MessageAdapter implements GridDeploy
                 readState++;
 
             case 2:
-                locDepOwner = reader.readBoolean("locDepOwner");
+                locDepOwner = reader.readField("locDepOwner", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -218,7 +218,7 @@ public class GridDeploymentInfoBean extends MessageAdapter implements GridDeploy
                 readState++;
 
             case 3:
-                participants = reader.readMap("participants", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
+                participants = reader.readMapField("participants", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
 
                 if (!reader.isLastRead())
                     return false;
@@ -226,7 +226,7 @@ public class GridDeploymentInfoBean extends MessageAdapter implements GridDeploy
                 readState++;
 
             case 4:
-                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/managers/deployment/GridDeploymentRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentRequest.java
index 7f6a7ce..4e720c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentRequest.java
@@ -160,7 +160,7 @@ public class GridDeploymentRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -168,31 +168,31 @@ public class GridDeploymentRequest extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeBoolean("isUndeploy", isUndeploy))
+                if (!writer.writeField("isUndeploy", isUndeploy, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeIgniteUuid("ldrId", ldrId))
+                if (!writer.writeField("ldrId", ldrId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeCollection("nodeIds", nodeIds, MessageFieldType.UUID))
+                if (!writer.writeCollectionField("nodeIds", nodeIds, MessageFieldType.UUID))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeByteArray("resTopicBytes", resTopicBytes))
+                if (!writer.writeField("resTopicBytes", resTopicBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeString("rsrcName", rsrcName))
+                if (!writer.writeField("rsrcName", rsrcName, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
@@ -208,7 +208,7 @@ public class GridDeploymentRequest extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                isUndeploy = reader.readBoolean("isUndeploy");
+                isUndeploy = reader.readField("isUndeploy", MessageFieldType.BOOLEAN);
 
                 if (!reader.isLastRead())
                     return false;
@@ -216,7 +216,7 @@ public class GridDeploymentRequest extends MessageAdapter {
                 readState++;
 
             case 1:
-                ldrId = reader.readIgniteUuid("ldrId");
+                ldrId = reader.readField("ldrId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -224,7 +224,7 @@ public class GridDeploymentRequest extends MessageAdapter {
                 readState++;
 
             case 2:
-                nodeIds = reader.readCollection("nodeIds", MessageFieldType.UUID);
+                nodeIds = reader.readCollectionField("nodeIds", MessageFieldType.UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -232,7 +232,7 @@ public class GridDeploymentRequest extends MessageAdapter {
                 readState++;
 
             case 3:
-                resTopicBytes = reader.readByteArray("resTopicBytes");
+                resTopicBytes = reader.readField("resTopicBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -240,7 +240,7 @@ public class GridDeploymentRequest extends MessageAdapter {
                 readState++;
 
             case 4:
-                rsrcName = reader.readString("rsrcName");
+                rsrcName = reader.readField("rsrcName", 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/managers/deployment/GridDeploymentResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentResponse.java
index 093f7d4..1ac8229 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentResponse.java
@@ -110,7 +110,7 @@ public class GridDeploymentResponse extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -118,19 +118,19 @@ public class GridDeploymentResponse extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeMessage("byteSrc", byteSrc))
+                if (!writer.writeField("byteSrc", byteSrc, MessageFieldType.MSG))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                if (!writer.writeString("errMsg", errMsg))
+                if (!writer.writeField("errMsg", errMsg, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 2:
-                if (!writer.writeBoolean("success", success))
+                if (!writer.writeField("success", success, MessageFieldType.BOOLEAN))
                     return false;
 
                 writer.incrementState();
@@ -146,7 +146,7 @@ public class GridDeploymentResponse extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                byteSrc = reader.readMessage("byteSrc");
+                byteSrc = reader.readField("byteSrc", MessageFieldType.MSG);
 
                 if (!reader.isLastRead())
                     return false;
@@ -154,7 +154,7 @@ public class GridDeploymentResponse extends MessageAdapter {
                 readState++;
 
             case 1:
-                errMsg = reader.readString("errMsg");
+                errMsg = reader.readField("errMsg", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -162,7 +162,7 @@ public class GridDeploymentResponse extends MessageAdapter {
                 readState++;
 
             case 2:
-                success = reader.readBoolean("success");
+                success = reader.readField("success", 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/managers/eventstorage/GridEventStorageMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
index 0762849..522593c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java
@@ -265,7 +265,7 @@ public class GridEventStorageMessage extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isTypeWritten()) {
-            if (!writer.writeByte(null, directType()))
+            if (!writer.writeMessageType(directType()))
                 return false;
 
             writer.onTypeWritten();
@@ -273,55 +273,55 @@ public class GridEventStorageMessage extends MessageAdapter {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeIgniteUuid("clsLdrId", clsLdrId))
+                if (!writer.writeField("clsLdrId", clsLdrId, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 1:
-                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 2:
-                if (!writer.writeByteArray("evtsBytes", evtsBytes))
+                if (!writer.writeField("evtsBytes", evtsBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeByteArray("exBytes", exBytes))
+                if (!writer.writeField("exBytes", exBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 4:
-                if (!writer.writeByteArray("filter", filter))
+                if (!writer.writeField("filter", filter, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 5:
-                if (!writer.writeString("filterClsName", filterClsName))
+                if (!writer.writeField("filterClsName", filterClsName, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
 
             case 6:
-                if (!writer.writeMap("ldrParties", ldrParties, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
+                if (!writer.writeMapField("ldrParties", ldrParties, MessageFieldType.UUID, MessageFieldType.IGNITE_UUID))
                     return false;
 
                 writer.incrementState();
 
             case 7:
-                if (!writer.writeByteArray("resTopicBytes", resTopicBytes))
+                if (!writer.writeField("resTopicBytes", resTopicBytes, MessageFieldType.BYTE_ARR))
                     return false;
 
                 writer.incrementState();
 
             case 8:
-                if (!writer.writeString("userVer", userVer))
+                if (!writer.writeField("userVer", userVer, MessageFieldType.STRING))
                     return false;
 
                 writer.incrementState();
@@ -337,7 +337,7 @@ public class GridEventStorageMessage extends MessageAdapter {
 
         switch (readState) {
             case 0:
-                clsLdrId = reader.readIgniteUuid("clsLdrId");
+                clsLdrId = reader.readField("clsLdrId", MessageFieldType.IGNITE_UUID);
 
                 if (!reader.isLastRead())
                     return false;
@@ -347,7 +347,7 @@ public class GridEventStorageMessage extends MessageAdapter {
             case 1:
                 byte depModeOrd;
 
-                depModeOrd = reader.readByte("depMode");
+                depModeOrd = reader.readField("depMode", MessageFieldType.BYTE);
 
                 if (!reader.isLastRead())
                     return false;
@@ -357,7 +357,7 @@ public class GridEventStorageMessage extends MessageAdapter {
                 readState++;
 
             case 2:
-                evtsBytes = reader.readByteArray("evtsBytes");
+                evtsBytes = reader.readField("evtsBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -365,7 +365,7 @@ public class GridEventStorageMessage extends MessageAdapter {
                 readState++;
 
             case 3:
-                exBytes = reader.readByteArray("exBytes");
+                exBytes = reader.readField("exBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -373,7 +373,7 @@ public class GridEventStorageMessage extends MessageAdapter {
                 readState++;
 
             case 4:
-                filter = reader.readByteArray("filter");
+                filter = reader.readField("filter", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -381,7 +381,7 @@ public class GridEventStorageMessage extends MessageAdapter {
                 readState++;
 
             case 5:
-                filterClsName = reader.readString("filterClsName");
+                filterClsName = reader.readField("filterClsName", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;
@@ -389,7 +389,7 @@ public class GridEventStorageMessage extends MessageAdapter {
                 readState++;
 
             case 6:
-                ldrParties = reader.readMap("ldrParties", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
+                ldrParties = reader.readMapField("ldrParties", MessageFieldType.UUID, MessageFieldType.IGNITE_UUID, false);
 
                 if (!reader.isLastRead())
                     return false;
@@ -397,7 +397,7 @@ public class GridEventStorageMessage extends MessageAdapter {
                 readState++;
 
             case 7:
-                resTopicBytes = reader.readByteArray("resTopicBytes");
+                resTopicBytes = reader.readField("resTopicBytes", MessageFieldType.BYTE_ARR);
 
                 if (!reader.isLastRead())
                     return false;
@@ -405,7 +405,7 @@ public class GridEventStorageMessage extends MessageAdapter {
                 readState++;
 
             case 8:
-                userVer = reader.readString("userVer");
+                userVer = reader.readField("userVer", MessageFieldType.STRING);
 
                 if (!reader.isLastRead())
                     return false;


Mime
View raw message