ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [39/50] [abbrv] ignite git commit: Review (WIP).
Date Wed, 24 Aug 2016 14:05:02 GMT
Review (WIP).


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

Branch: refs/heads/ignite-2649
Commit: 1a3b0ea98b25a868beebddcd9b96584ba640268d
Parents: 6b8231f
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Aug 24 15:35:36 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Aug 24 15:35:36 2016 +0300

----------------------------------------------------------------------
 .../rendezvous/RendezvousAffinityFunction.java  |  2 +-
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  2 +-
 .../internal/GridEventConsumeHandler.java       |  5 +-
 .../internal/GridMessageListenHandler.java      |  4 +-
 .../internal/binary/BinaryEnumObjectImpl.java   |  2 +-
 .../internal/binary/BinaryWriterExImpl.java     |  2 +-
 .../checkpoint/GridCheckpointManager.java       |  4 +-
 .../managers/communication/GridIoManager.java   |  6 +-
 .../deployment/GridDeploymentCommunication.java |  2 +-
 .../eventstorage/GridEventStorageManager.java   |  8 +--
 .../swapspace/GridSwapSpaceManager.java         |  2 +-
 .../processors/affinity/GridAffinityUtils.java  |  2 +-
 .../cache/CacheEntrySerializablePredicate.java  |  2 +-
 .../cache/CacheInvokeDirectResult.java          |  2 +-
 .../processors/cache/GridCacheUtils.java        |  3 +-
 .../GridDistributedLockResponse.java            |  2 +-
 .../GridDistributedTxPrepareRequest.java        |  2 +-
 .../GridDistributedTxPrepareResponse.java       |  2 +-
 .../dht/GridDhtAffinityAssignmentResponse.java  |  2 +-
 .../dht/GridDhtTxFinishResponse.java            |  2 +-
 .../dht/atomic/GridDhtAtomicUpdateResponse.java |  2 +-
 .../atomic/GridNearAtomicUpdateResponse.java    |  2 +-
 .../dht/preloader/GridDhtForceKeysResponse.java |  2 +-
 .../GridDhtPartitionDemandMessage.java          |  2 +-
 .../preloader/GridDhtPartitionsFullMessage.java |  4 +-
 .../GridDhtPartitionsSingleMessage.java         |  4 +-
 .../distributed/near/GridNearGetResponse.java   |  2 +-
 .../near/GridNearSingleGetResponse.java         |  2 +-
 .../near/GridNearTxFinishResponse.java          |  2 +-
 .../cache/query/GridCacheQueryResponse.java     |  2 +-
 .../cache/query/GridCacheSqlQuery.java          |  2 +-
 .../continuous/CacheContinuousQueryHandler.java |  2 +-
 .../jdbc/GridCacheQueryJdbcMetadataTask.java    |  4 +-
 .../query/jdbc/GridCacheQueryJdbcTask.java      |  6 +-
 .../version/GridCacheRawVersionedEntry.java     |  4 +-
 .../closure/GridClosureProcessor.java           |  2 +-
 .../continuous/GridContinuousProcessor.java     |  2 +-
 .../processors/continuous/StartRequestData.java |  2 +-
 .../datastreamer/DataStreamProcessor.java       |  6 +-
 .../datastreamer/DataStreamerImpl.java          |  4 +-
 .../processors/igfs/IgfsAckMessage.java         |  2 +-
 .../processors/igfs/IgfsDeleteMessage.java      |  2 +-
 .../processors/job/GridJobProcessor.java        | 10 +--
 .../internal/processors/job/GridJobWorker.java  |  6 +-
 .../offheap/GridOffHeapProcessor.java           |  2 +-
 .../handlers/task/GridTaskCommandHandler.java   |  4 +-
 .../service/GridServiceProcessor.java           |  4 +-
 .../processors/task/GridTaskProcessor.java      |  4 +-
 .../processors/task/GridTaskWorker.java         |  8 +--
 .../ignite/marshaller/MarshallerUtils.java      | 70 +++++++++++---------
 .../ignite/spi/discovery/tcp/ClientImpl.java    |  6 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 18 ++---
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  2 +-
 .../TcpDiscoveryMulticastIpFinder.java          |  3 +-
 .../spi/swapspace/file/FileSwapSpaceSpi.java    |  2 +-
 .../communication/HadoopMarshallerFilter.java   |  2 +-
 .../processors/query/h2/IgniteH2Indexing.java   |  2 +-
 .../ignite/cache/websession/WebSessionV2.java   |  2 +-
 58 files changed, 133 insertions(+), 132 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
index 2dd646f..6c1fec3 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.java
@@ -338,7 +338,7 @@ public class RendezvousAffinityFunction implements AffinityFunction, Externaliza
                 ByteArrayOutputStream out = new ByteArrayOutputStream();
 
                 byte[] nodeHashBytes = MarshallerUtils.marshal(
-                        ignite.configuration().getMarshaller(), nodeHash, ignite.name());
+                    ignite.name(), ignite.configuration().getMarshaller(), nodeHash);
 
                 out.write(U.intToBytes(part), 0, 4); // Avoid IOException.
                 out.write(nodeHashBytes, 0, nodeHashBytes.length); // Avoid IOException.

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
index e641736..8d5227c 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
@@ -561,7 +561,7 @@ public class CacheJdbcBlobStore<K, V> extends CacheStoreAdapter<K, V> {
      * @throws IgniteCheckedException If failed to convert.
      */
     protected byte[] toBytes(Object obj) throws IgniteCheckedException {
-        return MarshallerUtils.marshal(marsh, obj, ignite.name());
+        return MarshallerUtils.marshal(ignite.name(), marsh, obj);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
index e99c2af..a180965 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
@@ -50,7 +50,6 @@ import org.apache.ignite.internal.util.typedef.T3;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiPredicate;
 import org.apache.ignite.lang.IgnitePredicate;
-import org.apache.ignite.marshaller.Marshaller;
 import org.apache.ignite.marshaller.MarshallerUtils;
 import org.jetbrains.annotations.Nullable;
 
@@ -371,7 +370,7 @@ class GridEventConsumeHandler implements GridContinuousHandler {
 
             depInfo = new GridDeploymentInfoBean(dep);
 
-            filterBytes = MarshallerUtils.marshal(ctx.config().getMarshaller(), filter, ctx.gridName());
+            filterBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), filter);
         }
     }
 
