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 14119173BB for ; Wed, 1 Apr 2015 15:30:01 +0000 (UTC) Received: (qmail 63940 invoked by uid 500); 1 Apr 2015 15:23:20 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 63908 invoked by uid 500); 1 Apr 2015 15:23:20 -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 63899 invoked by uid 99); 1 Apr 2015 15:23:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2015 15:23:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 01 Apr 2015 15:22:53 +0000 Received: (qmail 59092 invoked by uid 99); 1 Apr 2015 15:22:44 -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, 01 Apr 2015 15:22:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 11CA1E2F24; Wed, 1 Apr 2015 15:22:44 +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, 01 Apr 2015 15:23:31 -0000 Message-Id: <4c0f48ce67b5494cb59e85419686f45b@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [49/50] incubator-ignite git commit: ignite-gg-10002 - removed unneeded marshalling-unmarshalling for local node X-Virus-Checked: Checked by ClamAV on apache.org ignite-gg-10002 - removed unneeded marshalling-unmarshalling for local node Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f8d5d445 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f8d5d445 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f8d5d445 Branch: refs/heads/ignite-gg-10002 Commit: f8d5d4457dae69966d94d5e43ba030d6ef97b435 Parents: e78ce56 Author: S.Vladykin Authored: Wed Apr 1 18:15:11 2015 +0300 Committer: S.Vladykin Committed: Wed Apr 1 18:15:11 2015 +0300 ---------------------------------------------------------------------- .../messages/GridQueryNextPageResponse.java | 32 ++++++++------------ .../query/h2/twostep/GridMapQueryExecutor.java | 6 ++-- .../query/h2/twostep/GridResultPage.java | 9 +++++- 3 files changed, 25 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8d5d445/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java index e798051..22f9cb4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/messages/GridQueryNextPageResponse.java @@ -26,7 +26,7 @@ import java.nio.*; /** * Next page response. */ -public class GridQueryNextPageResponse implements Externalizable, Message { +public class GridQueryNextPageResponse implements Message { /** */ private static final long serialVersionUID = 0L; @@ -45,6 +45,9 @@ public class GridQueryNextPageResponse implements Externalizable, Message { /** */ private byte[] rows; + /** */ + private transient Object plainRows; + /** * For {@link Externalizable}. */ @@ -58,16 +61,18 @@ public class GridQueryNextPageResponse implements Externalizable, Message { * @param page Page. * @param allRows All rows count. * @param rows Rows. + * @param plainRows Not marshalled rows for local node. */ public GridQueryNextPageResponse(long qryReqId, int qry, int page, int allRows, - byte[] rows) { - assert rows != null; + byte[] rows, Object plainRows) { + assert rows != null ^ plainRows != null; this.qryReqId = qryReqId; this.qry = qry; this.page = page; this.allRows = allRows; this.rows = rows; + this.plainRows = plainRows; } /** @@ -105,22 +110,11 @@ public class GridQueryNextPageResponse implements Externalizable, Message { return rows; } - /** {@inheritDoc} */ - @Override public void writeExternal(ObjectOutput out) throws IOException { - out.writeLong(qryReqId); - out.writeInt(qry); - out.writeInt(page); - out.writeInt(allRows); - U.writeByteArray(out, rows); - } - - /** {@inheritDoc} */ - @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - qryReqId = in.readLong(); - qry = in.readInt(); - page = in.readInt(); - allRows = in.readInt(); - rows = U.readByteArray(in); + /** + * @return Plain rows. + */ + public Object plainRows() { + return plainRows; } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8d5d445/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java index 2f54943..a0718e5 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java @@ -309,10 +309,12 @@ public class GridMapQueryExecutor implements GridMessageListener { } try { + boolean loc = node.isLocal(); + GridQueryNextPageResponse msg = new GridQueryNextPageResponse(qr.qryReqId, qry, page, - page == 0 ? res.rowCount : -1, marshallRows(rows)); + page == 0 ? res.rowCount : -1, loc ? null : marshallRows(rows), loc ? rows : null); - if (node.isLocal()) + if (loc) h2.reduceQueryExecutor().onMessage(ctx.localNodeId(), msg); else ctx.io().send(node, GridTopic.TOPIC_QUERY, msg, GridIoPolicy.PUBLIC_POOL); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f8d5d445/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 e31829d..5f58b95 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 @@ -44,6 +44,7 @@ public class GridResultPage { * @param res Response. * @param last If this is the globally last page. */ + @SuppressWarnings("unchecked") public GridResultPage(UUID src, GridQueryNextPageResponse res, boolean last) { assert src != null; @@ -55,7 +56,13 @@ public class GridResultPage { assert res == null : "The last page must be dummy."; // res == null means that it is a terminating dummy page for the given source node ID. - rows = res == null ? Collections.emptySet() : GridMapQueryExecutor.unmarshallRows(res.rows()); + if (res != null) { + Object plainRows = res.plainRows(); + + rows = plainRows != null ? (Collection)plainRows : GridMapQueryExecutor.unmarshallRows(res.rows()); + } + else + rows = Collections.emptySet(); } /**