public class JobConfig extends AbstractLockable<JobConfig>
JobDefinition
instance has been created.
A single configuration instance can be used with multiple jobs.Modifier and Type | Class and Description |
---|---|
(package private) static class |
JobConfig.Priority
Used for converting between Open Grid priority values and
BASE priority values.
|
Modifier and Type | Field and Description |
---|---|
static JobConfig |
DEFAULT
A (locked) configuration instance with default
settings.
|
private boolean |
failImmediately |
private java.lang.Integer |
priority |
private boolean |
privateFiles |
private java.util.Map<java.lang.String,java.lang.String> |
qsubOptions |
Constructor and Description |
---|
JobConfig()
Create a new job configuration instance with default settings.
|
Modifier and Type | Method and Description |
---|---|
void |
appendQsubOptionsToScript(java.lang.StringBuilder script,
java.util.Set<java.lang.String> ignore)
Add all qsub options in this configuration to the script.
|
static int |
basePriorityToOpenGridPriority(java.lang.Integer priority)
Convert a BASE job priority value to an Open Grid job priority value.
1-4 → 1024 -- 1
5 or missing → 0
6-10 → -1 -- -1023
|
protected void |
checkValid(boolean forLock)
The priority must be between -1023 and +1024.
|
int |
getBASEPriority()
Shortcut for calling
openGridPriorityToBasePriority(Integer) . |
boolean |
getCreatePrivateFiles() |
boolean |
getFailImmediately() |
java.lang.Integer |
getPriority() |
java.lang.String |
getQsubOption(java.lang.String option)
Get the value of a qsub option.
|
java.util.Map<java.lang.String,java.lang.String> |
getQsubOptions()
Get all options that has been specified for qsub so far.
|
static int |
openGridPriorityToBasePriority(java.lang.Integer priority)
Convert an Open Grid job priority value to a BASE job
priority value.
1024 -- 1 → 1 -- 4
0 or missing → 5
-1 -- -1023 → 6 -- 10
|
void |
setCreatePrivateFiles(boolean privateFiles)
Set this option to automatically include
a "umask" command that makes all files created
by the job script private (eg, umask u=rwx,g=,o=)
This is on by default.
|
void |
setFailImmediately(boolean failImmediately)
Set this option if the job script should exit as soon as an
error is encountered.
|
void |
setPriority(java.lang.Integer priority)
Set the priority of the job.
|
void |
setQsubOption(java.lang.String option,
java.lang.String value)
Set an option for the 'qsub' command.
|
checkLocked, isLocked, isValid, lock
public static final JobConfig DEFAULT
private boolean failImmediately
private boolean privateFiles
private java.lang.Integer priority
private java.util.Map<java.lang.String,java.lang.String> qsubOptions
public JobConfig()
public static int openGridPriorityToBasePriority(java.lang.Integer priority)
public static int basePriorityToOpenGridPriority(java.lang.Integer priority)
public void setFailImmediately(boolean failImmediately)
public boolean getFailImmediately()
public void setCreatePrivateFiles(boolean privateFiles)
public boolean getCreatePrivateFiles()
public void setPriority(java.lang.Integer priority)
public java.lang.Integer getPriority()
public int getBASEPriority()
openGridPriorityToBasePriority(Integer)
.public void setQsubOption(java.lang.String option, java.lang.String value)
option
- The name of the option (with or without the hyphen)value
- The value of the option (null will remove it)public java.lang.String getQsubOption(java.lang.String option)
option
- The name of the option (with or without the hyphen)public java.util.Map<java.lang.String,java.lang.String> getQsubOptions()
public void appendQsubOptionsToScript(java.lang.StringBuilder script, java.util.Set<java.lang.String> ignore)
protected void checkValid(boolean forLock)
checkValid
in class AbstractLockable<JobConfig>
forLock
- If TRUE, the instance will be locked after validation