@@ -492,7 +491,7 @@ class GridEventConsumeHandler implements GridContinuousHandler {
         void p2pMarshal(final GridKernalContext ctx) throws IgniteCheckedException {
             assert ctx.config().getMarshaller() != null;
 
-            bytes = MarshallerUtils.marshal(ctx.config().getMarshaller(), evt, ctx.gridName());
+            bytes = MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), evt);
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/GridMessageListenHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridMessageListenHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/GridMessageListenHandler.java
index 8984313..373244f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridMessageListenHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridMessageListenHandler.java
@@ -160,9 +160,9 @@ public class GridMessageListenHandler implements GridContinuousHandler {
         assert ctx.config().isPeerClassLoadingEnabled();
 
         if (topic != null)
-            topicBytes = MarshallerUtils.marshal(ctx.config().getMarshaller(), topic, ctx.gridName());
+            topicBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), topic);
 
-        predBytes = MarshallerUtils.marshal(ctx.config().getMarshaller(), pred, ctx.gridName());
+        predBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), pred);
 
         // Deploy only listener, as it is very likely to be of some user class.
         GridPeerDeployAware pda = U.peerDeployAware(pred);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
index aa415eb..0f9e2e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
@@ -244,7 +244,7 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable, Cac
 
     /** {@inheritDoc} */
     @Override public byte[] valueBytes(CacheObjectContext cacheCtx) throws IgniteCheckedException {
-        return MarshallerUtils.marshal(ctx.marshaller(), this, ctx.configuration().getGridName());
+        return MarshallerUtils.marshal(ctx.configuration().getGridName(), ctx.marshaller(), this);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
index de89f76..675b2d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
@@ -181,7 +181,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
             out.writeByte(GridBinaryMarshaller.OPTM_MARSH);
 
             try {
-                byte[] arr = MarshallerUtils.marshal(ctx.optimizedMarsh(), obj, ctx.configuration().getGridName());
+                byte[] arr = MarshallerUtils.marshal(ctx.configuration().getGridName(), ctx.optimizedMarsh(), obj);
 
                 writeInt(arr.length);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
index a2db860..e14b74a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointManager.java
@@ -174,7 +174,7 @@ public class GridCheckpointManager extends GridManagerAdapter<CheckpointSpi> {
         try {
             switch (scope) {
                 case GLOBAL_SCOPE: {
-                    byte[] data = state == null ? null : MarshallerUtils.marshal(marsh, state, ctx.gridName());
+                    byte[] data = state == null ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, state);
 
                     saved = getSpi(ses.getCheckpointSpi()).saveCheckpoint(key, data, timeout, override);
 
@@ -205,7 +205,7 @@ public class GridCheckpointManager extends GridManagerAdapter<CheckpointSpi> {
                         timeout = ses.getEndTime() - now;
 
                     // Save it first to avoid getting null value on another node.
-                    byte[] data = state == null ? null : MarshallerUtils.marshal(marsh, state, ctx.gridName());
+                    byte[] data = state == null ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, state);
 
                     Set<String> keys = keyMap.get(ses.getId());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index ff5b780..3c33ee0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -1118,7 +1118,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         }
         else {
             if (topicOrd < 0)
-                ioMsg.topicBytes(MarshallerUtils.marshal(marsh, topic, ctx.gridName()));
+                ioMsg.topicBytes(MarshallerUtils.marshal(ctx.gridName(), marsh, topic));
 
             try {
                 if ((CommunicationSpi)getSpi() instanceof TcpCommunicationSpi)
@@ -1378,10 +1378,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
         byte[] serTopic = null;
 
         if (!loc) {
-            serMsg = MarshallerUtils.marshal(marsh, msg, ctx.gridName());
+            serMsg = MarshallerUtils.marshal(ctx.gridName(), marsh, msg);
 
             if (topic != null)
-                serTopic = MarshallerUtils.marshal(marsh, topic, ctx.gridName());
+                serTopic = MarshallerUtils.marshal(ctx.gridName(), marsh, topic);
         }
 
         GridDeployment dep = null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java
index ba3b829..78c1c3e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java
@@ -446,7 +446,7 @@ class GridDeploymentCommunication {
             long start = U.currentTimeMillis();
 
             if (req.responseTopic() != null && !ctx.localNodeId().equals(dstNode.id()))
-                req.responseTopicBytes(MarshallerUtils.marshal(marsh, req.responseTopic(), ctx.gridName()));
+                req.responseTopicBytes(MarshallerUtils.marshal(ctx.gridName(), marsh, req.responseTopic()));
 
             ctx.io().send(dstNode, TOPIC_CLASSLOAD, req, GridIoPolicy.P2P_POOL);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
index 233110b..6ec5d3c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
@@ -933,7 +933,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
 
             ioMgr.addMessageListener(resTopic, resLsnr);
 
-            byte[] serFilter = MarshallerUtils.marshal(marsh, p, ctx.gridName());
+            byte[] serFilter = MarshallerUtils.marshal(ctx.gridName(), marsh, p);
 
             GridDeployment dep = ctx.deploy().deploy(p.getClass(), U.detectClassLoader(p.getClass()));
 
@@ -1024,7 +1024,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
             ctx.io().send(locNode, topic, msg, plc);
 
         if (!rmtNodes.isEmpty()) {
-            msg.responseTopicBytes(MarshallerUtils.marshal(marsh, msg.responseTopic(), ctx.gridName()));
+            msg.responseTopicBytes(MarshallerUtils.marshal(ctx.gridName(), marsh, msg.responseTopic()));
 
             ctx.io().send(rmtNodes, topic, msg, plc);
         }
@@ -1144,8 +1144,8 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
                         log.debug("Sending event query response to node [nodeId=" + nodeId + "res=" + res + ']');
 
                     if (!ctx.localNodeId().equals(nodeId)) {
-                        res.eventsBytes(MarshallerUtils.marshal(marsh, res.events(), ctx.gridName()));
-                        res.exceptionBytes(MarshallerUtils.marshal(marsh, res.exception(), ctx.gridName()));
+                        res.eventsBytes(MarshallerUtils.marshal(ctx.gridName(), marsh, res.events()));
+                        res.exceptionBytes(MarshallerUtils.marshal(ctx.gridName(), marsh, res.exception()));
                     }
 
                     ctx.io().send(node, req.responseTopic(), res, PUBLIC_POOL);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java
index b5e18d1..972fe80 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/swapspace/GridSwapSpaceManager.java
@@ -412,7 +412,7 @@ public class GridSwapSpaceManager extends GridManagerAdapter<SwapSpaceSpi> {
      * @throws IgniteCheckedException If failed.
      */
     private byte[] marshal(Object obj) throws IgniteCheckedException {
-        return MarshallerUtils.marshal(marsh, obj, ctx.gridName());
+        return MarshallerUtils.marshal(ctx.gridName(), marsh, obj);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityUtils.java
index e5d2085..939c14f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityUtils.java
@@ -78,7 +78,7 @@ class GridAffinityUtils {
             throw new IgniteDeploymentCheckedException("Failed to deploy affinity object with class: " + cls.getName());
 
         return new GridAffinityMessage(
-            MarshallerUtils.marshal(ctx.config().getMarshaller(), o, ctx.gridName()),
+            MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), o),
             cls.getName(),
             dep.classLoaderId(),
             dep.deployMode(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntrySerializablePredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntrySerializablePredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntrySerializablePredicate.java
index d0837bd..c59d9a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntrySerializablePredicate.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntrySerializablePredicate.java
@@ -94,7 +94,7 @@ public class CacheEntrySerializablePredicate implements CacheEntryPredicate {
 
         p.prepareMarshal(ctx);
 
-        bytes = MarshallerUtils.marshal(ctx.marshaller(), p, ctx.gridName());
+        bytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), p);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
index a8d9caa..e8c4ebc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java
@@ -107,7 +107,7 @@ public class CacheInvokeDirectResult implements Message {
         key.prepareMarshal(ctx.cacheObjectContext());
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+            errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
 
         if (res != null)
             res.prepareMarshal(ctx.cacheObjectContext());

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index fc51e84..a0913ea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -55,7 +55,6 @@ import org.apache.ignite.cache.affinity.Affinity;
 import org.apache.ignite.cache.store.CacheStoreSessionListener;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.TransactionConfiguration;
 import org.apache.ignite.internal.GridKernalContext;
@@ -992,7 +991,7 @@ public class GridCacheUtils {
             }
         }
 
-        return MarshallerUtils.marshal(ctx.marshaller(), obj, ctx.gridName());
+        return MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), obj);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
index 31cc588..d805660 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
@@ -203,7 +203,7 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage {
         prepareMarshalCacheObjects(vals, ctx.cacheContext(cacheId));
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+            errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
index ae394d7..f208658 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java
@@ -333,7 +333,7 @@ public class GridDistributedTxPrepareRequest extends GridDistributedBaseMessage
         // Marshal txNodes only if there is a node in topology with an older version.
         if (ctx.exchange().minimumNodeVersion(topologyVersion()).compareTo(TX_NODES_DIRECT_MARSHALLABLE_SINCE) < 0) {
             if (txNodes != null && txNodesBytes == null)
-                txNodesBytes = MarshallerUtils.marshal(ctx.marshaller(), txNodes, ctx.gridName());
+                txNodesBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), txNodes);
         }
         else {
             if (txNodesMsg == null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
index 7c47b2b..180e446 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareResponse.java
@@ -101,7 +101,7 @@ public class GridDistributedTxPrepareResponse extends GridDistributedBaseMessage
         super.prepareMarshal(ctx);
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+            errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
index f3ac402..1952730 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtAffinityAssignmentResponse.java
@@ -107,7 +107,7 @@ public class GridDhtAffinityAssignmentResponse extends GridCacheMessage {
         super.prepareMarshal(ctx);
 
         if (affAssignment != null)
-            affAssignmentBytes = MarshallerUtils.marshal(ctx.marshaller(), affAssignment, ctx.gridName());
+            affAssignmentBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), affAssignment);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
index 7beb1d3..d60bb51 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
@@ -112,7 +112,7 @@ public class GridDhtTxFinishResponse extends GridDistributedTxFinishResponse {
         super.prepareMarshal(ctx);
 
         if (checkCommittedErr != null)
-            checkCommittedErrBytes = MarshallerUtils.marshal(ctx.marshaller(), checkCommittedErr, ctx.gridName());
+            checkCommittedErrBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), checkCommittedErr);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
index 688c439..159deee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java
@@ -168,7 +168,7 @@ public class GridDhtAtomicUpdateResponse extends GridCacheMessage implements Gri
 
         prepareMarshalCacheObjects(nearEvicted, cctx);
 
-        errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+        errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
index ed923b8..e1d0b84 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateResponse.java
@@ -398,7 +398,7 @@ public class GridNearAtomicUpdateResponse extends GridCacheMessage implements Gr
         super.prepareMarshal(ctx);
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+            errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
 
         GridCacheContext cctx = ctx.cacheContext(cacheId);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
index 4b49730..723c41a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java
@@ -172,7 +172,7 @@ public class GridDhtForceKeysResponse extends GridCacheMessage implements GridCa
                 info.marshal(cctx);
         }
 
-        errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+        errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
index cbc01be..9c12962 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemandMessage.java
@@ -184,7 +184,7 @@ public class GridDhtPartitionDemandMessage extends GridCacheMessage {
         super.prepareMarshal(ctx);
 
         if (topic != null)
-            topicBytes = MarshallerUtils.marshal(ctx.marshaller(), topic, ctx.gridName());
+            topicBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), topic);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
index a1f6700..c455ca4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsFullMessage.java
@@ -134,10 +134,10 @@ public class GridDhtPartitionsFullMessage extends GridDhtPartitionsAbstractMessa
         super.prepareMarshal(ctx);
 
         if (parts != null && partsBytes == null)
-            partsBytes = MarshallerUtils.marshal(ctx.marshaller(), parts, ctx.gridName());
+            partsBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), parts);
 
         if (partCntrs != null)
-            partCntrsBytes = MarshallerUtils.marshal(ctx.marshaller(), partCntrs, ctx.gridName());
+            partCntrsBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), partCntrs);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
index 3be312b..b3ee57b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsSingleMessage.java
@@ -138,10 +138,10 @@ public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMes
         super.prepareMarshal(ctx);
 
         if (partsBytes == null && parts != null)
