ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [34/50] [abbrv] ignite git commit: WIP
Date Wed, 07 Sep 2016 11:17:19 GMT
WIP


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

Branch: refs/heads/ignite-2649
Commit: cd993499f128f528641b127032bfdf7d960ceeca
Parents: bb65c7f
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Sep 7 12:34:32 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Sep 7 12:34:32 2016 +0300

----------------------------------------------------------------------
 .../cacheobject/IgniteCacheObjectProcessorImpl.java    |  5 ++---
 .../processors/continuous/GridContinuousProcessor.java | 13 +++++--------
 .../processors/continuous/StartRequestData.java        | 11 +++--------
 .../processors/offheap/GridOffHeapProcessor.java       |  5 ++---
 .../rest/handlers/task/GridTaskCommandHandler.java     |  9 ++++-----
 5 files changed, 16 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cd993499/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index a3070e8..6630c7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -43,7 +43,6 @@ import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteUuid;
-import org.apache.ignite.marshaller.MarshallerUtils;
 import org.jetbrains.annotations.Nullable;
 
 import static org.apache.ignite.cache.CacheMemoryMode.OFFHEAP_VALUES;
@@ -108,8 +107,8 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter
impleme
     @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr)
         throws IgniteCheckedException
     {
-        return MarshallerUtils.unmarshal(ctx.kernalContext().gridName(), ctx.kernalContext().cache().context().marshaller(),
-                bytes, U.resolveClassLoader(clsLdr, ctx.kernalContext().config()));
+        return ctx.kernalContext().cache().context().marshaller().unmarshal(bytes, U.resolveClassLoader(clsLdr,
+            ctx.kernalContext().config()));
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd993499/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 28df19f..e96e646 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
@@ -77,7 +77,6 @@ import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.lang.IgniteProductVersion;
 import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.marshaller.MarshallerUtils;
 import org.apache.ignite.plugin.extensions.communication.Message;
 import org.apache.ignite.thread.IgniteThread;
 import org.jetbrains.annotations.Nullable;
@@ -289,8 +288,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
 
                 if (msg.data() == null && msg.dataBytes() != null) {
                     try {
-                        msg.data(MarshallerUtils.unmarshal(ctx.gridName(), marsh, msg.dataBytes(),
-                            U.resolveClassLoader(ctx.config())));
+                        msg.data(marsh.unmarshal(msg.dataBytes(), U.resolveClassLoader(ctx.config())));
                     }
                     catch (IgniteCheckedException e) {
                         U.error(log, "Failed to process message (ignoring): " + msg, e);
@@ -678,7 +676,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
                     reqData.className(clsName);
                     reqData.deploymentInfo(new GridDeploymentInfoBean(dep));
 
-                    reqData.p2pMarshal(marsh, ctx);
+                    reqData.p2pMarshal(marsh);
                 }
 
                 // Handle peer deployment for other handler-specific objects.
@@ -735,8 +733,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
 
                     if (msg.data() == null && msg.dataBytes() != null) {
                         try {
-                            msg.data(MarshallerUtils.unmarshal(ctx.gridName(), marsh, msg.dataBytes(),
-                                U.resolveClassLoader(ctx.config())));
+                            msg.data(marsh.unmarshal(msg.dataBytes(), U.resolveClassLoader(ctx.config())));
                         }
                         catch (IgniteCheckedException e) {
                             U.error(log, "Failed to process message (ignoring): " + msg,
e);
@@ -979,7 +976,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
                     if (dep == null)
                         throw new IgniteDeploymentCheckedException("Failed to obtain deployment
for class: " + clsName);
 
-                    data.p2pUnmarshal(marsh, U.resolveClassLoader(dep.classLoader(), ctx.config()),
ctx);
+                    data.p2pUnmarshal(marsh, U.resolveClassLoader(dep.classLoader(), ctx.config()));
                 }
 
                 hnd.p2pUnmarshal(node.id(), ctx);
@@ -1324,7 +1321,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(ctx, msg.data()));
+            msg.dataBytes(marsh.marshal(msg.data()));
 
         for (ClusterNode node : nodes) {
             int cnt = 0;

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd993499/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 bc5739a..cdfe0e1 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
@@ -23,13 +23,11 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.deployment.GridDeploymentInfo;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.marshaller.MarshallerUtils;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -92,10 +90,9 @@ class StartRequestData implements Externalizable {
 
     /**
      * @param marsh Marshaller.
-     * @param kernalCtx Kernal context.
      * @throws org.apache.ignite.IgniteCheckedException In case of error.
      */
-    void p2pMarshal(Marshaller marsh, final GridKernalContext kernalCtx) throws IgniteCheckedException
{
+    void p2pMarshal(Marshaller marsh) throws IgniteCheckedException {
         assert marsh != null;
 
         prjPredBytes = marsh.marshal(prjPred);
@@ -104,17 +101,15 @@ class StartRequestData implements Externalizable {
     /**
      * @param marsh Marshaller.
      * @param ldr Class loader.
-     * @param kernalCtx Kernal context.
      * @throws org.apache.ignite.IgniteCheckedException In case of error.
      */
-    void p2pUnmarshal(Marshaller marsh, @Nullable ClassLoader ldr,
-        final GridKernalContext kernalCtx) throws IgniteCheckedException {
+    void p2pUnmarshal(Marshaller marsh, @Nullable ClassLoader ldr) throws IgniteCheckedException
{
         assert marsh != null;
 
         assert prjPred == null;
         assert prjPredBytes != null;
 
-        prjPred = MarshallerUtils.unmarshal(kernalCtx.gridName(), marsh, prjPredBytes, ldr);
+        prjPred = marsh.unmarshal(prjPredBytes, ldr);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd993499/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 1de7049..d9d4421 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
@@ -33,7 +33,6 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiPredicate;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.marshaller.MarshallerUtils;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 
@@ -109,7 +108,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(ctx, key);
+        return keyBytes != null ? keyBytes : marsh.marshal(key);
     }
 
     /**
@@ -213,7 +212,7 @@ public class GridOffHeapProcessor extends GridProcessorAdapter {
         if (valBytes == null)
             return null;
 
-        return MarshallerUtils.unmarshal(ctx.gridName(), marsh, valBytes, U.resolveClassLoader(ldr,
ctx.config()));
+        return marsh.unmarshal(valBytes, U.resolveClassLoader(ldr, ctx.config()));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd993499/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 c052570..6937196 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
@@ -63,7 +63,6 @@ import org.apache.ignite.internal.visor.util.VisorClusterGroupEmptyException;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.lang.IgniteUuid;
-import org.apache.ignite.marshaller.MarshallerUtils;
 import org.apache.ignite.resources.IgniteInstanceResource;
 import org.jetbrains.annotations.Nullable;
 
@@ -136,13 +135,13 @@ public class GridTaskCommandHandler extends GridRestCommandHandlerAdapter
{
                             res.error(err.getMessage());
                         else {
                             res.result(desc.result());
-                            res.resultBytes(MarshallerUtils.marshal(ctx, desc.result()));
+                            res.resultBytes(ctx.config().getMarshaller().marshal(desc.result()));
                         }
                     }
                     else
                         res.found(false);
 
-                    Object topic = MarshallerUtils.unmarshal(ctx.gridName(), ctx.config().getMarshaller(),
req.topicBytes(),
+                    Object topic = ctx.config().getMarshaller().unmarshal(req.topicBytes(),
                         U.resolveClassLoader(ctx.config()));
 
                     ctx.io().send(nodeId, topic, res, SYSTEM_POOL);
@@ -441,7 +440,7 @@ public class GridTaskCommandHandler extends GridRestCommandHandlerAdapter
{
                     res = (GridTaskResultResponse)msg;
 
                 try {
-                    res.result(MarshallerUtils.unmarshal(ctx.gridName(), ctx.config().getMarshaller(),
res.resultBytes(),
+                    res.result(ctx.config().getMarshaller().unmarshal(res.resultBytes(),
                         U.resolveClassLoader(ctx.config())));
                 }
                 catch (IgniteCheckedException e) {
@@ -495,7 +494,7 @@ public class GridTaskCommandHandler extends GridRestCommandHandlerAdapter
{
 
             // 2. Send message.
             try {
-                byte[] topicBytes = MarshallerUtils.marshal(ctx, topic);
+                byte[] topicBytes = ctx.config().getMarshaller().marshal(topic);
 
                 ctx.io().send(taskNode, TOPIC_REST, new GridTaskResultRequest(taskId, topic,
topicBytes), SYSTEM_POOL);
             }


Mime
View raw message