ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/2] ignite git commit: IGNITE-1325: Implemented platform extensions.
Date Mon, 31 Aug 2015 10:16:04 GMT
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 <vozerov@gridgain.com>
Authored: Mon Aug 31 13:16:09 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
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.


Mime
View raw message