-            partsBytes = MarshallerUtils.marshal(ctx.marshaller(), parts, ctx.gridName());
+            partsBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), parts);
 
         if (partCntrs != null)
-            partCntrsBytes = MarshallerUtils.marshal(ctx.marshaller(), partCntrs, ctx.gridName());
+            partCntrsBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), partCntrs);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java
index ff1a373..d530d06 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetResponse.java
@@ -191,7 +191,7 @@ public class GridNearGetResponse extends GridCacheMessage implements GridCacheDe
         }
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+            errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetResponse.java
index e290310..37af50a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearSingleGetResponse.java
@@ -170,7 +170,7 @@ public class GridNearSingleGetResponse extends GridCacheMessage implements GridC
         }
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+            errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java
index 809e11c..753f5e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishResponse.java
@@ -102,7 +102,7 @@ public class GridNearTxFinishResponse extends GridDistributedTxFinishResponse {
         super.prepareMarshal(ctx);
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+            errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/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 28ae466..b1615f1 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
@@ -125,7 +125,7 @@ public class GridCacheQueryResponse extends GridCacheMessage implements GridCach
         GridCacheContext cctx = ctx.cacheContext(cacheId);
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(ctx.marshaller(), err, ctx.gridName());
+            errBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.marshaller(), err);
 
         metaDataBytes = marshalCollection(metadata, cctx);
         dataBytes = marshalCollection(data, cctx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java
index df6621f..aae96a5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheSqlQuery.java
@@ -142,7 +142,7 @@ public class GridCacheSqlQuery implements Message {
 
         assert params != null;
 
-        paramsBytes = MarshallerUtils.marshal(m, params, kernalCtx.gridName());
+        paramsBytes = MarshallerUtils.marshal(kernalCtx.gridName(), m, params);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index a9cf668..8ad4249 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
@@ -1542,7 +1542,7 @@ public class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler
 
             depInfo = new GridDeploymentInfoBean(dep);
 
-            bytes = MarshallerUtils.marshal(ctx.config().getMarshaller(), obj, ctx.gridName());
+            bytes = MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), obj);
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
index 9d4fb7d..d659f10 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
@@ -154,7 +154,7 @@ public class GridCacheQueryJdbcMetadataTask extends ComputeTaskAdapter<String, b
 
                 status = 0;
 
