public class JobDefinition
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
JobDefinition.UploadSourceWithPermission
Class for storing a file and a permission as one
entity.
|
Modifier and Type | Field and Description |
---|---|
private Job |
baseJob |
private java.lang.String |
cmd |
private JobConfig |
config |
private boolean |
debug |
private java.util.List<JobDefinition.UploadSourceWithPermission> |
filesToUpload |
private static java.util.Set<java.lang.String> |
ignoredQsubOptions |
private java.lang.String |
name |
Constructor and Description |
---|
JobDefinition(java.lang.String namePrefix,
JobConfig config)
Create a new job definition that is not connected to a
BASE job item.
|
JobDefinition(java.lang.String namePrefix,
JobConfig config,
Job baseJob)
Create a new job definition that is connected to a BASE job.
|
Modifier and Type | Method and Description |
---|---|
void |
addFile(UploadSource file) |
void |
addFile(UploadSource file,
FilePermission permission)
Register a file that should be uploaded to the cluster as part
of this job.
|
java.lang.String |
asJobScript(java.lang.String workFolder,
java.lang.String tmpFolder)
Generate a script for this job that fits what
'qsub' expects.
|
Job |
getBaseJob()
Get the BASE job that this job definition is connected with.
|
java.lang.String |
getCmd() |
JobConfig |
getConfig()
Get the configuration settings for this job.
|
boolean |
getDebug() |
java.util.List<JobDefinition.UploadSourceWithPermission> |
getFiles()
Get all files that should be uploaded to the cluster as part
of this job.
|
java.lang.String |
getName()
Get the name of this job definition.
|
void |
setCmd(java.lang.String cmd)
Set the command/bash script to execute as part of this job.
|
void |
setDebug(boolean debug)
Set the debug flag.
|
private static final java.util.Set<java.lang.String> ignoredQsubOptions
private final java.lang.String name
private final JobConfig config
private final Job baseJob
private java.lang.String cmd
private boolean debug
private final java.util.List<JobDefinition.UploadSourceWithPermission> filesToUpload
public JobDefinition(java.lang.String namePrefix, JobConfig config)
namePrefix
- A prefix for the job name. Checked with
OpenGrid.checkValidFilename(String)
public JobDefinition(java.lang.String namePrefix, JobConfig config, Job baseJob)
namePrefix
- A prefix for the job name. Checked with
OpenGrid.checkValidFilename(String)
config
- Configuration settings for the job, or null
to use JobConfig.DEFAULT
baseJob
- Optional BASE Job
item that is a
representation of the job on the clusterpublic java.lang.String getName()
public JobConfig getConfig()
public Job getBaseJob()
public void setCmd(java.lang.String cmd)
public java.lang.String getCmd()
public void setDebug(boolean debug)
ClusterConfig.getTmpFolder(boolean)
public boolean getDebug()
public void addFile(UploadSource file)
addFile(UploadSource, FilePermission)
public void addFile(UploadSource file, FilePermission permission)
UploadSource.getName()
. The actual
upload of the file is done as part of registering the job with
an Open Grid cluster. See OpenGridSession.qsub(DbControl, List)
.file
- The file to uploadpermission
- The permission to give to the file
(FilePermission.USER_RW
is used as default)public java.util.List<JobDefinition.UploadSourceWithPermission> getFiles()
public java.lang.String asJobScript(java.lang.String workFolder, java.lang.String tmpFolder)