// 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
*/\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
*/\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
*/\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
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
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
\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
\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
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
}\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
* @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