-                data = MarshallerUtils.marshal(MARSHALLER, F.asList(schemasMap, indexesInfo), ignite.name());
+                data = MarshallerUtils.marshal(ignite.name(), MARSHALLER, F.asList(schemasMap, indexesInfo));
             }
             catch (Throwable t) {
                 U.error(log, "Failed to get metadata for JDBC.", t);
@@ -164,7 +164,7 @@ public class GridCacheQueryJdbcMetadataTask extends ComputeTaskAdapter<String, b
                 status = 1;
 
                 try {
-                    data = MarshallerUtils.marshal(MARSHALLER, err, ignite.name());
+                    data = MarshallerUtils.marshal(ignite.name(), MARSHALLER, err);
                 }
                 catch (IgniteCheckedException e) {
                     throw new IgniteException(e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java
index d078f38..b98dcbd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java
@@ -131,13 +131,13 @@ public class GridCacheQueryJdbcTask extends ComputeTaskAdapter<byte[], byte[]> {
             if (res.getException() == null) {
                 status = 0;
 
-                bytes = MarshallerUtils.marshal(MARSHALLER, res.getData(), ignite.name());
+                bytes = MarshallerUtils.marshal(ignite.name(), MARSHALLER, res.getData());
             }
             else {
                 status = 1;
 
-                bytes = MarshallerUtils.marshal(MARSHALLER, new SQLException(res.getException().getMessage()),
-                        ignite.name());
+                bytes = MarshallerUtils.marshal(ignite.name(), MARSHALLER, new SQLException(res.getException().getMessage())
+                );
             }
 
             byte[] packet = new byte[bytes.length + 1];

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
index 2c64209..0b87652 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
@@ -242,13 +242,13 @@ public class GridCacheRawVersionedEntry<K, V> extends DataStreamerEntry implemen
         if (keyBytes == null) {
             key.prepareMarshal(ctx);
 
-            keyBytes = MarshallerUtils.marshal(marsh, key, ctx.kernalContext().gridName());
+            keyBytes = MarshallerUtils.marshal(ctx.kernalContext().gridName(), marsh, key);
         }
 
         if (valBytes == null && val != null) {
             val.prepareMarshal(ctx);
 
-            valBytes = MarshallerUtils.marshal(marsh, val, ctx.kernalContext().gridName());
+            valBytes = MarshallerUtils.marshal(ctx.kernalContext().gridName(), marsh, val);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
index e17c3fe..8c756c1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
@@ -1145,7 +1145,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                         if (closureBytes == null) {
                             closure = c.job;
 
-                            closureBytes = MarshallerUtils.marshal(marsh, c.job, ctx.gridName());
+                            closureBytes = MarshallerUtils.marshal(ctx.gridName(), marsh, c.job);
                         }
 
                         if (c.job == closure)

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index 388487f..ef4e729 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -1324,7 +1324,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
         if (!msg.messages() &&
             msg.data() != null &&
             (nodes.size() > 1 || !ctx.localNodeId().equals(F.first(nodes).id())))
-            msg.dataBytes(MarshallerUtils.marshal(marsh, msg.data(), ctx.gridName()));
+            msg.dataBytes(MarshallerUtils.marshal(ctx.gridName(), marsh, msg.data()));
 
         for (ClusterNode node : nodes) {
             int cnt = 0;

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/StartRequestData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/StartRequestData.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/StartRequestData.java
index be4562a..4167c62 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/StartRequestData.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/StartRequestData.java
@@ -98,7 +98,7 @@ class StartRequestData implements Externalizable {
     void p2pMarshal(Marshaller marsh, final GridKernalContext kernalCtx) throws IgniteCheckedException {
         assert marsh != null;
 
-        prjPredBytes = MarshallerUtils.marshal(marsh, prjPred, kernalCtx.gridName());
+        prjPredBytes = MarshallerUtils.marshal(kernalCtx.gridName(), marsh, prjPred);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
index 146a864..e1f8d6b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
@@ -91,8 +91,8 @@ public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
         if (ctx.config().isDaemon())
             return;
 
-        marshErrBytes = MarshallerUtils.marshal(marsh, new IgniteCheckedException("Failed to marshal response error, " +
-            "see node log for details."), ctx.gridName());
+        marshErrBytes = MarshallerUtils.marshal(ctx.gridName(), marsh, new IgniteCheckedException("Failed to marshal response error, " +
+            "see node log for details."));
 
         flusher = new IgniteThread(new GridWorker(ctx.gridName(), "grid-data-loader-flusher", log) {
             @Override protected void body() throws InterruptedException {
@@ -332,7 +332,7 @@ public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
         byte[] errBytes;
 
         try {
-            errBytes = err != null ? MarshallerUtils.marshal(marsh, err, ctx.gridName()) : null;
+            errBytes = err != null ? MarshallerUtils.marshal(ctx.gridName(), marsh, err) : null;
         }
         catch (Exception e) {
             U.error(log, "Failed to marshal error [err=" + err + ", marshErr=" + e + ']', e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
index 066c789..10f266e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
@@ -1360,11 +1360,11 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
                     if (updaterBytes == null) {
                         assert rcvr != null;
 
-                        updaterBytes = MarshallerUtils.marshal(ctx.config().getMarshaller(), rcvr, ctx.gridName());
+                        updaterBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), rcvr);
                     }
 
                     if (topicBytes == null)
-                        topicBytes = MarshallerUtils.marshal(ctx.config().getMarshaller(), topic, ctx.gridName());
+                        topicBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), topic);
                 }
                 catch (IgniteCheckedException e) {
                     U.error(log, "Failed to marshal (request will not be sent).", e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/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 646d492..c123201 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
@@ -98,7 +98,7 @@ public class IgfsAckMessage extends IgfsCommunicationMessage {
         super.prepareMarshal(marsh, kernalCtx);
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(marsh, err, kernalCtx.gridName());
+            errBytes = MarshallerUtils.marshal(kernalCtx.gridName(), marsh, err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/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 7e206e3..c971dc6 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
@@ -98,7 +98,7 @@ public class IgfsDeleteMessage extends IgfsCommunicationMessage {
         super.prepareMarshal(marsh, kernalCtx);
 
         if (err != null)
-            errBytes = MarshallerUtils.marshal(marsh, err, kernalCtx.gridName());
+            errBytes = MarshallerUtils.marshal(kernalCtx.gridName(), marsh, err);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
index baf80e8..92bef35 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
@@ -404,7 +404,7 @@ public class GridJobProcessor extends GridProcessorAdapter {
         boolean loc = ctx.localNodeId().equals(taskNode.id()) && !ctx.config().isMarshalLocalJobs();
 
         GridTaskSessionRequest req = new GridTaskSessionRequest(ses.getId(), ses.getJobId(),
-            loc ? null : MarshallerUtils.marshal(marsh, attrs, ctx.gridName()), attrs);
+            loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, attrs), attrs);
 
         Object topic = TOPIC_TASK.topic(ses.getJobId(), ctx.discovery().localNode().id());
 
@@ -517,7 +517,7 @@ public class GridJobProcessor extends GridProcessorAdapter {
             ctx.io().send(taskNode, TOPIC_JOB_SIBLINGS,
                 new GridJobSiblingsRequest(ses.getId(),
                     loc ? topic : null,
-                    loc ? null : MarshallerUtils.marshal(marsh, topic, ctx.gridName())),
+                    loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, topic)),
                 SYSTEM_POOL);
 
             // 4. Listen to discovery events.
@@ -1334,11 +1334,11 @@ public class GridJobProcessor extends GridProcessorAdapter {
                 locNodeId,
                 req.getSessionId(),
                 req.getJobId(),
-                loc ? null : MarshallerUtils.marshal(marsh, ex, ctx.gridName()),
+                loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, ex),
                 ex,
-                loc ? null : MarshallerUtils.marshal(marsh, null, ctx.gridName()),
+                loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, null),
                 null,
-                loc ? null : MarshallerUtils.marshal(marsh, null, ctx.gridName()),
+                loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, null),
                 null,
                 false);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
index 3d17c62..d9e256c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
@@ -746,11 +746,11 @@ public class GridJobWorker extends GridWorker implements GridTimeoutObject {
                                 ctx.localNodeId(),
                                 ses.getId(),
                                 ses.getJobId(),
-                                loc ? null : MarshallerUtils.marshal(marsh, ex, ctx.gridName()),
+                                loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, ex),
                                 loc ? ex : null,
-                                loc ? null: MarshallerUtils.marshal(marsh, res, ctx.gridName()),
+                                loc ? null: MarshallerUtils.marshal(ctx.gridName(), marsh, res),
                                 loc ? res : null,
-                                loc ? null : MarshallerUtils.marshal(marsh, attrs, ctx.gridName()),
+                                loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, attrs),
                                 loc ? attrs : null,
                                 isCancelled());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
index 8d4e75e..bbcfbe5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/offheap/GridOffHeapProcessor.java
@@ -109,7 +109,7 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
     private byte[] keyBytes(KeyCacheObject key, @Nullable byte[] keyBytes) throws IgniteCheckedException {
         assert key != null;
 
-        return keyBytes != null ? keyBytes : MarshallerUtils.marshal(marsh, key, ctx.gridName());
+        return keyBytes != null ? keyBytes : MarshallerUtils.marshal(ctx.gridName(), marsh, key);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskCommandHandler.java
index b6adfca..484dca0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskCommandHandler.java
@@ -136,7 +136,7 @@ public class GridTaskCommandHandler extends GridRestCommandHandlerAdapter {
                             res.error(err.getMessage());
                         else {
                             res.result(desc.result());
-                            res.resultBytes(MarshallerUtils.marshal(ctx.config().getMarshaller(), desc.result(), ctx.gridName()));
+                            res.resultBytes(MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), desc.result()));
                         }
                     }
                     else
@@ -495,7 +495,7 @@ public class GridTaskCommandHandler extends GridRestCommandHandlerAdapter {
 
             // 2. Send message.
             try {
-                byte[] topicBytes = MarshallerUtils.marshal(ctx.config().getMarshaller(), topic, ctx.gridName());
+                byte[] topicBytes = MarshallerUtils.marshal(ctx.gridName(), ctx.config().getMarshaller(), topic);
 
                 ctx.io().send(taskNode, TOPIC_REST, new GridTaskResultRequest(taskId, topic, topicBytes), SYSTEM_POOL);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index c17c9fc..c90350f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -453,7 +453,7 @@ public class GridServiceProcessor extends GridProcessorAdapter {
             LazyServiceConfiguration cfg0;
 
             try {
-                byte[] srvcBytes = MarshallerUtils.marshal(marsh, cfg.getService(), ctx.gridName());
+                byte[] srvcBytes = MarshallerUtils.marshal(ctx.gridName(), marsh, cfg.getService());
 
                 cfg0 = new LazyServiceConfiguration(cfg, srvcBytes);
             }
@@ -1134,7 +1134,7 @@ public class GridServiceProcessor extends GridProcessorAdapter {
             Service svc = cfg.getService();
 
             try {
-                byte[] bytes = MarshallerUtils.marshal(m, svc, ctx.gridName());
+                byte[] bytes = MarshallerUtils.marshal(ctx.gridName(), m, svc);
 
                 Service cp = MarshallerUtils.unmarshal(m, bytes, U.resolveClassLoader(svc.getClass().getClassLoader(),
                     ctx.config()), ctx.gridName());

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
index b8ab83c..57b915f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
@@ -914,7 +914,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
                     GridTaskSessionRequest req = new GridTaskSessionRequest(
                         ses.getId(),
                         null,
-                        loc ? null : MarshallerUtils.marshal(marsh, attrs, ctx.gridName()),
+                        loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, attrs),
                         attrs);
 
                     // Make sure to go through IO manager always, since order
@@ -1315,7 +1315,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
                     ctx.io().send(nodeId, topic,
                         new GridJobSiblingsResponse(
                             loc ? siblings : null,
-                            loc ? null : MarshallerUtils.marshal(marsh, siblings, ctx.gridName())),
+                            loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, siblings)),
                         SYSTEM_POOL);
                 }
                 catch (IgniteCheckedException e) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
index fd0881d..a4656f4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
@@ -1254,16 +1254,16 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
                         ses.getTaskName(),
                         ses.getUserVersion(),
                         ses.getTaskClassName(),
-                        loc ? null : MarshallerUtils.marshal(marsh, res.getJob(), ctx.gridName()),
+                        loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, res.getJob()),
                         loc ? res.getJob() : null,
                         ses.getStartTime(),
                         timeout,
                         ses.getTopology(),
-                        loc ? null : MarshallerUtils.marshal(marsh, ses.getJobSiblings(), ctx.gridName()),
+                        loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, ses.getJobSiblings()),
                         loc ? ses.getJobSiblings() : null,
-                        loc ? null : MarshallerUtils.marshal(marsh, sesAttrs, ctx.gridName()),
+                        loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, sesAttrs),
                         loc ? sesAttrs : null,
-                        loc ? null : MarshallerUtils.marshal(marsh, jobAttrs, ctx.gridName()),
+                        loc ? null : MarshallerUtils.marshal(ctx.gridName(), marsh, jobAttrs),
                         loc ? jobAttrs : null,
                         ses.getCheckpointSpi(),
                         dep.classLoaderId(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java
index 94ca30b..2f8eb08 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java
@@ -29,27 +29,33 @@ import java.io.OutputStream;
 import java.nio.ByteBuffer;
 
 /**
- * Util class that sets and discards thread local
- * ignite grid name in {@link IgnitionEx} class.
+ * Utility marshaller methods.
  */
 public final class MarshallerUtils {
     /**
+     * Marshal object. Used when grid name is not available, f.e. in tests.
      *
+     * @param marsh Marshaller.
+     * @param obj Object to marshal.
+     * @return Result.
+     * @throws IgniteCheckedException If failed.
      */
-    private MarshallerUtils() {
+    public static byte[] marshal(final Marshaller marsh, final @Nullable Object obj) throws IgniteCheckedException {
+        // This method used to keep marshaller usages in one place.
+        return marsh.marshal(obj);
     }
 
     /**
-     * Marshal object to stream and set grid name thread local.
+     * Marshal object setting provided node name.
      *
-     * @param marshaller Marshaller.
+     * @param gridName Node name.
+     * @param marsh Marshaller.
      * @param obj Object to marshal.
-     * @param out Output stream.
-     * @param gridName Grid name.
-     * @throws IgniteCheckedException If fail.
+     * @return Result.
+     * @throws IgniteCheckedException If failed.
      */
-    public static void marshal(final Marshaller marshaller, final @Nullable Object obj,
-        final OutputStream out, final String gridName) throws IgniteCheckedException {
+    public static byte[] marshal(final String gridName, final Marshaller marsh, @Nullable Object obj)
+        throws IgniteCheckedException {
         final LocalGridName gridNameTl = gridName();
 
         final String gridNameStr = gridNameTl.getGridName();
@@ -58,23 +64,29 @@ public final class MarshallerUtils {
         try {
             gridNameTl.setGridName(true, gridName);
 
-            marshaller.marshal(obj, out);
-        } finally {
+            return marsh.marshal(obj);
+        }
+        finally {
             gridNameTl.setGridName(init, gridNameStr);
         }
     }
 
+
+
+
+
+
     /**
-     * Marshal object and set grid name thread local.
+     * Marshal object to stream and set grid name thread local.
      *
      * @param marshaller Marshaller.
      * @param obj Object to marshal.
+     * @param out Output stream.
      * @param gridName Grid name.
-     * @return Binary data.
      * @throws IgniteCheckedException If fail.
      */
-    public static byte[] marshal(final Marshaller marshaller, @Nullable Object obj,
-        final String gridName) throws IgniteCheckedException {
+    public static void marshal(final Marshaller marshaller, final @Nullable Object obj,
+        final OutputStream out, final String gridName) throws IgniteCheckedException {
         final LocalGridName gridNameTl = gridName();
 
         final String gridNameStr = gridNameTl.getGridName();
@@ -83,28 +95,13 @@ public final class MarshallerUtils {
         try {
             gridNameTl.setGridName(true, gridName);
 
-            return marshaller.marshal(obj);
-        }
-        finally {
+            marshaller.marshal(obj, out);
+        } finally {
             gridNameTl.setGridName(init, gridNameStr);
         }
     }
 
     /**
-     * Marshal object.
-     * <p>Use only when grid name is not available, f.e. in tests.</p>
-     *
-     * @param marshaller Marshaller.
-     * @param obj Object to marshal.
-     * @return Binary data.
-     * @throws IgniteCheckedException If fail.
-     */
-    public static byte[] marshal(final Marshaller marshaller, final @Nullable Object obj) throws IgniteCheckedException {
-        // This method used to keep marshaller usages in one place.
-        return marshaller.marshal(obj);
-    }
-
-    /**
      * Unmarshal object from stream and set grid name thread local.
      *
      * @param marshaller Marshaller.
@@ -260,4 +257,11 @@ public final class MarshallerUtils {
     private static LocalGridName gridName() {
         return IgnitionEx.gridNameThreadLocal();
     }
+
+    /**
+     * Private constructor.
+     */
+    private MarshallerUtils() {
+        // No-op.
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 0a0b42d..b53a81e 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -431,7 +431,7 @@ class ClientImpl extends TcpDiscoveryImpl {
 
         try {
             sockWriter.sendMessage(new TcpDiscoveryCustomEventMessage(getLocalNodeId(), evt,
-                MarshallerUtils.marshal(spi.marsh, evt, spi.ignite().name())));
+                MarshallerUtils.marshal(spi.ignite().name(), spi.marsh, evt)));
         }
         catch (IgniteCheckedException e) {
             throw new IgniteSpiException("Failed to marshal custom event: " + evt, e);
@@ -685,8 +685,8 @@ class ClientImpl extends TcpDiscoveryImpl {
             Map<String, Object> attrs = new HashMap<>(node.getAttributes());
 
             attrs.put(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS,
-                    MarshallerUtils.marshal(spi.marsh, attrs.get(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS),
-                        spi.ignite().name()));
+                    MarshallerUtils.marshal(spi.ignite().name(), spi.marsh, attrs.get(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS)
+                    ));
 
             node.setAttributes(attrs);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index d8dcca4..be108f8 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -743,7 +743,7 @@ class ServerImpl extends TcpDiscoveryImpl {
     @Override public void sendCustomEvent(DiscoverySpiCustomMessage evt) {
         try {
             msgWorker.addMessage(new TcpDiscoveryCustomEventMessage(getLocalNodeId(), evt,
-                    MarshallerUtils.marshal(spi.marsh, evt, spi.ignite().name())));
+                    MarshallerUtils.marshal(spi.ignite().name(), spi.marsh, evt)));
         }
         catch (IgniteCheckedException e) {
             throw new IgniteSpiException("Failed to marshal custom event: " + evt, e);
@@ -827,7 +827,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                         Map<String, Object> attrs = new HashMap<>(locNode.attributes());
 
                         attrs.put(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT,
-                            MarshallerUtils.marshal(spi.marsh, subj, spi.ignite().name()));
+                            MarshallerUtils.marshal(spi.ignite().name(), spi.marsh, subj));
                         attrs.remove(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS);
 
                         locNode.setAttributes(attrs);
@@ -1243,8 +1243,8 @@ class ServerImpl extends TcpDiscoveryImpl {
             Map<String, Object> attrs = new HashMap<>(node.getAttributes());
 
             attrs.put(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS,
-                MarshallerUtils.marshal(spi.marsh,
-                        attrs.get(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS), spi.ignite().name()));
+                MarshallerUtils.marshal(spi.ignite().name(), spi.marsh,
+                        attrs.get(IgniteNodeAttributes.ATTR_SECURITY_CREDENTIALS)));
 
             node.setAttributes(attrs);
         }
@@ -2361,7 +2361,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                 for (ClientMessageWorker clientMsgWorker : clientMsgWorkers.values()) {
                     if (msgBytes == null) {
                         try {
-                            msgBytes = MarshallerUtils.marshal(spi.marsh, msg, spi.ignite().name());
+                            msgBytes = MarshallerUtils.marshal(spi.ignite().name(), spi.marsh, msg);
                         }
                         catch (IgniteCheckedException e) {
                             U.error(log, "Failed to marshal message: " + msg, e);
@@ -3140,7 +3140,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                             Map<String, Object> attrs = new HashMap<>(node.getAttributes());
 
                             attrs.put(IgniteNodeAttributes.ATTR_SECURITY_SUBJECT,
-                                    MarshallerUtils.marshal(spi.marsh, subj, spi.ignite().name()));
+                                    MarshallerUtils.marshal(spi.ignite().name(), spi.marsh, subj));
 
                             node.setAttributes(attrs);
                         }
@@ -4860,7 +4860,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                             try {
                                 TcpDiscoveryCustomEventMessage ackMsg = new TcpDiscoveryCustomEventMessage(
                                     getLocalNodeId(), nextMsg,
-                                        MarshallerUtils.marshal(spi.marsh, nextMsg, spi.ignite().name()));
+                                        MarshallerUtils.marshal(spi.ignite().name(), spi.marsh, nextMsg));
 
                                 ackMsg.topologyVersion(msg.topologyVersion());
 
@@ -5005,7 +5005,7 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                         if (msgObj.isMutable())
                             msg.message(msgObj,
-                                    MarshallerUtils.marshal(spi.marsh, msgObj, spi.ignite().name()));
+                                    MarshallerUtils.marshal(spi.ignite().name(), spi.marsh, msgObj));
                     }
                     catch (Throwable e) {
                         U.error(log, "Failed to unmarshal discovery custom message.", e);
@@ -5932,7 +5932,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                 byte[] msgBytes = msgT.get2();
 
                 if (msgBytes == null)
-                    msgBytes = MarshallerUtils.marshal(spi.marsh, msg, spi.ignite().name());
+                    msgBytes = MarshallerUtils.marshal(spi.ignite().name(), spi.marsh, msg);
 
                 if (msg instanceof TcpDiscoveryClientAckResponse) {
                     if (clientVer == null) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 61186d7..de9877c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -1678,7 +1678,7 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
 
         for (Map.Entry<Integer, Serializable> entry : data.entrySet()) {
             try {
-                byte[] bytes = MarshallerUtils.marshal(marsh, entry.getValue(), ignite.name());
+                byte[] bytes = MarshallerUtils.marshal(ignite.name(), marsh, entry.getValue());
 
                 data0.put(entry.getKey(), bytes);
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
index 24f4803..3c9c20f 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
@@ -32,7 +32,6 @@ import java.util.HashSet;
 import java.util.Set;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
-import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.F;
@@ -702,7 +701,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
         private AddressResponse(Collection<InetSocketAddress> addrs, final String gridName) throws IgniteCheckedException {
             this.addrs = addrs;
 
-            byte[] addrsData = MarshallerUtils.marshal(marsh, addrs, gridName);
+            byte[] addrsData = MarshallerUtils.marshal(gridName, marsh, addrs);
             data = new byte[U.IGNITE_HEADER.length + addrsData.length];
 
             if (data.length > MAX_DATA_LENGTH)

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
index b8365c5..052a422 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
@@ -595,7 +595,7 @@ public class FileSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi,
 
         if (keyBytes == null) {
             try {
-                keyBytes = MarshallerUtils.marshal(ignite.configuration().getMarshaller(), key.key(), ignite.name());
+                keyBytes = MarshallerUtils.marshal(ignite.name(), ignite.configuration().getMarshaller(), key.key());
             }
             catch (IgniteCheckedException e) {
                 throw new IgniteSpiException("Failed to marshal key: " + key.key(), e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopMarshallerFilter.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopMarshallerFilter.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopMarshallerFilter.java
index a2e3902..35120cb 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopMarshallerFilter.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/communication/HadoopMarshallerFilter.java
@@ -60,7 +60,7 @@ public class HadoopMarshallerFilter extends GridNioFilterAdapter {
     @Override public GridNioFuture<?> onSessionWrite(GridNioSession ses, Object msg) throws IgniteCheckedException {
         assert msg instanceof HadoopMessage : "Invalid message type: " + msg;
 
-        return proceedSessionWrite(ses, MarshallerUtils.marshal(marshaller, msg, ses.gridName()));
+        return proceedSessionWrite(ses, MarshallerUtils.marshal(ses.gridName(), marshaller, msg));
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1a3b0ea9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index c3700ab..51fa52d 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -1537,7 +1537,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
         return new JavaObjectSerializer() {
                 @Override public byte[] serialize(Object obj) throws Exception {
                     if (ctx != null)
-                        return MarshallerUtils.marshal(marshaller, obj, ctx.gridName());
+                        return MarshallerUtils.marshal(ctx.gridName(), marshaller, obj);
                     else
                         return MarshallerUtils.marshal(marshaller, obj);
                 }


Mime
View raw message