airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1434843 - in /airavata/trunk/modules: airavata-client/src/main/java/org/apache/airavata/client/api/ airavata-client/src/main/java/org/apache/airavata/client/impl/ commons/workflow-execution-context/src/main/java/org/apache/airavata/common/...
Date Thu, 17 Jan 2013 18:21:07 GMT
Author: samindaw
Date: Thu Jan 17 18:21:07 2013
New Revision: 1434843

URL: http://svn.apache.org/viewvc?rev=1434843&view=rev
Log:
fixing bugs on API function parameter types allowing Boolean & Integer instead of boolean
& int + fixing adding new outputdatasettings function

Modified:
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/OutputDataSettings.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowOutputDataSettings.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationOutputDataSettingsImpl.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java
    airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowOutputDataSettingsImpl.java
    airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java?rev=1434843&r1=1434842&r2=1434843&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/HostSchedulingSettings.java
Thu Jan 17 18:21:07 2013
@@ -51,7 +51,7 @@ public interface HostSchedulingSettings 
 	 * Set whether to use WS-GRAM or Pre WS-GRAM
 	 * @param wsgramPreffered
 	 */
-	public void setWSGramPreffered(boolean wsgramPreffered);
+	public void setWSGramPreffered(Boolean wsgramPreffered);
 	
 	/**
 	 * Set the gatekeeper endpoint reference

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/OutputDataSettings.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/OutputDataSettings.java?rev=1434843&r1=1434842&r2=1434843&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/OutputDataSettings.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/OutputDataSettings.java
Thu Jan 17 18:21:07 2013
@@ -70,7 +70,7 @@ public interface OutputDataSettings {
 	 * @param isDataPersistance - if true (default value) the intermediate output data is 
 	 * kept, else discarded.
 	 */
-	public void setDataPersistent(boolean isDataPersistance);
+	public void setDataPersistent(Boolean isDataPersistance);
 	
 	/**
 	 * Default output data directory will be used.
@@ -86,4 +86,5 @@ public interface OutputDataSettings {
 	 * Default data persistent settings will be used.
 	 */
 	public void resetDataPersistent();
+
 }

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowOutputDataSettings.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowOutputDataSettings.java?rev=1434843&r1=1434842&r2=1434843&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowOutputDataSettings.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/WorkflowOutputDataSettings.java
Thu Jan 17 18:21:07 2013
@@ -43,7 +43,7 @@ public interface WorkflowOutputDataSetti
 	 * @param isDataPersistent
 	 * @return
 	 */
