public class JobRunner extends java.lang.Object implements SyncExecutor
Modifier and Type | Field and Description |
---|---|
(package private) static ClusterSession |
clustSession |
(package private) ConfiguredExecutable<?> |
confExecutable |
(package private) java.lang.String |
jobId |
(package private) org.ggf.drmaa.JobTemplate |
jobtempl |
(package private) static org.apache.log4j.Logger |
log |
(package private) static org.ggf.drmaa.Session |
session |
private java.lang.String |
workDirectory |
Constructor and Description |
---|
JobRunner(ConfiguredExecutable<?> confExec) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancelJob()
Stops running job.
|
(package private) boolean |
cancelJob(java.lang.String jobId) |
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.
|
(package private) static JobStatus |
getJobStatus(java.lang.String jobId)
This will never return clust.engine.JobStatus.CANCELLED as for sun grid
engine cancelled job is the same as failed.
|
(package private) static JobStatus |
getRecordedJobStatus(java.lang.String jobId) |
java.lang.String |
getWorkDirectory() |
private static java.lang.String |
makeLocalPath(java.lang.String path) |
(package private) void |
setEmail(java.lang.String email) |
(package private) void |
setJobEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> env_variables) |
(package private) void |
setJobName(java.lang.String name) |
(package private) void |
setNativeSpecs(Executable<?> executable) |
(package private) void |
setPipes(ConfiguredExecutable<?> executable) |
(package private) java.lang.String |
submitJob() |
(package private) org.ggf.drmaa.JobInfo |
waitForJob(java.lang.String jobId) |
ConfiguredExecutable<?> |
waitForResult()
Call to this method block for as long as it is required for an executable to finish its job.
|
final org.ggf.drmaa.JobTemplate jobtempl
static ClusterSession clustSession
static org.ggf.drmaa.Session session
static final org.apache.log4j.Logger log
final ConfiguredExecutable<?> confExecutable
private final java.lang.String workDirectory
java.lang.String jobId
public JobRunner(ConfiguredExecutable<?> confExec) throws JobSubmissionException
JobSubmissionException
void setPipes(ConfiguredExecutable<?> executable) throws org.ggf.drmaa.DrmaaException
org.ggf.drmaa.DrmaaException
void setNativeSpecs(Executable<?> executable) throws org.ggf.drmaa.DrmaaException
org.ggf.drmaa.DrmaaException
void setEmail(java.lang.String email)
void setJobName(java.lang.String name)
void setJobEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> env_variables)
private static java.lang.String makeLocalPath(java.lang.String path)
public boolean deepClean()
static JobStatus getJobStatus(java.lang.String jobId)
static JobStatus getRecordedJobStatus(java.lang.String jobId)
public boolean cleanup()
SyncExecutor
cleanup
in interface SyncExecutor
org.ggf.drmaa.JobInfo waitForJob(java.lang.String jobId) throws JobExecutionException
JobExecutionException
boolean cancelJob(java.lang.String jobId)
public boolean cancelJob()
SyncExecutor
cancelJob
in interface SyncExecutor
java.lang.String submitJob() throws JobSubmissionException
JobSubmissionException
public java.lang.String getWorkDirectory()
getWorkDirectory
in interface SyncExecutor
public void executeJob() throws JobSubmissionException
SyncExecutor
executeJob
in interface SyncExecutor
JobSubmissionException
- if submission failspublic org.ggf.drmaa.JobInfo getJobInfo() throws JobExecutionException
JobExecutionException
public ConfiguredExecutable<?> waitForResult() throws JobExecutionException
SyncExecutor
waitForResult
in interface SyncExecutor
JobExecutionException
public JobStatus getJobStatus()
SyncExecutor
getJobStatus
in interface SyncExecutor
public static JobRunner getInstance(ConfiguredExecutable<?> executable) throws JobSubmissionException
JobSubmissionException