X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=engine%2Fcompbio%2Fengine%2Flocal%2FAsyncLocalRunner.java;h=084cc347391411a7e46813d29ffd10e422a25186;hb=09a35ddd6973ae31086ca96b1455e379e73198a8;hp=cfc29167136ad6cc9ca5dd657bbc57326cb127ea;hpb=535359a3d592ee41bda72e7356f0181f6cee9d07;p=jabaws.git diff --git a/engine/compbio/engine/local/AsyncLocalRunner.java b/engine/compbio/engine/local/AsyncLocalRunner.java index cfc2916..084cc34 100644 --- a/engine/compbio/engine/local/AsyncLocalRunner.java +++ b/engine/compbio/engine/local/AsyncLocalRunner.java @@ -27,7 +27,7 @@ import compbio.engine.AsyncExecutor; import compbio.engine.Configurator; import compbio.engine.SubmissionManager; import compbio.engine.client.ConfiguredExecutable; -import compbio.engine.client.Util; +import compbio.engine.client.EngineUtil; import compbio.metadata.JobStatus; import compbio.metadata.JobSubmissionException; import compbio.metadata.ResultNotAvailableException; @@ -43,14 +43,12 @@ public final class AsyncLocalRunner implements AsyncExecutor { @Override public boolean cancelJob(String jobId) { - Future> future = SubmissionManager - .getTask(jobId); + Future> future = SubmissionManager.getTask(jobId); // The job has already finished or cancelled. if (future == null) { - log - .debug("Did not find future for local job " - + jobId - + " will not cancel it. Perhaps it has finished or cancelled already."); + log.debug("Did not find future for local job " + + jobId + + " will not cancel it. Perhaps it has finished or cancelled already."); return false; } LocalEngineUtil.cancelJob(future, getWorkDirectory(jobId)); @@ -59,8 +57,7 @@ public final class AsyncLocalRunner implements AsyncExecutor { @Override public JobStatus getJobStatus(String jobId) { - Future> future = SubmissionManager - .getTask(jobId); + Future> future = SubmissionManager.getTask(jobId); if (future == null) { return LocalEngineUtil.getRecordedJobStatus(jobId); } @@ -78,8 +75,7 @@ public final class AsyncLocalRunner implements AsyncExecutor { Future> future = lrunner.getFuture(); if (future == null) { - throw new RuntimeException("Future is NULL for executable " - + executable); + throw new RuntimeException("Future is NULL for executable " + executable); } SubmissionManager.addTask(executable, future); return executable.getTaskId(); @@ -88,7 +84,7 @@ public final class AsyncLocalRunner implements AsyncExecutor { /** * * @param jobId - * @return + * @return true if all files were removed, false otherwise */ @Override public boolean cleanup(String jobId) { @@ -98,11 +94,9 @@ public final class AsyncLocalRunner implements AsyncExecutor { try { cexec = future.get(); } catch (InterruptedException e) { - log.error("Cannot clean up as calculation was not completed!" - + e.getLocalizedMessage()); + log.error("Cannot clean up as calculation was not completed!" + e.getLocalizedMessage()); } catch (ExecutionException e) { - log.error("Cannot clean up due to ExecutionException " - + e.getLocalizedMessage()); + log.error("Cannot clean up due to ExecutionException " + e.getLocalizedMessage()); } if (cexec == null) { return false; @@ -113,7 +107,7 @@ public final class AsyncLocalRunner implements AsyncExecutor { @Override public ConfiguredExecutable getResults(String taskId) throws ResultNotAvailableException { - if (!Util.isValidJobId(taskId)) { + if (!EngineUtil.isValidJobId(taskId)) { // TODO should I be throwing something else? throw new IllegalArgumentException(taskId); } @@ -123,8 +117,7 @@ public final class AsyncLocalRunner implements AsyncExecutor { // If task was not find in the list of jobs, than it must have been // collected already // Resurrect the job to find out there the output is - ConfiguredExecutable exec = compbio.engine.client.Util - .loadExecutable(taskId); + ConfiguredExecutable exec = EngineUtil.loadExecutable(taskId); return exec; } return LocalEngineUtil.getResults(futureExec, taskId);