airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1490321 - in /airavata/trunk: modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/ modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/ modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/...
Date Thu, 06 Jun 2013 15:16:42 GMT
Author: samindaw
Date: Thu Jun  6 15:16:42 2013
New Revision: 1490321

URL: http://svn.apache.org/r1490321
Log:
updating migrate script + gfac enum status obj + refactor

Modified:
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GFacUtils.java
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramJobSubmissionListener.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java
    airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_derby.sql

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java?rev=1490321&r1=1490320&r2=1490321&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
Thu Jun  6 15:16:42 2013
@@ -24,7 +24,6 @@ import java.util.Calendar;
 import java.util.Map;
 
 import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.gfac.Constants;
 import org.apache.airavata.gfac.GFacException;
 import org.apache.airavata.gfac.JobSubmissionFault;
 import org.apache.airavata.gfac.context.JobExecutionContext;
@@ -33,6 +32,7 @@ import org.apache.airavata.gfac.notifica
 import org.apache.airavata.gfac.notification.events.StartExecutionEvent;
 import org.apache.airavata.gfac.provider.GFacProvider;
 import org.apache.airavata.gfac.provider.GFacProviderException;
+import org.apache.airavata.gfac.utils.GFacUtils;
 import org.apache.airavata.gfac.utils.GramJobSubmissionListener;
 import org.apache.airavata.gfac.utils.GramProviderUtils;
 import org.apache.airavata.registry.api.workflow.ApplicationJob;
@@ -52,7 +52,7 @@ public class GramProvider implements GFa
     private GramJob job;
     private GramJobSubmissionListener listener;
 
-    // This method precpare the environment before the application invocation.
+    // This method prepare the environment before the application invocation.
     public void initialize(JobExecutionContext jobExecutionContext) throws GFacProviderException
{
         job = GramProviderUtils.setupEnvironment(jobExecutionContext);
         listener = new GramJobSubmissionListener(job, jobExecutionContext);
@@ -90,23 +90,14 @@ public class GramProvider implements GFa
             log.info(jobID);
             jobExecutionContext.getNotifier().publish(new GramJobIDEvent(jobID));
            
-            String experimentID = (String) jobExecutionContext.getProperty(Constants.PROP_TOPIC);
-            String nodeID = (String)jobExecutionContext.getProperty(Constants.PROP_WORKFLOW_NODE_ID);
-            
             //WorkflowNodeGramData workflowNodeGramData = new WorkflowNodeGramData(experimentID,
nodeID, job.getRSL(),hostName , job.getIDAsString());;
             
             try {
             	// for provider test
             	if(jobExecutionContext.getGFacConfiguration().getAiravataAPI() != null){
-            		ApplicationJob appJob = new ApplicationJob();
+            		ApplicationJob appJob = GFacUtils.createApplicationJob(jobExecutionContext);
                     appJob.setJobId(job.getIDAsString());
                     appJob.setJobData(job.getRSL());
-                    appJob.setExperimentId(experimentID);
-                    appJob.setWorkflowExecutionId(experimentID);
-                    appJob.setNodeId(nodeID);
-                    appJob.setServiceDescriptionId(jobExecutionContext.getApplicationContext().getServiceDescription().getType().getName());
-                    appJob.setHostDescriptionId(jobExecutionContext.getApplicationContext().getHostDescription().getType().getHostName());
-                    appJob.setApplicationDescriptionId(jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType().getApplicationName().getStringValue());
                     appJob.setSubmittedTime(Calendar.getInstance().getTime());
                     appJob.setJobStatus(ApplicationJobStatus.SUBMITTED);
                     appJob.setStatusUpdateTime(appJob.getSubmittedTime());

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GFacUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GFacUtils.java?rev=1490321&r1=1490320&r2=1490321&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GFacUtils.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GFacUtils.java
Thu Jun  6 15:16:42 2013
@@ -22,7 +22,9 @@ package org.apache.airavata.gfac.utils;
 
 import org.apache.airavata.commons.gfac.type.ActualParameter;
 import org.apache.airavata.gfac.Constants;
+import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.deployment.classloaders.JarFileClassLoader;
+import org.apache.airavata.registry.api.workflow.ApplicationJob;
 import org.apache.airavata.schemas.gfac.*;
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.deployment.DeploymentException;
@@ -400,4 +402,17 @@ public class GFacUtils {
         }
         return actualParameter;
     }
+    
+
+	public static ApplicationJob createApplicationJob(
+			JobExecutionContext jobExecutionContext) {
+		ApplicationJob appJob = new ApplicationJob();
+		appJob.setExperimentId((String) jobExecutionContext.getProperty(Constants.PROP_TOPIC));
+		appJob.setWorkflowExecutionId(appJob.getExperimentId());
+		appJob.setNodeId((String)jobExecutionContext.getProperty(Constants.PROP_WORKFLOW_NODE_ID));
+		appJob.setServiceDescriptionId(jobExecutionContext.getApplicationContext().getServiceDescription().getType().getName());
+		appJob.setHostDescriptionId(jobExecutionContext.getApplicationContext().getHostDescription().getType().getHostName());
+		appJob.setApplicationDescriptionId(jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType().getApplicationName().getStringValue());
+		return appJob;
+	}
 }

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramJobSubmissionListener.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramJobSubmissionListener.java?rev=1490321&r1=1490320&r2=1490321&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramJobSubmissionListener.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/GramJobSubmissionListener.java
Thu Jun  6 15:16:42 2013
@@ -117,7 +117,7 @@ public class GramJobSubmissionListener i
     	case GramJob.STATUS_STAGE_OUT:
     		return ApplicationJobStatus.FINALIZE;
     	case GramJob.STATUS_SUSPENDED:
