airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patanac...@apache.org
Subject svn commit: r1167007 - in /incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac: context/ exception/ extension/pre/ external/ provider/ provider/utils/ scheduler/ services/ utils/
Date Fri, 09 Sep 2011 05:33:52 GMT
Author: patanachai
Date: Fri Sep  9 05:33:51 2011
New Revision: 1167007

URL: http://svn.apache.org/viewvc?rev=1167007&view=rev
Log:
Code cleanup

Modified:
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/REVIEW.txt
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/SecurityException.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/SecurityException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/SecurityException.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/SecurityException.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/exception/SecurityException.java
Fri Sep  9 05:33:51 2011
@@ -23,6 +23,10 @@ package org.apache.airavata.core.gfac.ex
 
 public class SecurityException extends GfacException {
 
+    public SecurityException(String message) {
+        super(message);
+    }
+    
     public SecurityException(String message, Throwable cause) {
         super(message, cause);
     }

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/pre/HttpInputStaging.java
Fri Sep  9 05:33:51 2011
@@ -160,7 +160,6 @@ public class HttpInputStaging extends Pr
             out.flush();
 
         } finally {
-
             if (in != null) {
                 try {
                     in.close();

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/external/GridFtp.java
Fri Sep  9 05:33:51 2011
@@ -21,16 +21,13 @@
 
 package org.apache.airavata.core.gfac.external;
 
-import java.io.BufferedInputStream;
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
-import java.nio.CharBuffer;
 
 import org.apache.airavata.core.gfac.exception.GfacException;
 import org.apache.airavata.core.gfac.exception.ToolsException;
@@ -357,7 +354,7 @@ public class GridFtp {
             if (srcClient.getSize(srchost.getPath()) == destClient.getSize(desthost.getPath()))
{
                 log.debug("CHECK SUM OK");
             } else {
-                log.debug("CHECK SUM OK");
+                log.debug("****CHECK SUM FAILED****");
             }
 
         } catch (ServerException e) {

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/EC2Provider.java
Fri Sep  9 05:33:51 2011
@@ -35,6 +35,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.concurrent.TimeUnit;
 
 import javax.xml.namespace.QName;
@@ -274,8 +275,8 @@ public class EC2Provider extends Abstrac
             
             // log info
             log.info("Command = " + buildCommand(cmdList));
-            for (String key : nv.keySet()) {
-                log.info("Env[" + key + "] = " + nv.get(key));
+            for (Entry<String, String> entry : nv.entrySet()) {
+                log.info("Env[" + entry.getKey() + "] = " + entry.getValue());
             }
 
             // notify start
@@ -300,8 +301,8 @@ public class EC2Provider extends Abstrac
                 /*
                  * Set environment
                  */
-                for (String key : nv.keySet()) {
-                    session.setEnvVar(key, nv.get(key));
+                for (Entry<String, String> entry : nv.entrySet()) {
+                    session.setEnvVar(entry.getKey(), entry.getValue());
                 }
 
                 /*
@@ -393,7 +394,7 @@ public class EC2Provider extends Abstrac
 
             // notify the status
             for (Instance ins : instances) {
-                notifier.info(this, null, "EC2 Instance " + ins.getInstanceId() + " is "
+ ins.getState().getName().toString());
+                notifier.info(this, null, "EC2 Instance " + ins.getInstanceId() + " is "
+ ins.getState().getName());
             }
 
             try {

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/GramProvider.java
Fri Sep  9 05:33:51 2011
@@ -27,14 +27,12 @@ import java.net.URISyntaxException;
 
 import javax.xml.namespace.QName;
 
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.commons.gfac.type.app.GramApplicationDeployment;
 import org.apache.airavata.commons.gfac.type.app.ShellApplicationDeployment;
 import org.apache.airavata.commons.gfac.type.host.GlobusHost;
 import org.apache.airavata.commons.gfac.type.parameter.AbstractParameter;
 import org.apache.airavata.core.gfac.context.invocation.InvocationContext;
 import org.apache.airavata.core.gfac.context.security.impl.GSISecurityContext;
-import org.apache.airavata.core.gfac.exception.ExtensionException;
 import org.apache.airavata.core.gfac.exception.GfacException;
 import org.apache.airavata.core.gfac.exception.JobSubmissionFault;
 import org.apache.airavata.core.gfac.exception.ProviderException;
@@ -44,7 +42,6 @@ import org.apache.airavata.core.gfac.ext
 import org.apache.airavata.core.gfac.notification.NotificationService;
 import org.apache.airavata.core.gfac.provider.utils.GramRSLGenerator;
 import org.apache.airavata.core.gfac.provider.utils.JobSubmissionListener;
-import org.apache.airavata.core.gfac.utils.ErrorCodes;
 import org.apache.airavata.core.gfac.utils.GfacUtils;
 import org.apache.airavata.core.gfac.utils.OutputUtils;
 import org.globus.gram.GramAttributes;
@@ -96,7 +93,6 @@ public class GramProvider extends Abstra
     public void execute(InvocationContext invocationContext) throws ProviderException {
     	GlobusHost host = (GlobusHost)invocationContext.getExecutionDescription().getHost();
     	GramApplicationDeployment app = (GramApplicationDeployment)invocationContext.getExecutionDescription().getApp();
-        ServiceDescription service = invocationContext.getExecutionDescription().getService();
 
         log.info("Searching for Gate Keeper");
         String gatekeeper = host.getGlobusGateKeeperEndPoint();

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/SSHProvider.java
Fri Sep  9 05:33:51 2011
@@ -27,6 +27,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.concurrent.TimeUnit;
 
 import javax.xml.namespace.QName;
@@ -171,8 +172,8 @@ public class SSHProvider extends Abstrac
 
             // log info
             log.info("Command = " + buildCommand(cmdList));
-            for (String key : nv.keySet()) {
-                log.info("Env[" + key + "] = " + nv.get(key));
+            for (Entry<String, String> entry : nv.entrySet()) {
+                log.info("Env[" + entry.getKey() + "] = " + entry.getValue());
             }
 
             // notify start
@@ -195,8 +196,8 @@ public class SSHProvider extends Abstrac
                 /*
                  * Set environment
                  */
-                for (String key : nv.keySet()) {
-                    session.setEnvVar(key, nv.get(key));
+                for (Entry<String, String> entry : nv.entrySet()) {
+                    session.setEnvVar(entry.getKey(), entry.getValue());
                 }
 
                 /*

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/provider/utils/GramRSLGenerator.java
Fri Sep  9 05:33:51 2011
@@ -102,7 +102,7 @@ public class GramRSLGenerator {
 
         String jobType = JobType.SINGLE.toString();
         if (app.getJobType() != null) {
-            jobType = app.getJobType().toString();
+            jobType = app.getJobType();
         }
 
         if (jobType.equalsIgnoreCase(JobType.SINGLE.toString())) {

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/Scheduler.java
Fri Sep  9 05:33:51 2011
@@ -26,5 +26,5 @@ import org.apache.airavata.core.gfac.exc
 import org.apache.airavata.core.gfac.provider.Provider;
 
 public interface Scheduler {
-    public Provider schedule(InvocationContext context) throws SchedulerException;
+    Provider schedule(InvocationContext context) throws SchedulerException;
 }

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/GenericService.java
Fri Sep  9 05:33:51 2011
@@ -26,9 +26,9 @@ import org.apache.airavata.core.gfac.exc
 
 public interface GenericService {
 
-    public void init() throws GfacException;
+    void init() throws GfacException;
 
-    public void execute(InvocationContext context) throws GfacException;
+    void execute(InvocationContext context) throws GfacException;
 
-    public void dispose() throws GfacException;
+    void dispose() throws GfacException;
 }

Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java?rev=1167007&r1=1167006&r2=1167007&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java
(original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/utils/GfacUtils.java
Fri Sep  9 05:33:51 2011
@@ -22,7 +22,6 @@
 package org.apache.airavata.core.gfac.utils;
 
 import java.io.BufferedReader;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
@@ -97,13 +96,8 @@ public class GfacUtils {
 
     public static boolean isLocalHost(String appHost) throws UnknownHostException {
         String localHost = InetAddress.getLocalHost().getCanonicalHostName();
-
-        if (localHost.equals(appHost) || GFacConstants.LOCALHOST.equals(appHost)
-                || GFacConstants._127_0_0_1.equals(appHost)) {
-            return true;
-        } else {
-            return false;
-        }
+        return (localHost.equals(appHost) || GFacConstants.LOCALHOST.equals(appHost)
+                || GFacConstants._127_0_0_1.equals(appHost));
     }
 
     // TODO: why do you need the date? UUID will give you a unique ID.



Mime
View raw message