airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1516619 - in /airavata/branches/airavata-0.8-maintenance-branch/modules: airavata-client/src/main/java/org/apache/airavata/client/impl/ commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/...
Date Thu, 22 Aug 2013 21:36:21 GMT
Author: chathuri
Date: Thu Aug 22 21:36:21 2013
New Revision: 1516619

URL: http://svn.apache.org/r1516619
Log:
porting issues fixed while migration to branch

Modified:
    airavata/branches/airavata-0.8-maintenance-branch/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java
    airavata/branches/airavata-0.8-maintenance-branch/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
    airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
    airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
    airavata/branches/airavata-0.8-maintenance-branch/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java
    airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java

Modified: airavata/branches/airavata-0.8-maintenance-branch/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java
URL: http://svn.apache.org/viewvc/airavata/branches/airavata-0.8-maintenance-branch/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java?rev=1516619&r1=1516618&r2=1516619&view=diff
==============================================================================
--- airavata/branches/airavata-0.8-maintenance-branch/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java
(original)
+++ airavata/branches/airavata-0.8-maintenance-branch/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/NodeSettingsImpl.java
Thu Aug 22 21:36:21 2013
@@ -21,6 +21,7 @@
 
 package org.apache.airavata.client.impl;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.airavata.client.api.HPCSettings;
@@ -92,6 +93,9 @@ public class NodeSettingsImpl implements
 
 	@Override
 	public List<NameValuePairType> getNameValuePair() {
+		if (nameValuePair==null){
+			nameValuePair=new ArrayList<NameValuePairType>();
+		}
 		return nameValuePair;
 	}
 

Modified: airavata/branches/airavata-0.8-maintenance-branch/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
URL: http://svn.apache.org/viewvc/airavata/branches/airavata-0.8-maintenance-branch/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java?rev=1516619&r1=1516618&r2=1516619&view=diff
==============================================================================
--- airavata/branches/airavata-0.8-maintenance-branch/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
(original)
+++ airavata/branches/airavata-0.8-maintenance-branch/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
Thu Aug 22 21:36:21 2013
@@ -53,9 +53,22 @@ public class WorkflowContextHeaderBuilde
 
 
     public WorkflowContextHeaderBuilder(ContextHeaderDocument.ContextHeader document){
-        this.contextHeader = document;
+    	ContextHeaderDocument parse = null;
+		try {
+			ContextHeaderDocument doc = ContextHeaderDocument.Factory.newInstance();
+			doc.setContextHeader(document);
+			parse = ContextHeaderDocument.Factory.parse(doc.xmlText());
+		} catch (XmlException e) {
+			e.printStackTrace();
+		}
+        this.contextHeader = parse.getContextHeader();
         if (contextHeader!=null) {
 			this.securityContext = contextHeader.getSecurityContext();
+			this.workflowSchedulingContext=contextHeader.getWorkflowSchedulingContext();
+			this.soaServiceEprs=contextHeader.getSoaServiceEprs();
+			this.workflowMonitoringContext=contextHeader.getWorkflowMonitoringContext();
+			this.workflowOutputDataHandling=contextHeader.getWorkflowOutputDataHandling();
+			this.userIdentifier=contextHeader.getUserIdentifier();
 		}
     }
     
@@ -164,7 +177,12 @@ public class WorkflowContextHeaderBuilde
     }
 
     public XmlElement getXml() {
-        ContextHeaderDocument document = ContextHeaderDocument.Factory.newInstance();
+        ContextHeaderDocument document = getDocument();
+        return XMLUtil.stringToXmlElement3(document.xmlText());
+    }
+
+	private ContextHeaderDocument getDocument() {
+		ContextHeaderDocument document = ContextHeaderDocument.Factory.newInstance();
         if (this.workflowMonitoringContext != null) {
             this.contextHeader.setWorkflowMonitoringContext(this.workflowMonitoringContext);
         }
@@ -184,8 +202,8 @@ public class WorkflowContextHeaderBuilde
             this.contextHeader.setWorkflowOutputDataHandling(this.workflowOutputDataHandling);
         }
         document.setContextHeader(this.contextHeader);
