compbio.engine.cluster.drmaa
Class JobRunner

java.lang.Object
  extended by compbio.engine.cluster.drmaa.JobRunner
All Implemented Interfaces:
SyncExecutor

public class JobRunner
extends Object
implements SyncExecutor

Single cluster job runner class

Author:
pvtroshin

Constructor Summary
JobRunner(ConfiguredExecutable<?> confExec)
           
 
Method Summary
 boolean cancelJob()
          Stops running job.
 boolean cleanup()
          Clean up after the job
 boolean deepClean()
           
 void executeJob()
          Execute the job
static JobRunner getInstance(ConfiguredExecutable<?> executable)
           
 org.ggf.drmaa.JobInfo getJobInfo()
          This method will block before the calculation has completed and then return the object containing a job execution statistics
 JobStatus getJobStatus()
          Query the status of the job by its id.
 String getWorkDirectory()
           
 ConfiguredExecutable<?> waitForResult()
          Call to this method block for as long as it is required for an executable to finish its job.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobRunner

public JobRunner(ConfiguredExecutable<?> confExec)
          throws JobSubmissionException
Throws:
JobSubmissionException
Method Detail

deepClean

public boolean deepClean()

cleanup

public boolean cleanup()
Description copied from interface: SyncExecutor
Clean up after the job

Specified by:
cleanup in interface SyncExecutor
Returns:
true if all the files created by this job have been removed successfully, false otherwise

cancelJob

public boolean cancelJob()
Description copied from interface: SyncExecutor
Stops running job. Clean up is not performed.

Specified by:
cancelJob in interface SyncExecutor
Returns:
true if job was cancelled successfully, false otherwise

getWorkDirectory

public String getWorkDirectory()
Specified by:
getWorkDirectory in interface SyncExecutor
Returns:
working directory if the task

executeJob

public void executeJob()
                throws JobSubmissionException
Description copied from interface: SyncExecutor
Execute the job

Specified by:
executeJob in interface SyncExecutor
Throws:
JobSubmissionException - if submission fails

getJobInfo

public org.ggf.drmaa.JobInfo getJobInfo()
                                 throws JobExecutionException
This method will block before the calculation has completed and then return the object containing a job execution statistics

Returns:
Throws:
JobExecutionException

waitForResult

public ConfiguredExecutable<?> waitForResult()
                                      throws JobExecutionException
Description copied from interface: SyncExecutor
Call to this method block for as long as it is required for an executable to finish its job. If the calculation has been completed already, the this method returns results immediately. This could return the result directly, but that would be type unsafe

Specified by:
waitForResult in interface SyncExecutor
Returns:
object from wich the result can be obtained
Throws:
JobExecutionException

getJobStatus

public JobStatus getJobStatus()
Description copied from interface: SyncExecutor
Query the status of the job by its id.

Specified by:
getJobStatus in interface SyncExecutor
Returns:
- JobStatus

getInstance

public static JobRunner getInstance(ConfiguredExecutable<?> executable)
                             throws JobSubmissionException
Throws:
JobSubmissionException