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 0A38418E4A for ; Wed, 29 Apr 2015 13:35:34 +0000 (UTC) Received: (qmail 50693 invoked by uid 500); 29 Apr 2015 13:35:34 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 50665 invoked by uid 500); 29 Apr 2015 13:35: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 50656 invoked by uid 99); 29 Apr 2015 13:35:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2015 13:35: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 (nike.apache.org: local policy) Received: from [54.76.25.247] (HELO mx1-eu-west.apache.org) (54.76.25.247) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2015 13:35:08 +0000 Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 163342AB1B for ; Wed, 29 Apr 2015 13:35:06 +0000 (UTC) Received: (qmail 50153 invoked by uid 99); 29 Apr 2015 13:35:05 -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; Wed, 29 Apr 2015 13:35:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C65FDE09B2; Wed, 29 Apr 2015 13:35:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergi@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 29 Apr 2015 13:35:09 -0000 Message-Id: <93e253d5d38a44068c01b9baa2f89b23@git.apache.org> In-Reply-To: <40ce8f5d7f81426d8b4f2e114300bf93@git.apache.org> References: <40ce8f5d7f81426d8b4f2e114300bf93@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [05/24] incubator-ignite git commit: ignite-757 - marshalling fix X-Virus-Checked: Checked by ClamAV on apache.org ignite-757 - marshalling fix Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a5c6bcf5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a5c6bcf5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a5c6bcf5 Branch: refs/heads/ignite-sprint-4 Commit: a5c6bcf5994346b6d9294d2c1ddb4a3d0c7cdabd Parents: 1556ec9 Author: S.Vladykin Authored: Thu Apr 23 10:21:55 2015 +0300 Committer: S.Vladykin Committed: Thu Apr 23 10:21:55 2015 +0300 ---------------------------------------------------------------------- .../processors/query/h2/IgniteH2Indexing.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5c6bcf5/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 7a0a4b2..cbf74fc 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 @@ -2158,16 +2158,18 @@ public class IgniteH2Indexing implements GridQueryIndexing { /** {@inheritDoc} */ @Override public byte[] getBytesNoCopy() { - // Can't just return valueBytes for portable because it can't be unmarshalled then. - if (coctx != null && coctx.processor().isPortableObject(obj)) - return Utils.serialize(obj, null); - - try { - return obj.valueBytes(coctx); // Result must be the same: `marshaller.marshall(obj.value(coctx, false))` - } - catch (IgniteCheckedException e) { - throw DbException.convert(e); + if (obj.type() == CacheObject.TYPE_REGULAR) { + // Result must be the same as `marshaller.marshall(obj.value(coctx, false));` + try { + return obj.valueBytes(coctx); + } + catch (IgniteCheckedException e) { + throw DbException.convert(e); + } } + + // For portables and byte array cache object types. + return Utils.serialize(obj.value(coctx, false), null); } /** {@inheritDoc} */