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 0E17D17A2B for ; Mon, 31 Aug 2015 10:16:05 +0000 (UTC) Received: (qmail 2925 invoked by uid 500); 31 Aug 2015 10:16:04 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 2854 invoked by uid 500); 31 Aug 2015 10:16:04 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 2838 invoked by uid 99); 31 Aug 2015 10:16:04 -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; Mon, 31 Aug 2015 10:16:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A73C6E01CA; Mon, 31 Aug 2015 10:16:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Mon, 31 Aug 2015 10:16:04 -0000 Message-Id: <91837026cc14485ea6f2493a35e4c349@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] ignite git commit: IGNITE-1325: Implemented platform extensions. Repository: ignite Updated Branches: refs/heads/master 4369c2033 -> c2de38d13 IGNITE-1325: Implemented platform extensions. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3e4052a6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3e4052a6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3e4052a6 Branch: refs/heads/master Commit: 3e4052a6d2b50b538585f94443b354d803e235d2 Parents: a457ab1 Author: vozerov-gridgain Authored: Mon Aug 31 13:16:09 2015 +0300 Committer: vozerov-gridgain Committed: Mon Aug 31 13:16:09 2015 +0300 ---------------------------------------------------------------------- .../processors/platform/PlatformTarget.java | 36 +++++++++++++----- .../platform/PlatformAbstractTarget.java | 40 ++++++++++++++++++++ 2 files changed, 67 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/3e4052a6/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java index 6a22453..c45bea1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformTarget.java @@ -46,15 +46,6 @@ public interface PlatformTarget { public Object inStreamOutObject(int type, long memPtr) throws Exception; /** - * Operation returning result to memory stream. - * - * @param type Operation type. - * @param memPtr Memory pointer. - * @throws Exception In case of failure. - */ - public void outStream(int type, long memPtr) throws Exception; - - /** * Operation accepting one memory stream and returning result to another memory stream. * * @param type Operation type. @@ -76,6 +67,33 @@ public interface PlatformTarget { public void inObjectStreamOutStream(int type, @Nullable Object arg, long inMemPtr, long outMemPtr) throws Exception; /** + * Operation returning long result. + * + * @param type Operation type. + * @return Result. + * @throws Exception In case of failure. + */ + public long outLong(int type) throws Exception; + + /** + * Operation returning result to memory stream. + * + * @param type Operation type. + * @param memPtr Memory pointer. + * @throws Exception In case of failure. + */ + public void outStream(int type, long memPtr) throws Exception; + + /** + * Operation returning object result. + * + * @param type Operation type. + * @return Result. + * @throws Exception If failed. + */ + public Object outObject(int type) throws Exception; + + /** * Start listening for the future. * * @param futId Future ID. http://git-wip-us.apache.org/repos/asf/ignite/blob/3e4052a6/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java ---------------------------------------------------------------------- diff --git a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java index 5864a7e..4c01bc0 100644 --- a/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java +++ b/modules/platform/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java @@ -85,6 +85,16 @@ public abstract class PlatformAbstractTarget implements PlatformTarget { } /** {@inheritDoc} */ + @Override public long outLong(int type) throws Exception { + try { + return processOutLong(type); + } + catch (Exception e) { + throw convertException(e); + } + } + + /** {@inheritDoc} */ @Override public void outStream(int type, long memPtr) throws Exception { try (PlatformMemory mem = platformCtx.memory().get(memPtr)) { PlatformOutputStream out = mem.output(); @@ -101,6 +111,16 @@ public abstract class PlatformAbstractTarget implements PlatformTarget { } /** {@inheritDoc} */ + @Override public Object outObject(int type) throws Exception { + try { + return processOutObject(type); + } + catch (Exception e) { + throw convertException(e); + } + } + + /** {@inheritDoc} */ @Override public void inStreamOutStream(int type, long inMemPtr, long outMemPtr) throws Exception { try (PlatformMemory inMem = platformCtx.memory().get(inMemPtr)) { PortableRawReaderEx reader = platformCtx.reader(inMem); @@ -271,6 +291,16 @@ public abstract class PlatformAbstractTarget implements PlatformTarget { * Process OUT operation. * * @param type Type. + * @throws IgniteCheckedException In case of exception. + */ + protected long processOutLong(int type) throws IgniteCheckedException { + return throwUnsupported(type); + } + + /** + * Process OUT operation. + * + * @param type Type. * @param writer Portable writer. * @throws IgniteCheckedException In case of exception. */ @@ -279,6 +309,16 @@ public abstract class PlatformAbstractTarget implements PlatformTarget { } /** + * Process OUT operation. + * + * @param type Type. + * @throws IgniteCheckedException In case of exception. + */ + protected Object processOutObject(int type) throws IgniteCheckedException { + return throwUnsupported(type); + } + + /** * Throw an exception rendering unsupported operation type. * * @param type Operation type.