Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AF0C7187C7 for ; Thu, 30 Apr 2015 04:45:33 +0000 (UTC) Received: (qmail 80972 invoked by uid 500); 30 Apr 2015 04:45:33 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 80935 invoked by uid 500); 30 Apr 2015 04:45:33 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 80921 invoked by uid 99); 30 Apr 2015 04:45:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Apr 2015 04:45:33 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of root@apache.org designates 54.164.171.186 as permitted sender) Received: from [54.164.171.186] (HELO mx1-us-east.apache.org) (54.164.171.186) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Apr 2015 04:45:28 +0000 Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id ABDD64544F for ; Thu, 30 Apr 2015 04:44:19 +0000 (UTC) Received: (qmail 76640 invoked by uid 99); 30 Apr 2015 04:44:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Apr 2015 04:44:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 063EBE359A; Thu, 30 Apr 2015 04:44:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cos@apache.org To: commits@ignite.incubator.apache.org Date: Thu, 30 Apr 2015 04:44:43 -0000 Message-Id: In-Reply-To: <31a3d428a7414e88aee414940515980e@git.apache.org> References: <31a3d428a7414e88aee414940515980e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [26/50] incubator-ignite git commit: ignite-757 - prepareMarshall/finishUnmarshall X-Virus-Checked: Checked by ClamAV on apache.org ignite-757 - prepareMarshall/finishUnmarshall Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a2dba8b6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a2dba8b6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a2dba8b6 Branch: refs/heads/ignite-620 Commit: a2dba8b63450b6c1d502d3de8f805b884e6f5431 Parents: 36192bd Author: S.Vladykin Authored: Wed Apr 29 13:24:39 2015 +0300 Committer: S.Vladykin Committed: Wed Apr 29 13:24:39 2015 +0300 ---------------------------------------------------------------------- .../query/h2/twostep/GridResultPage.java | 9 +++++- .../query/h2/twostep/msg/GridH2Array.java | 6 ++-- .../query/h2/twostep/msg/GridH2CacheObject.java | 30 +++++++++++++++----- .../h2/twostep/msg/GridH2ValueMessage.java | 4 ++- .../twostep/msg/GridH2ValueMessageFactory.java | 19 +++++++------ 5 files changed, 49 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a2dba8b6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java index 0a4b746..9392fd1 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridResultPage.java @@ -17,12 +17,14 @@ package org.apache.ignite.internal.processors.query.h2.twostep; +import org.apache.ignite.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.query.h2.twostep.messages.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.plugin.extensions.communication.*; import org.h2.value.*; +import javax.cache.*; import java.util.*; import static org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2ValueMessageFactory.*; @@ -93,7 +95,12 @@ public class GridResultPage { rowIdx++; - return fillArray(valsIter, new Value[cols], ctx); + try { + return fillArray(valsIter, new Value[cols], ctx); + } + catch (IgniteCheckedException e) { + throw new CacheException(e); + } } @Override public void remove() { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a2dba8b6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Array.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Array.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Array.java index ec427b9..26fd81d 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Array.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Array.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.query.h2.twostep.msg; +import org.apache.ignite.*; import org.apache.ignite.internal.*; import org.apache.ignite.plugin.extensions.communication.*; import org.h2.value.*; @@ -43,8 +44,9 @@ public class GridH2Array extends GridH2ValueMessage { /** * @param val Value. + * @throws IgniteCheckedException If failed. */ - public GridH2Array(Value val) { + public GridH2Array(Value val) throws IgniteCheckedException { assert val.getType() == Value.ARRAY : val.getType(); ValueArray arr = (ValueArray)val; @@ -56,7 +58,7 @@ public class GridH2Array extends GridH2ValueMessage { } /** {@inheritDoc} */ - @Override public Value value(GridKernalContext ctx) { + @Override public Value value(GridKernalContext ctx) throws IgniteCheckedException { return ValueArray.get(fillArray(x.iterator(), new Value[x.size()], ctx)); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a2dba8b6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2CacheObject.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2CacheObject.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2CacheObject.java index 1ed068f..065393d 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2CacheObject.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2CacheObject.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.query.h2.twostep.msg; +import org.apache.ignite.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.query.h2.opt.*; @@ -43,17 +44,32 @@ public class GridH2CacheObject extends GridH2ValueMessage { } /** - * @param cacheId Cache ID. - * @param obj Object. + * @param v Value. + * @throws IgniteCheckedException If failed. */ - public GridH2CacheObject(int cacheId, CacheObject obj) { - this.cacheId = cacheId; - this.obj = obj; + public GridH2CacheObject(GridH2ValueCacheObject v) throws IgniteCheckedException { + this.obj = v.getCacheObject(); + + GridCacheContext cctx = v.getCacheContext(); + + if (cctx != null) { + this.cacheId = cctx.cacheId(); + + obj.prepareMarshal(cctx.cacheObjectContext()); + } } /** {@inheritDoc} */ - @Override public Value value(GridKernalContext ctx) { - return new GridH2ValueCacheObject(ctx.cache().context().cacheContext(cacheId), obj); + @Override public Value value(GridKernalContext ctx) throws IgniteCheckedException { + GridCacheContext cctx = null; + + if (ctx != null) { + cctx = ctx.cache().context().cacheContext(cacheId); + + obj.finishUnmarshal(cctx.cacheObjectContext(), cctx.deploy().globalLoader()); + } + + return new GridH2ValueCacheObject(cctx, obj); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a2dba8b6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessage.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessage.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessage.java index 3d4fe7c..577de40 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessage.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessage.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.query.h2.twostep.msg; +import org.apache.ignite.*; import org.apache.ignite.internal.*; import org.apache.ignite.plugin.extensions.communication.*; import org.h2.value.*; @@ -32,8 +33,9 @@ public abstract class GridH2ValueMessage implements Message { * * @param ctx Kernal context. * @return Value. + * @throws IgniteCheckedException If failed. */ - public abstract Value value(GridKernalContext ctx); + public abstract Value value(GridKernalContext ctx) throws IgniteCheckedException; /** {@inheritDoc} */ @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a2dba8b6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessageFactory.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessageFactory.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessageFactory.java index e5a8208..d193910 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessageFactory.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2ValueMessageFactory.java @@ -17,6 +17,7 @@ package org.apache.ignite.internal.processors.query.h2.twostep.msg; +import org.apache.ignite.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.query.h2.opt.*; import org.apache.ignite.plugin.extensions.communication.*; @@ -97,8 +98,10 @@ public class GridH2ValueMessageFactory implements MessageFactory { * @param src Source values. * @param dst Destination collection. * @return Destination collection. + * @throws IgniteCheckedException If failed. */ - public static Collection toMessages(Collection src, Collection dst) { + public static Collection toMessages(Collection src, Collection dst) + throws IgniteCheckedException { for (Value[] row : src) { for (Value val : row) dst.add(toMessage(val)); @@ -112,8 +115,10 @@ public class GridH2ValueMessageFactory implements MessageFactory { * @param dst Array to fill with values. * @param ctx Kernal context. * @return Filled array. + * @throws IgniteCheckedException If failed. */ - public static Value[] fillArray(Iterator src, Value[] dst, GridKernalContext ctx) { + public static Value[] fillArray(Iterator src, Value[] dst, GridKernalContext ctx) + throws IgniteCheckedException { for (int i = 0; i < dst.length; i++) { Message msg = src.next(); @@ -126,8 +131,9 @@ public class GridH2ValueMessageFactory implements MessageFactory { /** * @param v Value. * @return Message. + * @throws IgniteCheckedException If failed. */ - public static Message toMessage(Value v) { + public static Message toMessage(Value v) throws IgniteCheckedException { switch (v.getType()) { case Value.NULL: return GridH2Null.INSTANCE; @@ -177,11 +183,8 @@ public class GridH2ValueMessageFactory implements MessageFactory { return new GridH2Array(v); case Value.JAVA_OBJECT: - if (v instanceof GridH2ValueCacheObject) { - GridH2ValueCacheObject v0 = (GridH2ValueCacheObject)v; - - return new GridH2CacheObject(v0.getCacheContext().cacheId(), v0.getCacheObject()); - } + if (v instanceof GridH2ValueCacheObject) + return new GridH2CacheObject((GridH2ValueCacheObject)v); return new GridH2JavaObject(v);