airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject svn commit: r1346912 - /incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java
Date Wed, 06 Jun 2012 14:22:47 GMT
Author: raminder
Date: Wed Jun  6 14:22:46 2012
New Revision: 1346912

URL: http://svn.apache.org/viewvc?rev=1346912&view=rev
Log:
reverted the change for URIArray in branch

Modified:
    incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java

Modified: incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java?rev=1346912&r1=1346911&r2=1346912&view=diff
==============================================================================
--- incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java
(original)
+++ incubator/airavata/branches/0.3-incubating-snapshot/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/impl/GramProvider.java
Wed Jun  6 14:22:46 2012
@@ -21,10 +21,17 @@
 
 package org.apache.airavata.core.gfac.provider.impl;
 
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
 import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
@@ -278,21 +285,23 @@ public class GramProvider extends Abstra
                     String stdout = ftp.readRemoteFile(stdoutURI, gssCred, localStdOutFile);
                     String stderr = ftp.readRemoteFile(stderrURI, gssCred, localStdErrFile);
                     Map<String,ActualParameter> stringMap = null;
+                    stringMap = OutputUtils.fillOutputFromStdout(invocationContext.<ActualParameter>getOutput(),
stdout);
                     MessageContext<Object> output = invocationContext.getOutput();
                     for (Iterator<String> iterator = output.getNames(); iterator.hasNext();
) {
                         String paramName = iterator.next();
-                        ActualParameter actualParameter = (ActualParameter) output.getValue(paramName);
-						if ("URIArray".equals(actualParameter.getType().getType().toString())) {
-							URI outputURI = GfacUtils.createGsiftpURI(endpoint,app.getOutputDataDirectory());
-							List<String> outputList = ftp.listDir(outputURI,gssCred);
-							String[] valueList = outputList.toArray(new String[outputList.size()]);
-							((URIArrayType) actualParameter.getType()).setValueArray(valueList);
-							stringMap = new HashMap<String, ActualParameter>();
-							stringMap.put(paramName, actualParameter);
-						}
-                    	else{
+//                        ActualParameter actualParameter = (ActualParameter) output.getValue(paramName);
+//						if ("URIArray".equals(actualParameter.getType().getType().toString())) {
+//							URI outputURI = GfacUtils.createGsiftpURI(endpoint,app.getOutputDataDirectory());
+//							List<String> outputList = ftp.listDir(outputURI,gssCred);
+//							String[] valueList = outputList.toArray(new String[outputList.size()]);
+//							((URIArrayType) actualParameter.getType()).setValueArray(valueList);
+//							stringMap = new HashMap<String, ActualParameter>();
+//							stringMap.put(paramName, actualParameter);
+//							invocationContext.getExecutionContext().getNotifier().output(invocationContext,
actualParameter.toString());
+//						}
+//                    	else{
                     	// This is to handle exception during the output parsing.
-                        stringMap = OutputUtils.fillOutputFromStdout(invocationContext.<ActualParameter>getOutput(),
stdout);
+                       
                         String paramValue = output.getStringValue(paramName);
                         if(paramValue == null || paramValue.isEmpty()){
                             int errCode = listener.getError();
@@ -304,12 +313,12 @@ public class GramProvider extends Abstra
                             throw error;
                         }
                         }
-                    }
-                    if(stringMap == null || stringMap.isEmpty()){
-                    	ProviderException exception = new ProviderException("Error creating
job output");
-                    	 invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,exception,exception.getLocalizedMessage());
-                         throw exception;
-                    }
+//                    }
+//                    if(stringMap == null || stringMap.isEmpty()){
+//                    	ProviderException exception = new ProviderException("Error creating
job output");
+//                    	 invocationContext.getExecutionContext().getNotifier().executionFail(invocationContext,exception,exception.getLocalizedMessage());
+//                         throw exception;
+//                    }
                     // If users has given an output DAta poth we download the output files
in to that directory, this will be apath in the machine where GFac is installed
                     if(WorkflowContextHeaderBuilder.getCurrentContextHeader()
                             .getWorkflowOutputDataHandling() != null){
@@ -353,7 +362,7 @@ public class GramProvider extends Abstra
 	@Override
 	protected Map<String, ?> processInput(InvocationContext invocationContext)
             throws ProviderException {
-        MessageContext inputNew = new ParameterContextImpl();
+        MessageContext<ActualParameter> inputNew = new ParameterContextImpl();
         try {
 		    MessageContext<Object> input = invocationContext.getInput();
         for (Iterator<String> iterator = input.getNames(); iterator.hasNext();) {
@@ -419,7 +428,7 @@ public class GramProvider extends Abstra
     }
 
     private void stageOutputFiles(InvocationContext invocationContext,String outputFileStagingPath)
throws ProviderException {
-        MessageContext outputNew = new ParameterContextImpl();
+        MessageContext<ActualParameter> outputNew = new ParameterContextImpl();
         MessageContext<Object> input = invocationContext.getOutput();
         for (Iterator<String> iterator = input.getNames(); iterator.hasNext(); ) {
             String paramName = iterator.next();



Mime
View raw message