-    		return ApplicationJobStatus.PAUSED;
+    		return ApplicationJobStatus.SUSPENDED;
     	default:
     		return ApplicationJobStatus.UNKNOWN;
     	}

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1490321&r1=1490320&r2=1490321&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
Thu Jun  6 15:16:42 2013
@@ -1809,7 +1809,7 @@ public class AiravataJPARegistry extends
         }else {
         	ApplicationJob job = new ApplicationJob();
         	job.setJobId(workflowNodeGramData.getGramJobID());
-        	job.setMetadata(workflowNodeGramData.getInvokedHost());
+        	job.setHostDescriptionId(workflowNodeGramData.getInvokedHost());
         	job.setExperimentId(workflowNodeGramData.getWorkflowInstanceId());
         	job.setWorkflowExecutionId(workflowNodeGramData.getWorkflowInstanceId());
         	job.setNodeId(workflowNodeGramData.getNodeID());

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java?rev=1490321&r1=1490320&r2=1490321&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ApplicationJob.java
Thu Jun  6 15:16:42 2013
@@ -30,11 +30,12 @@ import java.util.Date;
 @XmlAccessorType(XmlAccessType.FIELD)
 public class ApplicationJob {
 	public static enum ApplicationJobStatus{
+		AUTHENTICATE, //authenticating
 		SUBMITTED, //job is submitted, possibly waiting to start executing
 		INITIALIZE, //job is being initialized 
 		PENDING, //job is pending to be started
 		EXECUTING, //submitted job is being executed
-		PAUSED, //job was paused
+		SUSPENDED, //job was paused
 		WAITING_FOR_DATA, // job is waiting for data to continue executing
 		FINALIZE, //job is being initialized 
 		FINISHED, // job completed successfully

Modified: airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_derby.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_derby.sql?rev=1490321&r1=1490320&r2=1490321&view=diff
==============================================================================
--- airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_derby.sql
(original)
+++ airavata/trunk/tools/registry-tool/src/main/resources/db-scripts/0.8/migrate_derby.sql
Thu Jun  6 15:16:42 2013
@@ -61,4 +61,4 @@ create table GFac_Job_Data
 
 INSERT INTO GFac_Job_Data(experiment_ID, workflow_instanceID, node_id, application_descriptor_ID,
host_descriptor_ID, service_descriptor_ID,
 job_data, local_Job_ID, submitted_time, statusUpdateTime, status, metadata) SELECT null,
workflow_instanceID, node_id, null, invoked_host,
-null, null, local_Job_ID, null, null, null, null FROM Gram_Data;
\ No newline at end of file
+null, rsl, local_Job_ID, null, null, null, null FROM Gram_Data;
\ No newline at end of file



Mime
View raw message