airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1517698 - in /airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac: GFacAPI.java handler/GridFTPInputHandler.java utils/GramRSLGenerator.java utils/OutputUtils.java
Date Mon, 26 Aug 2013 21:08:32 GMT
Author: lahiru
Date: Mon Aug 26 21:08:31 2013
New Revision: 1517698

URL: http://svn.apache.org/r1517698
Log:
fixing in https://issues.apache.org/jira/browse/AIRAVATA-779.

Modified:
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/GFacAPI.java
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/GFacAPI.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/GFacAPI.java?rev=1517698&r1=1517697&r2=1517698&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/GFacAPI.java (original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/GFacAPI.java Mon
Aug 26 21:08:31 2013
@@ -77,7 +77,12 @@ public class GFacAPI {
             jobExecutionContext.setProperty(ERROR_SENT,"true");
             jobExecutionContext.getNotifier().publish(new ExecutionFailEvent(e.getCause()));
             throw e;
-        } finally {
+        } catch (Exception e){
+            jobExecutionContext.setProperty(ERROR_SENT,"true");
+            jobExecutionContext.getNotifier().publish(new ExecutionFailEvent(e.getCause()));
+            throw new GFacException(e);
+        }
+        finally {
             try{
             invokeOutFlowHandlers(jobExecutionContext);
             }catch(GFacException e){

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java?rev=1517698&r1=1517697&r2=1517698&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPInputHandler.java
Mon Aug 26 21:08:31 2013
@@ -53,8 +53,6 @@ public class GridFTPInputHandler impleme
 
     public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException
{
         log.info("Invoking GridFTPInputHandler ...");
-
-
         MessageContext inputNew = new MessageContext();
         try {
             MessageContext input = jobExecutionContext.getInMessageContext();

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java?rev=1517698&r1=1517697&r2=1517698&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramRSLGenerator.java
Mon Aug 26 21:08:31 2013
@@ -20,6 +20,7 @@
 */
 package org.apache.airavata.gfac.utils;
 
+import org.apache.airavata.common.utils.StringUtil;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.MappingFactory;
 import org.apache.airavata.gfac.Constants;
@@ -27,10 +28,7 @@ import org.apache.airavata.gfac.ToolsExc
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.context.MessageContext;
 import org.apache.airavata.gfac.provider.GFacProviderException;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.NameValuePairType;
-import org.apache.airavata.schemas.gfac.QueueType;
-import org.apache.airavata.schemas.gfac.URIArrayType;
+import org.apache.airavata.schemas.gfac.*;
 import org.apache.airavata.schemas.wec.ContextHeaderDocument;
 import org.globus.gram.GramAttributes;
 import org.slf4j.Logger;
@@ -49,7 +47,7 @@ public class GramRSLGenerator {
 
     ;
 
-    public static GramAttributes configureRemoteJob(JobExecutionContext context) throws ToolsException
{
+    public static GramAttributes  configureRemoteJob(JobExecutionContext context) throws
ToolsException {
         HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) context.getApplicationContext().getApplicationDeploymentDescription().getType();
         GramAttributes jobAttr = new GramAttributes();
         jobAttr.setExecutable(app.getExecutableLocation());
@@ -86,11 +84,18 @@ public class GramRSLGenerator {
             Set<String> keys = inputs.keySet();
             for (String paramName : keys ) {
              	ActualParameter actualParameter = (ActualParameter) inputs.get(paramName);
-                if ("URIArray".equals(actualParameter.getType().getType().toString())) {
-                    String[] values = ((URIArrayType) actualParameter.getType()).getValueArray();
-                    for (String value : values) {
-                        jobAttr.addArgument(value);
+                if ("URIArray".equals(actualParameter.getType().getType().toString()) ||
"StringArray".equals(actualParameter.getType().getType().toString())
+                        || "FileArray".equals(actualParameter.getType().getType().toString()))
{
+                    String[] values = null;
+                    if (actualParameter.getType() instanceof URIArrayType) {
+                        values = ((URIArrayType) actualParameter.getType()).getValueArray();
+                    } else if (actualParameter.getType() instanceof StringArrayType) {
+                        values = ((StringArrayType) actualParameter.getType()).getValueArray();
+                    } else if (actualParameter.getType() instanceof FileArrayType) {
+                        values = ((FileArrayType) actualParameter.getType()).getValueArray();
                     }
+                    String value = StringUtil.createDelimiteredString(values, " ");
+                    jobAttr.addArgument(value);
                 } else {
                     String paramValue = MappingFactory.toString(actualParameter);
                     jobAttr.addArgument(paramValue);

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java?rev=1517698&r1=1517697&r2=1517698&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
Mon Aug 26 21:08:31 2013
@@ -59,9 +59,6 @@ public class OutputUtils {
                 ((StdErrParameterType) actual.getType()).setValue(stderr);
                 result.put(paramName, actual);
             } else {
-            	if ("URI".equals(actual.getType().getType().toString()) &&  !((URIParameterType)
actual.getType()).getValue().isEmpty()){
-            		continue;
-            	}
                 String parseStdout = parseStdout(stdout, paramName);
                 if (parseStdout != null) {
                     MappingFactory.fromString(actual, parseStdout);



Mime
View raw message