-        return XMLUtil.stringToXmlElement3(document.xmlText());
-    }
+		return document;
+	}
 
     public WorkflowContextHeaderBuilder setResourceSchedularUrl(String resourceSchedular)
{
         this.soaServiceEprs.setResourceSchedulerUrl(resourceSchedular);
@@ -402,15 +420,16 @@ public class WorkflowContextHeaderBuilde
     }
 
     public static ContextHeaderDocument.ContextHeader removeOtherSchedulingConfig(String
nodeID, ContextHeaderDocument.ContextHeader header) {
-        String s = XMLUtil.xmlElementToString(new WorkflowContextHeaderBuilder(header).getXml());
+    	WorkflowContextHeaderBuilder.setCurrentContextHeader(header);
+    	header=new WorkflowContextHeaderBuilder(header).getContextHeader();
         try {
             ApplicationSchedulingContextDocument.ApplicationSchedulingContext[] applicationSchedulingContextArray
=
                     header.getWorkflowSchedulingContext().getApplicationSchedulingContextArray();
-
+            
             int index = 0;
             if (applicationSchedulingContextArray != null) {
                 for (ApplicationSchedulingContextDocument.ApplicationSchedulingContext context
: applicationSchedulingContextArray) {
-                    if (context.getServiceId().equals(nodeID)) {
+                    if (context.getWorkflowNodeId().equals(nodeID)) {
                         index++;
                         header.getWorkflowSchedulingContext().setApplicationSchedulingContextArray(new
ApplicationSchedulingContextDocument.ApplicationSchedulingContext[]{context});
                         break;
@@ -437,14 +456,6 @@ public class WorkflowContextHeaderBuilde
         } catch (NullPointerException e) {
             return header;
         }
-        ContextHeaderDocument parse = null;
-        try {
-            parse = ContextHeaderDocument.Factory.parse(s);
-        } catch (XmlException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
-        }
-        //Set Old Context Header in to currentContextHeader
-        WorkflowContextHeaderBuilder.setCurrentContextHeader(parse.getContextHeader());
         return header;
     }
 }

Modified: airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
URL: http://svn.apache.org/viewvc/airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java?rev=1516619&r1=1516618&r2=1516619&view=diff
==============================================================================
--- airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
(original)
+++ airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/GridFTPOutputHandler.java
Thu Aug 22 21:36:21 2013
@@ -200,9 +200,6 @@ public class GridFTPOutputHandler implem
                 } catch (URISyntaxException e) {
                     log.error(e.getMessage());
                     throw new GFacHandlerException("URI is malformatted:" + e.getMessage(),
jobExecutionContext, e, readLastLinesofStdOut(localStdErrFile.getPath(), 20));
-                } catch (NullPointerException e) {
-                    log.error(e.getMessage());
-                    throw new GFacHandlerException("Output is not produced in stdout:" +
e.getMessage(), jobExecutionContext, e, readLastLinesofStdOut(localStdErrFile.getPath(), 20));
                 }
             }
         } catch (Exception e) {

Modified: airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
URL: http://svn.apache.org/viewvc/airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java?rev=1516619&r1=1516618&r2=1516619&view=diff
==============================================================================
--- airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
(original)
+++ airavata/branches/airavata-0.8-maintenance-branch/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/OutputUtils.java
Thu Aug 22 21:36:21 2013
@@ -28,6 +28,7 @@ import java.util.regex.Pattern;
 
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.commons.gfac.type.MappingFactory;
+import org.apache.airavata.gfac.handler.GFacHandlerException;
 import org.apache.airavata.schemas.gfac.StdErrParameterType;
 import org.apache.airavata.schemas.gfac.StdOutParameterType;
 import org.apache.airavata.schemas.gfac.URIParameterType;
@@ -37,6 +38,10 @@ public class OutputUtils {
 
     public static Map<String, ActualParameter> fillOutputFromStdout(Map<String,
Object> output, String stdout, String stderr) throws Exception {
 
+        if (stdout == null || stdout.equals("")){
+            throw new GFacHandlerException("Standard output is empty.");
+        }
+
         Map<String, ActualParameter> result = new HashMap<String, ActualParameter>();
         Set<String> keys = output.keySet();
         for (String paramName : keys) {
@@ -53,9 +58,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);

Modified: airavata/branches/airavata-0.8-maintenance-branch/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java
URL: http://svn.apache.org/viewvc/airavata/branches/airavata-0.8-maintenance-branch/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java?rev=1516619&r1=1516618&r2=1516619&view=diff
==============================================================================
--- airavata/branches/airavata-0.8-maintenance-branch/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java
(original)
+++ airavata/branches/airavata-0.8-maintenance-branch/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java
Thu Aug 22 21:36:21 2013
@@ -414,7 +414,8 @@ public class ExperimentDataRetriever {
                     "ON e.experiment_ID = ed.experiment_ID " +
                     "LEFT JOIN Experiment_Metadata em " +
                     "ON ed.experiment_ID = em.experiment_ID  " +
-                    "WHERE ed.username ='" + user + "'";
+                    "WHERE ed.username ='" + user + "'" +
+                    " ORDER BY e.submitted_date ASC";
 
             rs = statement.executeQuery(queryString);
             if (rs != null){

Modified: airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
URL: http://svn.apache.org/viewvc/airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java?rev=1516619&r1=1516618&r2=1516619&view=diff
==============================================================================
--- airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
(original)
+++ airavata/branches/airavata-0.8-maintenance-branch/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
Thu Aug 22 21:36:21 2013
@@ -23,12 +23,7 @@ package org.apache.airavata.xbaya.invoke
 import java.io.File;
 import java.io.StringReader;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
+import java.util.*;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLInputFactory;
@@ -283,7 +278,7 @@ public class EmbeddedGFacInvoker impleme
      */
     public synchronized boolean invoke() throws WorkflowException {
         try {
-        	 ContextHeaderDocument.ContextHeader contextHeader =
+            ContextHeaderDocument.ContextHeader contextHeader =
                      WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID,this.configuration.getContextHeader());
              String hostName = null;
             HostDescription registeredHost;
@@ -507,6 +502,13 @@ public class EmbeddedGFacInvoker impleme
         try {
             waitToFinish();
             if (outPut instanceof XmlElement) {
+                Iterator children = ((XmlElement) outPut).children();
+                while (children.hasNext()) {
+                    Object next = children.next();
+                    if (((XmlElement) next).getName().equals(name)) {
+                        return ((XmlElement)((XmlElement) next).children().next()).children().next();
+                    }
+                }
                 return ((XmlElement) ((XmlElement) ((XmlElement) outPut).children().next()).children().next()).children().next();
             } else {
                 return outPut;



Mime
View raw message