airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1517612 - in /airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac: provider/impl/GramProvider.java utils/GFacUtils.java
Date Mon, 26 Aug 2013 17:23:17 GMT
Author: samindaw
Date: Mon Aug 26 17:23:16 2013
New Revision: 1517612

URL: http://svn.apache.org/r1517612
Log:
chk if the application was saved b4 trying to save again

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

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=1517612&r1=1517611&r2=1517612&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
Mon Aug 26 17:23:16 2013
@@ -157,7 +157,7 @@ public class GramProvider implements GFa
     private void submitJobs(String gateKeeper,
                             JobExecutionContext jobExecutionContext,
                             GlobusHostType globusHostType) throws GFacException, GFacProviderException
{
-
+    	boolean applicationSaved=false;
         if (twoPhase) {
             try {
                 /*
@@ -175,7 +175,7 @@ public class GramProvider implements GFa
             } catch (WaitingForCommitException e) {
 
                 saveApplicationJob(jobExecutionContext, ApplicationJobStatus.UN_SUBMITTED);
-
+                applicationSaved=true;
                 String jobStatusMessage = "Un-submitted JobID= " + job.getIDAsString();
                 log.info(jobStatusMessage);
                 jobExecutionContext.getNotifier().publish(new GramJobIDEvent(jobStatusMessage));
@@ -250,9 +250,14 @@ public class GramProvider implements GFa
         }
 
         currentlyExecutingJobCache.put(job.getIDAsString(), job);
-
+        
         // for provider test
-        saveApplicationJob(jobExecutionContext, ApplicationJobStatus.SUBMITTED);
+        if (applicationSaved){
+        	GFacUtils.updateApplicationJobStatus(jobExecutionContext, job.getIDAsString(), ApplicationJobStatus.SUBMITTED);
+        }else{
+	        saveApplicationJob(jobExecutionContext, ApplicationJobStatus.SUBMITTED);
+	        applicationSaved=true;
+        }
 
         /*
         * Wait until job is done

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=1517612&r1=1517611&r2=1517612&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
Mon Aug 26 17:23:16 2013
@@ -20,29 +20,51 @@
 */
 package org.apache.airavata.gfac.utils;
 
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetAddress;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+
 import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.utils.DBUtil;
 import org.apache.airavata.common.utils.StringUtil;
 import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.credential.store.store.CredentialReader;
 import org.apache.airavata.gfac.Constants;
-import org.apache.airavata.gfac.RequestData;
 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.registry.api.workflow.ApplicationJob.ApplicationJobStatus;
-import org.apache.airavata.schemas.gfac.*;
+import org.apache.airavata.schemas.gfac.BooleanArrayType;
+import org.apache.airavata.schemas.gfac.BooleanParameterType;
+import org.apache.airavata.schemas.gfac.DoubleArrayType;
+import org.apache.airavata.schemas.gfac.DoubleParameterType;
+import org.apache.airavata.schemas.gfac.FileArrayType;
+import org.apache.airavata.schemas.gfac.FileParameterType;
+import org.apache.airavata.schemas.gfac.FloatArrayType;
+import org.apache.airavata.schemas.gfac.FloatParameterType;
+import org.apache.airavata.schemas.gfac.IntegerArrayType;
+import org.apache.airavata.schemas.gfac.IntegerParameterType;
+import org.apache.airavata.schemas.gfac.Parameter;
+import org.apache.airavata.schemas.gfac.StringArrayType;
+import org.apache.airavata.schemas.gfac.StringParameterType;
+import org.apache.airavata.schemas.gfac.URIArrayType;
+import org.apache.airavata.schemas.gfac.URIParameterType;
 import org.apache.axiom.om.OMElement;
-import org.apache.axis2.deployment.DeploymentException;
 import org.globus.gram.GramJob;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.*;
-import java.net.*;
-import java.util.*;
-
 public class GFacUtils {
     private final static Logger log = LoggerFactory.getLogger(GFacUtils.class);
 



Mime
View raw message