-	public OutputDataSettings addNewOutputDataSettings(String nodeId, String outputDataDirectory,
String dataRegistryURL, boolean isDataPersistent);
+	public OutputDataSettings addNewOutputDataSettings(String nodeId, String outputDataDirectory,
String dataRegistryURL, Boolean isDataPersistent);
 	
 	/**
 	 * Add new application putput data settings

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationOutputDataSettingsImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationOutputDataSettingsImpl.java?rev=1434843&r1=1434842&r2=1434843&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationOutputDataSettingsImpl.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ApplicationOutputDataSettingsImpl.java
Thu Jan 17 18:21:07 2013
@@ -30,7 +30,7 @@ public class ApplicationOutputDataSettin
 	private Boolean dataPersistent;
 
 	public ApplicationOutputDataSettingsImpl(String nodeId) {
-		this(nodeId, null,null,false);
+		this(nodeId, null,null,null);
 	}
 
 	public ApplicationOutputDataSettingsImpl(String nodeId, String outputDataDirectory, String
dataRegistryUrl, Boolean dataPersistent) {
@@ -66,7 +66,7 @@ public class ApplicationOutputDataSettin
 	}
 
 	@Override
-	public void setDataPersistent(boolean isDataPersistance) {
+	public void setDataPersistent(Boolean isDataPersistance) {
 		this.dataPersistent=isDataPersistance;
 	}
 

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java?rev=1434843&r1=1434842&r2=1434843&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
Thu Jan 17 18:21:07 2013
@@ -207,24 +207,14 @@ public class ExecutionManagerImpl implem
 				experimentID = workflowTemplateName + "_" + UUID.randomUUID();
 			}
 	        getClient().getProvenanceManager().setWorkflowInstanceTemplateName(experimentID,workflowTemplateName);
-	        
-			WorkflowContextHeaderBuilder builder=createWorkflowContextHeader();
-			
-			//TODO - fix user passing
+
+	        //TODO - fix user passing
 	        String submissionUser = getClient().getUserManager().getAiravataUser();
-			builder.setUserIdentifier(submissionUser);
 			String executionUser=options.getExperimentExecutionUser();
 			if (executionUser==null){
 				executionUser=submissionUser;
 			}
-			NodeSettings[] nodeSettingsList = options.getCustomWorkflowSchedulingSettings().getNodeSettingsList();
-			for (NodeSettings nodeSettings : nodeSettingsList) {
-				builder.addApplicationSchedulingContext(nodeSettings.getNodeId(), nodeSettings.getServiceId(),
nodeSettings.getHostSettings().getHostId(), nodeSettings.getHostSettings().isWSGRAMPreffered(),
nodeSettings.getHostSettings().getGatekeeperEPR(), nodeSettings.getHPCSettings().getJobManager(),
nodeSettings.getHPCSettings().getCPUCount(), nodeSettings.getHPCSettings().getNodeCount(),
nodeSettings.getHPCSettings().getQueueName(), nodeSettings.getHPCSettings().getMaxWallTime());
-			}
-			OutputDataSettings[] outputDataSettingsList = options.getCustomWorkflowOutputDataSettings().getOutputDataSettingsList();
-			for (OutputDataSettings outputDataSettings : outputDataSettingsList) {
-				builder.addApplicationOutputDataHandling(outputDataSettings.getNodeId(),outputDataSettings.getOutputDataDirectory(),
outputDataSettings.getDataRegistryUrl(), outputDataSettings.isDataPersistent());
-			}
+			WorkflowContextHeaderBuilder builder = createWorkflowContextHeaderBuilder(options, submissionUser);
 			runPreWorkflowExecutionTasks(experimentID, executionUser, options.getExperimentMetadata(),
options.getExperimentName());
 			NameValue[] inputVals = inputValues.toArray(new NameValue[] {});
 			if (listener!=null){
@@ -241,10 +231,22 @@ public class ExecutionManagerImpl implem
 	    }
 	}
 
-//	private String runWorkflow(String workflowName, List<WorkflowInput> inputs, ExperimentAdvanceOptions
options) throws AiravataAPIInvocationException {
-//		return runExperimentGeneral(extractWorkflow(workflowName), inputs, options, null);
-//	}
-	
+	private WorkflowContextHeaderBuilder createWorkflowContextHeaderBuilder(
+			ExperimentAdvanceOptions options, String submissionUser)
+			throws AiravataAPIInvocationException {
+		WorkflowContextHeaderBuilder builder=createWorkflowContextHeader();
+		builder.setUserIdentifier(submissionUser);
+		NodeSettings[] nodeSettingsList = options.getCustomWorkflowSchedulingSettings().getNodeSettingsList();
+		for (NodeSettings nodeSettings : nodeSettingsList) {
+			builder.addApplicationSchedulingContext(nodeSettings.getNodeId(), nodeSettings.getServiceId(),
nodeSettings.getHostSettings().getHostId(), nodeSettings.getHostSettings().isWSGRAMPreffered(),
nodeSettings.getHostSettings().getGatekeeperEPR(), nodeSettings.getHPCSettings().getJobManager(),
nodeSettings.getHPCSettings().getCPUCount(), nodeSettings.getHPCSettings().getNodeCount(),
nodeSettings.getHPCSettings().getQueueName(), nodeSettings.getHPCSettings().getMaxWallTime());
+		}
+		OutputDataSettings[] outputDataSettingsList = options.getCustomWorkflowOutputDataSettings().getOutputDataSettingsList();
+		for (OutputDataSettings outputDataSettings : outputDataSettingsList) {
+			builder.addApplicationOutputDataHandling(outputDataSettings.getNodeId(),outputDataSettings.getOutputDataDirectory(),
outputDataSettings.getDataRegistryUrl(), outputDataSettings.isDataPersistent());
+		}
+		return builder;
+	}
+
     private Workflow extractWorkflow(String workflowName) throws AiravataAPIInvocationException
{
         Workflow workflowObj = null;
         //FIXME - There should be a better way to figure-out if the passed string is a name
or an xml
@@ -379,4 +381,15 @@ public class ExecutionManagerImpl implem
 	
 	//------------------End of Deprecated Functions---------------------//
 
+	public static void main(String[] args) {
+		ExecutionManagerImpl a = new ExecutionManagerImpl(null);
+		try {
+			ExperimentAdvanceOptions b = a.createExperimentAdvanceOptions();
+			b.getCustomWorkflowOutputDataSettings().addNewOutputDataSettings("la", "di", "da", false);
+			WorkflowContextHeaderBuilder c = a.createWorkflowContextHeaderBuilder(b, "meeee");
+			System.out.println(XMLUtil.xmlElementToString(c.getXml()));
+		} catch (AiravataAPIInvocationException e) {
+			e.printStackTrace();
+		}
+	}
 }

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java?rev=1434843&r1=1434842&r2=1434843&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/HostSchedulingSettingsImpl.java
Thu Jan 17 18:21:07 2013
@@ -49,7 +49,7 @@ public class HostSchedulingSettingsImpl 
 	}
 
 	@Override
-	public void setWSGramPreffered(boolean wsgramPreffered) {
+	public void setWSGramPreffered(Boolean wsgramPreffered) {
 		this.wsgramPreffered=wsgramPreffered;
 	}
 

Modified: airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowOutputDataSettingsImpl.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowOutputDataSettingsImpl.java?rev=1434843&r1=1434842&r2=1434843&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowOutputDataSettingsImpl.java
(original)
+++ airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/WorkflowOutputDataSettingsImpl.java
Thu Jan 17 18:21:07 2013
@@ -47,8 +47,8 @@ public class WorkflowOutputDataSettingsI
 	@Override
 	public OutputDataSettings addNewOutputDataSettings(String nodeId,
 			String outputDataDirectory, String dataRegistryURL,
-			boolean isDataPersistent) {
-		getOutputDataSettingsListArray().add(new ApplicationOutputDataSettingsImpl(nodeId, outputDataDirectory,
dataRegistryURL, isDataPersistent));
+			Boolean isDataPersistent) {
+		addNewOutputDataSettings(new ApplicationOutputDataSettingsImpl(nodeId, outputDataDirectory,
dataRegistryURL, isDataPersistent));
 		return getOutputDataSettingsListArray().get(getOutputDataSettingsListArray().size()-1);
 	}
 
@@ -56,7 +56,6 @@ public class WorkflowOutputDataSettingsI
 	public void addNewOutputDataSettings(
 			OutputDataSettings... outputDataSettings) {
 		getOutputDataSettingsListArray().addAll(Arrays.asList(outputDataSettings));
-
 	}
 
 	@Override
@@ -73,7 +72,7 @@ public class WorkflowOutputDataSettingsI
 
 	@Override
 	public OutputDataSettings addNewOutputDataSettings(String nodeId) {
-		return new ApplicationOutputDataSettingsImpl(nodeId);
+		return addNewOutputDataSettings(nodeId,null,null,null);
 	}
 
 }

Modified: airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java?rev=1434843&r1=1434842&r2=1434843&view=diff
==============================================================================
--- airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
(original)
+++ airavata/trunk/modules/commons/workflow-execution-context/src/main/java/org/apache/airavata/common/workflow/execution/context/WorkflowContextHeaderBuilder.java
Thu Jan 17 18:21:07 2013
@@ -280,18 +280,28 @@ public class WorkflowContextHeaderBuilde
     }
 
     public WorkflowContextHeaderBuilder addApplicationOutputDataHandling(String nodeId, String
outputDir, String outputDataRegistry,
-            boolean dataPersistence) {
+            Boolean dataPersistence) {
         if (this.workflowOutputDataHandling == null) {
             this.workflowOutputDataHandling = WorkflowOutputDataHandlingDocument.WorkflowOutputDataHandling.Factory
                     .newInstance();
         }
-        ApplicationOutputDataHandlingDocument.ApplicationOutputDataHandling applicationOutputDataHandling
= this.workflowOutputDataHandling
-                .addNewApplicationOutputDataHandling();
-        applicationOutputDataHandling.setNodeId(nodeId);
-        applicationOutputDataHandling.setOutputDataDirectory(outputDir);
-        applicationOutputDataHandling.setDataRegistryUrl(outputDataRegistry);
-        applicationOutputDataHandling.setDataPersistance(dataPersistence);
-        return this;
+        if (nodeId!=null) {
+			ApplicationOutputDataHandlingDocument.ApplicationOutputDataHandling applicationOutputDataHandling
= this.workflowOutputDataHandling
+					.addNewApplicationOutputDataHandling();
+			applicationOutputDataHandling.setNodeId(nodeId);
+			if (outputDir!=null) {
+				applicationOutputDataHandling.setOutputDataDirectory(outputDir);
+			}
+			if (outputDataRegistry!=null) {
+				applicationOutputDataHandling
+						.setDataRegistryUrl(outputDataRegistry);
+			}
+			if (dataPersistence!=null) {
+				applicationOutputDataHandling
+						.setDataPersistance(dataPersistence);
+			}
+		}
+		return this;
     }
     
     /**
@@ -302,30 +312,51 @@ public class WorkflowContextHeaderBuilde
      * @return
      */
     public WorkflowContextHeaderBuilder addApplicationOutputDataHandling(String outputDir,
String outputDataRegistry,
-            boolean dataPersistence) {
+            Boolean dataPersistence) {
         return addApplicationOutputDataHandling(null, outputDir, outputDataRegistry, dataPersistence);
     }
 
     public WorkflowContextHeaderBuilder addApplicationSchedulingContext(String workflowNodeId,
String serviceId,
-            String hostName, boolean wsGramPreffered, String gateKeepersEpr, String jobManager,
int cpuCount,
-            int nodeCount, String qName, int maxWalTime) {
+            String hostName, Boolean wsGramPreffered, String gateKeepersEpr, String jobManager,
Integer cpuCount,
+            Integer nodeCount, String qName, Integer maxWalTime) {
         if (this.workflowSchedulingContext == null) {
             this.workflowSchedulingContext = WorkflowSchedulingContextDocument.WorkflowSchedulingContext.Factory
                     .newInstance();
         }
-        ApplicationSchedulingContextDocument.ApplicationSchedulingContext applicationSchedulingContext
= this.workflowSchedulingContext
-                .addNewApplicationSchedulingContext();
-        applicationSchedulingContext.setWorkflowNodeId(workflowNodeId);
-        applicationSchedulingContext.setCpuCount(cpuCount);
-        applicationSchedulingContext.setGatekeeperEpr(gateKeepersEpr);
-        applicationSchedulingContext.setHostName(hostName);
-        applicationSchedulingContext.setJobManager(jobManager);
-        applicationSchedulingContext.setMaxWallTime(maxWalTime);
-        applicationSchedulingContext.setServiceId(serviceId);
-        applicationSchedulingContext.setNodeCount(nodeCount);
-        applicationSchedulingContext.setQueueName(qName);
-        applicationSchedulingContext.setWsgramPreferred(wsGramPreffered);
-        return this;
+        if (workflowNodeId!=null) {
+			ApplicationSchedulingContextDocument.ApplicationSchedulingContext applicationSchedulingContext
= this.workflowSchedulingContext
+					.addNewApplicationSchedulingContext();
+			applicationSchedulingContext.setWorkflowNodeId(workflowNodeId);
+			if (cpuCount!=null) {
+				applicationSchedulingContext.setCpuCount(cpuCount);
+			}
+			if (gateKeepersEpr!=null) {
+				applicationSchedulingContext.setGatekeeperEpr(gateKeepersEpr);
+			}
+			if (hostName!=null) {
+				applicationSchedulingContext.setHostName(hostName);
+			}
+			if (jobManager!=null) {
+				applicationSchedulingContext.setJobManager(jobManager);
+			}
+			if (maxWalTime!=null) {
+				applicationSchedulingContext.setMaxWallTime(maxWalTime);
+			}
+			if (serviceId!=null) {
+				applicationSchedulingContext.setServiceId(serviceId);
+			}
+			if (nodeCount!=null) {
+				applicationSchedulingContext.setNodeCount(nodeCount);
+			}
+			if (qName!=null) {
+				applicationSchedulingContext.setQueueName(qName);
+			}
+			if (wsGramPreffered!=null) {
+				applicationSchedulingContext
+						.setWsgramPreferred(wsGramPreffered);
+			}
+		}
+		return this;
     }
 
     public static ContextHeaderDocument.ContextHeader removeOtherSchedulingConfig(String
nodeID, ContextHeaderDocument.ContextHeader header) {



Mime
View raw message