Improve coding style
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Thu, 8 Aug 2013 13:19:29 +0000 (14:19 +0100)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Fri, 9 Aug 2013 09:18:01 +0000 (10:18 +0100)
engine/compbio/engine/SubmissionManager.java
engine/compbio/engine/client/ConfExecutable.java
engine/compbio/engine/cluster/drmaa/AsyncJobRunner.java
engine/compbio/engine/local/LocalRunner.java

index 9d4f8d5..2880e8f 100644 (file)
@@ -41,16 +41,12 @@ public class SubmissionManager {
                // uninitializable\r
        }\r
 \r
-       public static void addTask(ConfiguredExecutable<?> executable,\r
-                       Future<ConfiguredExecutable<?>> future) {\r
-               Future<ConfiguredExecutable<?>> replacedTask = submittedTasks.put(\r
-                               executable.getTaskId(), future);\r
+       public static void addTask(ConfiguredExecutable<?> executable, Future<ConfiguredExecutable<?>> future) {\r
+               Future<ConfiguredExecutable<?>> replacedTask = submittedTasks.put(executable.getTaskId(), future);\r
                // just a percussion should never happened\r
                if (replacedTask != null) {\r
-                       log.fatal("Duplicated task id is detected by local engine for: "\r
-                                       + executable);\r
-                       throw new RuntimeException("Duplicated task ID is detected: "\r
-                                       + executable.getTaskId());\r
+                       log.fatal("Duplicated task id is detected by local engine for: " + executable);\r
+                       throw new RuntimeException("Duplicated task ID is detected: " + executable.getTaskId());\r
                }\r
        }\r
 \r
index 14c023f..d5fbbe7 100644 (file)
@@ -224,10 +224,8 @@ public class ConfExecutable<T> implements ConfiguredExecutable<T> {
         */\r
        public static <V> RunnerConfig<V> getRunnerOptions(\r
                        Class<? extends Executable<V>> clazz) throws IOException {\r
-               String parametersFile = clazz.getSimpleName().toLowerCase()\r
-                               + ".parameters.file";\r
-               return (RunnerConfig<V>) getRunnerConfiguration(clazz,\r
-                               RunnerConfig.class, parametersFile);\r
+               String parametersFile = clazz.getSimpleName().toLowerCase() + ".parameters.file";\r
+               return (RunnerConfig<V>) getRunnerConfiguration(clazz, RunnerConfig.class, parametersFile);\r
        }\r
 \r
        /*\r
@@ -236,10 +234,8 @@ public class ConfExecutable<T> implements ConfiguredExecutable<T> {
         */\r
        public static <V> PresetManager<V> getRunnerPresets(\r
                        Class<? extends Executable<V>> clazz) throws IOException {\r
-               String parametersFile = clazz.getSimpleName().toLowerCase()\r
-                               + ".presets.file";\r
-               PresetManager<V> presets = (PresetManager<V>) getRunnerConfiguration(\r
-                               clazz, PresetManager.class, parametersFile);\r
+               String parametersFile = clazz.getSimpleName().toLowerCase() + ".presets.file";\r
+               PresetManager<V> presets = (PresetManager<V>) getRunnerConfiguration(clazz, PresetManager.class, parametersFile);\r
                return presets;\r
        }\r
 \r
@@ -254,10 +250,8 @@ public class ConfExecutable<T> implements ConfiguredExecutable<T> {
         */\r
        public static <V> LimitsManager<V> getRunnerLimits(Class<V> clazz)\r
                        throws IOException {\r
-               String parametersFile = clazz.getSimpleName().toLowerCase()\r
-                               + ".limits.file";\r
-               LimitsManager<V> limits = (LimitsManager<V>) getRunnerConfiguration(\r
-                               clazz, LimitsManager.class, parametersFile);\r
+               String parametersFile = clazz.getSimpleName().toLowerCase() + ".limits.file";\r
+               LimitsManager<V> limits = (LimitsManager<V>) getRunnerConfiguration(clazz, LimitsManager.class, parametersFile);\r
                return limits;\r
        }\r
 \r
index 940c4ad..db50916 100644 (file)
@@ -47,8 +47,7 @@ public class AsyncJobRunner implements AsyncExecutor {
        public String submitJob(ConfiguredExecutable<?> executable)\r
                        throws JobSubmissionException {\r
                JobRunner jr = new JobRunner(executable);\r
-               jr.submitJob(); // ignore cluster job id as it could be retrieved from\r
-               // fs\r
+               jr.submitJob(); // ignore cluster job id as it could be retrieved from fs\r
                return executable.getTaskId();\r
        }\r
 \r
@@ -59,10 +58,9 @@ public class AsyncJobRunner implements AsyncExecutor {
                                clustSession);\r
        }\r
 \r
-       /**\r
-        * This will never return clust.engine.JobStatus.CANCELLED as for sun grid\r
-        * engine cancelled job is the same as failed. Cancelled jobs needs to be\r
-        * tracked manually!\r
+       /*\r
+        * This will never return clust.engine.JobStatus.CANCELLED as for sun grid engine \r
+        * cancelled job is the same as failed. Cancelled jobs needs to be tracked manually!\r
         */\r
        @Override\r
        public compbio.metadata.JobStatus getJobStatus(String jobId) {\r
index b722505..208bfa0 100644 (file)
@@ -36,8 +36,7 @@ public final class LocalRunner implements SyncExecutor {
 \r
        private static final Logger log = Logger.getLogger(LocalRunner.class);\r
        /*\r
-        * If is not advisable to start threads statically, thus this field is not\r
-        * static\r
+        * If is not advisable to start threads statically, thus this field is not static\r
         */\r
        private final ExecutorService executor;\r
        private final ConfiguredExecutable<?> executable;\r
@@ -46,8 +45,7 @@ public final class LocalRunner implements SyncExecutor {
 \r
        public LocalRunner(ConfiguredExecutable<?> executable) {\r
                if (executable == null) {\r
-                       throw new IllegalArgumentException(\r
-                                       "Executable value is NULL. Executable must be provided!");\r
+                       throw new IllegalArgumentException("Executable value is NULL. Executable must be provided!");\r
                }\r
                this.executor = LocalExecutorService.getExecutor();\r
                this.executable = executable;\r
@@ -56,8 +54,7 @@ public final class LocalRunner implements SyncExecutor {
                try {\r
                        executable.saveRunConfiguration();\r
                } catch (IOException e) {\r
-                       log.error("Could not save run configuration! " + e.getMessage(), e\r
-                                       .getCause());\r
+                       log.error("Could not save run configuration! " + e.getMessage(), e.getCause());\r
                }\r
        }\r
 \r
@@ -84,9 +81,9 @@ public final class LocalRunner implements SyncExecutor {
        }\r
 \r
        @Override\r
-       public void executeJob() throws JobSubmissionException {\r
-               ExecutableWrapper ewrapper = new ExecutableWrapper(executable,\r
-                               workDirectory);\r
+       public void executeJob()\r
+                       throws JobSubmissionException {\r
+               ExecutableWrapper ewrapper = new ExecutableWrapper(executable, workDirectory);\r
                this.future = executor.submit(ewrapper);\r
        }\r
 \r
@@ -94,7 +91,8 @@ public final class LocalRunner implements SyncExecutor {
         * @throws CancellationException\r
         */\r
        @Override\r
-       public ConfiguredExecutable<?> waitForResult() throws JobExecutionException {\r
+       public ConfiguredExecutable<?> waitForResult()\r
+                       throws JobExecutionException {\r
                try {\r
                        return LocalEngineUtil.getResults(future, executable.getTaskId());\r
                } catch (ResultNotAvailableException e) {\r