@PublicAPI public abstract class Task extends CommonAttribute
addDependence(Task)
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Script<?> |
cScript
CleaningScript : can be used to launch script just after the task or the postScript (if set)
Started even if a problem occurs.
|
protected String |
description
Description of the task.
|
protected String |
flowBlock
block declaration : syntactic scopes used for workflows
string representation of a FlowBlock enum
|
protected FlowScript |
flowScript
FlowScript: Control Flow Action Script executed after the task,
returns a
FlowAction which will perform flow actions on the job |
protected ForkEnvironment |
forkEnvironment |
protected List<InputSelector> |
inputFiles
DataSpace inputFiles
|
protected String |
name
Name of the task.
|
protected List<OutputSelector> |
outputFiles
DataSpace outputFiles
|
protected ParallelEnvironment |
parallelEnvironment
The parallel environment of the task included number of nodes and topology definition
required to execute this task.
|
protected Script<?> |
postScript
PostScript : can be used to launch script just after the task
|
protected boolean |
preciousLogs
If true, the stdout/err of this tasks are stored in a file in LOCALSPACE and copied back to USERSPACE
|
protected boolean |
preciousResult
Tell whether this task has a precious result or not.
|
protected Script<?> |
preScript
PreScript : can be used to launch script just before the task
execution.
|
protected boolean |
runAsMe |
protected List<SelectionScript> |
sScripts
selection script : can be launched before getting a node in order to
verify some computer specificity.
|
protected String |
tag
tag of the task
|
protected Map<String,TaskVariable> |
variables
A map to hold task variables
|
protected long |
wallTime
maximum execution time of the task (in milliseconds), the variable is only valid if isWallTime is true
|
GENERIC_INFO_START_AT_KEY, genericInformation, maxNumberOfExecution, onTaskError, restartTaskOnError, unresolvedGenericInformation
Constructor and Description |
---|
Task() |
Modifier and Type | Method and Description |
---|---|
void |
addDependence(Task task)
Add a dependence to the task.
|
void |
addDependences(List<Task> tasks)
Same as the
addDependence(Task) method, but for a list of dependences. |
void |
addInputFiles(org.objectweb.proactive.extensions.dataspaces.vfs.selector.FileSelector files,
InputAccessMode mode)
Add the files value to the given files value
according to the provided access mode.
|
void |
addInputFiles(String filesToInclude,
InputAccessMode mode)
Add the files to the given filesToInclude value
according to the provided access mode.
|
void |
addOutputFiles(org.objectweb.proactive.extensions.dataspaces.vfs.selector.FileSelector files,
OutputAccessMode mode)
Add the files value to the given files value
according to the provided access mode.
|
void |
addOutputFiles(String filesToInclude,
OutputAccessMode mode)
Add the files to the given filesToInclude value
according to the provided access mode.
|
void |
addSelectionScript(SelectionScript selectionScript)
To add a selection script to the list of selection script.
|
String |
display() |
Script<?> |
getCleaningScript()
To get the cleaningScript of this task.
|
List<Task> |
getDependencesList()
To get the list of dependencies of the task.
|
String |
getDescription()
To get the description of this task.
|
FlowBlock |
getFlowBlock()
Defining Control Flow Blocks with pairs of
FlowBlock.START and FlowBlock.END
is a semantic requirement to be able to create specific control flow constructs. |
FlowScript |
getFlowScript()
To perform complex Control Flow Actions in a TaskFlowJob,
a FlowScript needs to be attached to specific tasks.
|
ForkEnvironment |
getForkEnvironment() |
List<InputSelector> |
getInputFilesList()
Get the input file selectors list.
|
String |
getName()
To get the name of this task.
|
int |
getNumberOfNodesNeeded()
Get the number of nodes needed for this task (by default: 1).
|
List<OutputSelector> |
getOutputFilesList()
Get the output file selectors list.
|
ParallelEnvironment |
getParallelEnvironment()
Returns the parallel environment of the task.
|
Script<?> |
getPostScript()
To get the postScript of this task.
|
Script<?> |
getPreScript()
To get the preScript of this task.
|
List<SelectionScript> |
getSelectionScripts()
To get the selection script.
|
String |
getTag()
Get the tag of this task.
|
Map<String,TaskVariable> |
getVariables()
Returns the variable map of this task.
|
Map<String,String> |
getVariablesOverriden(Job job)
Returns the variable map of this task.
|
long |
getWallTime() |
String |
getWorkingDir()
Return the working Directory.
|
boolean |
isParallel()
Checks if the task is parallel.
|
boolean |
isPreciousLogs()
To know if the logs of this task are precious.
|
boolean |
isPreciousResult()
To know if the result of this task is precious.
|
boolean |
isRunAsMe()
To know if the task will be executed under the user identity or not.
|
boolean |
isWallTimeSet()
Return true if wallTime is set.
|
void |
setCleaningScript(Script<?> cleaningScript)
To set the cleaningScript of this task.
|
void |
setDescription(String description)
To set the description of this task.
|
void |
setFlowBlock(FlowBlock fb)
Defining Control Flow Blocks using
FlowBlock.START and FlowBlock.END
is a semantic requirement to be able to create specific control flow constructs. |
void |
setFlowScript(FlowScript s)
To perform complex Control Flow Actions in a TaskFlowJob,
a FlowScript needs to be attached to specific tasks.
|
void |
setForkEnvironment(ForkEnvironment forkEnvironment) |
void |
setName(String name)
To set the name of this task.
|
void |
setNumberOfNeededNodes(int numberOfNodesNeeded)
Deprecated.
|
void |
setParallelEnvironment(ParallelEnvironment parallelEnvironment)
Sets new parallel environment of the task.
|
void |
setPostScript(Script<?> postScript)
To set the postScript of this task.
|
void |
setPreciousLogs(boolean preciousLogs)
Set if the logs of this task are precious.
|
void |
setPreciousResult(boolean preciousResult)
Set if the result of this task is precious.
|
void |
setPreScript(Script<?> preScript)
To set the preScript of this task.
|
void |
setRunAsMe(boolean runAsMe)
Set if this task will be run under user identity.
|
void |
setSelectionScript(SelectionScript selScript)
Set a selection script.
|
void |
setSelectionScripts(List<SelectionScript> selScriptsList)
Set a list of selection scripts.
|
void |
setTag(String tag)
Set the tag of this task.
|
void |
setVariables(Map<String,TaskVariable> variables)
Sets the variable map for this task.
|
void |
setWallTime(long walltime)
Set the wall time to the task in millisecond.
|
String |
toString() |
addGenericInformation, addGenericInformations, applyReplacementsOnGenericInformation, getGenericInformation, getMaxNumberOfExecution, getMaxNumberOfExecutionProperty, getOnTaskErrorProperty, getRestartTaskOnError, getRestartTaskOnErrorProperty, getUnresolvedGenericInformation, setGenericInformation, setMaxNumberOfExecution, setOnTaskError, setRestartTaskOnError, setUnresolvedGenericInformation
protected String name
protected String flowBlock
protected String description
protected String tag
protected List<InputSelector> inputFiles
protected List<OutputSelector> outputFiles
protected ParallelEnvironment parallelEnvironment
protected List<SelectionScript> sScripts
protected Script<?> preScript
protected Script<?> postScript
protected Script<?> cScript
protected FlowScript flowScript
FlowAction
which will perform flow actions on the jobprotected boolean preciousResult
protected boolean preciousLogs
protected boolean runAsMe
protected long wallTime
protected ForkEnvironment forkEnvironment
protected Map<String,TaskVariable> variables
public void addDependence(Task task)
In fact, it is in this order that you will get back the result in the children task.
For example: if you add to the task t3, the dependences t1 then t2, the parents of t3 will be t1 and t2 in this order and the parameters of t3 will be the results of t1 and t2 in this order.
task
- the parent task to add to this task.public void addDependences(List<Task> tasks)
addDependence(Task)
method, but for a list of dependences.tasks
- the parent list of tasks to add to this task.public String getDescription()
public void setDescription(String description)
description
- the description to set.public boolean isPreciousResult()
public void setPreciousResult(boolean preciousResult)
preciousResult
- true if the result of this task is precious, false if not.public boolean isPreciousLogs()
public void setPreciousLogs(boolean preciousLogs)
preciousLogs
- true if the logs of this task are precious, false if not.public boolean isRunAsMe()
public void setRunAsMe(boolean runAsMe)
runAsMe
- true if this task will be run under user identity.public String getName()
public void setName(String name)
name
- the name to set.public String getTag()
public void setTag(String tag)
tag
- tag valuepublic FlowBlock getFlowBlock()
FlowBlock.START
and FlowBlock.END
is a semantic requirement to be able to create specific control flow constructs.
Refer to the documentation for detailed instructions.
public void setFlowBlock(FlowBlock fb)
FlowBlock.START
and FlowBlock.END
is a semantic requirement to be able to create specific control flow constructs.
Refer to the documentation for detailed instructions.
fb
- the FlowBlock attribute of this task indicating if it is the beginning
or the ending of a new block scopepublic Script<?> getPreScript()
public void setPreScript(Script<?> preScript)
preScript
- the preScript to set.public Script<?> getPostScript()
public FlowScript getFlowScript()
Some Control Flow constructs need to be used within the bounds of
a FlowBlock
, which is defined a the level of the Task using
setFlowBlock(FlowBlock)
.
Refer to the user documentation for further instructions.
public void setFlowScript(FlowScript s)
Some Control Flow constructs need to be used within the bounds of
a FlowBlock
, which is defined a the level of the Task using
setFlowBlock(FlowBlock)
.
Refer to the user documentation for further instructions.
s
- the Control Flow Script used for workflow actionspublic void setPostScript(Script<?> postScript)
postScript
- the postScript to set.public Script<?> getCleaningScript()
public void setCleaningScript(Script<?> cleaningScript)
cleaningScript
- the cleaningScript to set.public boolean isParallel()
public ParallelEnvironment getParallelEnvironment()
public void setParallelEnvironment(ParallelEnvironment parallelEnvironment)
parallelEnvironment
- new parallel environment of the task.public List<SelectionScript> getSelectionScripts()
public void setSelectionScript(SelectionScript selScript)
public void setSelectionScripts(List<SelectionScript> selScriptsList)
public void addSelectionScript(SelectionScript selectionScript)
selectionScript
- the selectionScript to add.public List<Task> getDependencesList()
public int getNumberOfNodesNeeded()
public long getWallTime()
public String getWorkingDir()
public void setWallTime(long walltime)
walltime
- the walltime to set in millisecond.public boolean isWallTimeSet()
@Deprecated public void setNumberOfNeededNodes(int numberOfNodesNeeded)
This number represents the total number of nodes that you need. You may remember that default number is 1.
numberOfNodesNeeded
- the number Of Nodes Needed to set.public void addInputFiles(org.objectweb.proactive.extensions.dataspaces.vfs.selector.FileSelector files, InputAccessMode mode)
Mode define the way the files will be bring to LOCAL space.
files
- the input Files to addmode
- the way to provide files to LOCAL spacepublic void addOutputFiles(org.objectweb.proactive.extensions.dataspaces.vfs.selector.FileSelector files, OutputAccessMode mode)
Mode define the way the files will be send to OUTPUT space.
files
- the output Files to addmode
- the way to send files to OUTPUT spacepublic void addInputFiles(String filesToInclude, InputAccessMode mode)
Mode define the way the files will be bring to LOCAL space. filesToInclude can represent one file or many files defined by a regular expression.
filesToInclude
- the input files to addmode
- the way to provide files to LOCAL spacefor details
public void addOutputFiles(String filesToInclude, OutputAccessMode mode)
Mode define the way the files will be send to OUTPUT space. filesToInclude can represent one file or many files defined by a regular expression.
filesToInclude
- the output files to addmode
- the way to send files to OUTPUT spacefor details
public List<InputSelector> getInputFilesList()
public List<OutputSelector> getOutputFilesList()
public void setVariables(Map<String,TaskVariable> variables)
variables
- the variables mappublic Map<String,TaskVariable> getVariables()
public Map<String,String> getVariablesOverriden(Job job)
public String display()
public ForkEnvironment getForkEnvironment()
public void setForkEnvironment(ForkEnvironment forkEnvironment)