public class JobDescription extends Object
Modifier and Type | Field and Description |
---|---|
private List<String> |
arguments |
private boolean |
deleteSandbox |
private Map<String,String> |
environment |
private String |
executable |
private int |
maxTime |
private int |
nodeCount |
private boolean |
offlineMode |
private Map<Path,Path> |
postStagedFiles |
private Map<Path,Path> |
preStagedFiles |
private int |
processesPerNode |
private String |
queueName |
private Path |
stderr |
private Path |
stdin |
private Path |
stdout |
private boolean |
wipeSandbox |
Constructor and Description |
---|
JobDescription() |
Modifier and Type | Method and Description |
---|---|
void |
addPostStagedFiles(Path src)
Add a single post stage file.
|
void |
addPostStagedFiles(Path src,
Path dest)
Add a single post stage file that should be post staged to the given
destination.
|
void |
addPreStagedFile(Path src)
Add a single pre stage file.
|
void |
addPreStagedFile(Path src,
Path dest)
Add a single pre stage file that should be pre staged to the given
destination.
|
boolean |
deleteSandbox() |
List<String> |
getArguments()
Returns the arguments of the executable.
|
Map<String,String> |
getEnvironment()
Returns the environment of the executable.
|
String |
getExecutable()
Returns the path to the executable.
|
int |
getMaxTime() |
int |
getNodeCount()
Get the number of nodes.
|
Map<Path,Path> |
getPostStagedFiles()
Returns the post stage file set.
|
Map<Path,Path> |
getPreStagedFiles()
Returns the pre staged file set.
|
int |
getProcessesPerNode()
Get the number of processes started on each node.
|
String |
getQueueName() |
Path |
getStderr()
Returns the stderr
Path . |
Path |
getStdin()
Returns the stdin
Path . |
Path |
getStdout()
Returns the stdout
Path . |
boolean |
offlineMode() |
void |
setArguments(String... arguments)
Sets the arguments of the executable.
|
void |
setDeleteSandbox(boolean deleteSandbox) |
void |
setEnvironment(Map<String,String> environment)
Sets the environment of the executable.
|
void |
setExecutable(String executable)
Sets the path to the executable.
|
void |
setMaxTime(int maxTime) |
void |
setNodeCount(int resourceCount)
Set the number of resources, which is the total number of resources where
the number of processes should be distributed on.
|
void |
setOfflineMode(boolean offlineMode) |
void |
setPostStagedFiles(Path... files)
Sets the post staged file set.
|
void |
setPreStagedFiles(Path... files)
Sets the pre staged file set.
|
void |
setProcessesPerNode(int ppn)
Get the number of processes started on each node.
|
void |
setQueueName(String queueName) |
void |
setStderr(Path stderr)
Sets the stderr
Path . |
void |
setStdin(Path stdin)
Sets the
Path where stdin is redirected from. |
void |
setStdout(Path stdout)
Sets the stdout
Path . |
void |
setWipeSandbox(boolean wipeSandbox)
Sets the wipe sandbox flag.
|
String |
toString() |
boolean |
wipeSandbox() |
private int nodeCount
private int processesPerNode
private String queueName
private int maxTime
private String executable
private Path stdin
private Path stdout
private Path stderr
private boolean deleteSandbox
private boolean wipeSandbox
private boolean offlineMode
public int getNodeCount()
public void setNodeCount(int resourceCount)
resourceCount
- the number of resourcespublic int getProcessesPerNode()
public void setProcessesPerNode(int ppn)
ppn
- the number of processespublic String getQueueName()
public void setQueueName(String queueName)
public int getMaxTime()
public void setMaxTime(int maxTime)
public String getExecutable()
"/bin/cat hello world > out"
it will return a String
"/bin/cat".public void setExecutable(String executable)
"/bin/cat hello world > out"
the String
"/bin/cat"
should be provided.executable
- The path to the executable.public List<String> getArguments()
"/bin/cat hello world > out"
it will return a String
[]{"hello", "world", ">", "out"}public void setArguments(String... arguments)
"/bin/cat hello world"
the String
[]{"hello",
"world"} contains the arguments.arguments
- The commandline arguments to set.public Map<String,String> getEnvironment()
Map
of environment variables with their
values (for instance the key, value pair "JAVA_HOME", "/path/to/java").public void setEnvironment(Map<String,String> environment)
Map
of environment variables with their values (for
instance the key, value pair "JAVA_HOME", "/path/to/java").environment
- The environment to set.public void setStdin(Path stdin)
Path
where stdin is redirected from.stdin
- The Path
where stdin is redirected from.public void setStdout(Path stdout)
Path
. Note that stdout will be redirected to
either a Path
or a OutputStream
. The last invocation of
setStdout()
determines whether the destination of the
output.stdout
- The Path
where stdout is redirected to.public void setStderr(Path stderr)
Path
. Note that stderr will be redirected to
either a Path
or a OutputStream
. The last invocation of
setStderr()
determines whether the destination of the
output.stderr
- The Path
where stderr is redirected to.public Map<Path,Path> getPreStagedFiles()
Map
with the source
Path
s as keys and the destination Path
s as values. This
method returns the files that should be pre staged regardless of whether
they are already pre staged or not.public void setPreStagedFiles(Path... files)
Path
s can be added using the addPreStagedPath
methods. See these methods for a table stating at which locations the
Path
s will end up after the pre staging.files
- An array of files that should be pre staged.public void addPreStagedFile(Path src)
addPreStagedPath(src, null)
.src
- the file that should be pre staged.public void addPreStagedFile(Path src, Path dest)
source file | destination file | location after pre staging |
---|---|---|
path/to/file
| null
| sandbox/file
|
path/to/file
| other/path/to/file
| sandbox/other/path/to/file
|
path/to/file
| /other/path/to/file
| /other/path/to/file
|
/path/to/file
| null
| sandbox/file
|
/path/to/file
| other/path/to/file
| sandbox/other/path/to/file
|
/path/to/file
| /other/path/to/file
| /other/path/to/file
|
public Map<Path,Path> getPostStagedFiles()
Path
s are the source
files on the execution site, the values are the Path
s with the
destination of the post staging. This method returns the files that
should be post staged regardless of whether they are already post staged
or not.public void setPostStagedFiles(Path... files)
Path
s can be added using the addPostStagedPath
methods. See these methods for a table stating at which locations the
Path
s will end up after the post staging.files
- An array of files that should be pre staged.public void addPostStagedFiles(Path src)
addPostStagedPath(src, null)
.src
- the file that should be post staged.public void addPostStagedFiles(Path src, Path dest)
source file | destination file | location after post staging |
---|---|---|
path/to/file
| null
| cwd/file
|
path/to/file
| other/path/to/file
| cwd/other/path/to/file
|
path/to/file
| /other/path/to/file
| /other/path/to/file
|
/path/to/file
| null
| cwd/file
|
/path/to/file
| other/path/to/file
| cwd/other/path/to/file
|
/path/to/file
| /other/path/to/file
| /other/path/to/file
|
public boolean deleteSandbox()
public void setDeleteSandbox(boolean deleteSandbox)
public boolean wipeSandbox()
public void setWipeSandbox(boolean wipeSandbox)
public boolean offlineMode()
public void setOfflineMode(boolean offlineMode)