ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: #ignite-965: add checking for exception in map function.
Date Wed, 24 Jun 2015 10:08:48 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-965 b7f2393e0 -> cb0407ddb


#ignite-965: add checking for exception in map function.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cb0407dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cb0407dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cb0407dd

Branch: refs/heads/ignite-965
Commit: cb0407ddb01593c9299f5a6cb1949a63a090b206
Parents: b7f2393
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Jun 24 13:08:40 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Jun 24 13:08:40 2015 +0300

----------------------------------------------------------------------
 .../handlers/scripting/IgniteScriptingCommandHandler.java    | 8 +++++++-
 .../internal/processors/scripting/IgniteScriptProcessor.java | 6 +++---
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cb0407dd/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
index 839f412..ff56d88 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/scripting/IgniteScriptingCommandHandler.java
@@ -210,8 +210,14 @@ public class IgniteScriptingCommandHandler extends GridRestCommandHandlerAdapter
             try {
                 String[] data = new String[results.size()];
 
-                for (int i = 0; i < results.size(); ++i)
+                for (int i = 0; i < results.size(); ++i) {
+                    IgniteException err = results.get(i).getException();
+
+                    if (err != null)
+                        return new GridRestResponse(GridRestResponse.STATUS_FAILED, err.getMessage());
+
                     data[i] = results.get(i).getData().toString();
+                }
 
                 return new GridRestResponse(ctx.scripting().invokeFunction(reduceFunc, (Object)data));
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cb0407dd/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptProcessor.java
index b6f29ed..9843bc3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/scripting/IgniteScriptProcessor.java
@@ -84,15 +84,15 @@ public class IgniteScriptProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * @param source Script source.
+     * @param src Script src.
      * @param args Arguments.
      * @return Result of the function.
      * @throws IgniteCheckedException If script failed.
      */
-    public Object invokeFunction(String source, Object... args) throws IgniteCheckedException
{
+    public Object invokeFunction(String src, Object... args) throws IgniteCheckedException
{
         Object[] newArgs = new Object[args.length + 1];
 
-        newArgs[0] = source;
+        newArgs[0] = src;
 
         System.arraycopy(args, 0, newArgs, 1, args.length);
 


Mime
View raw message