@PublicAPI public abstract class TaskState extends Task implements Comparable<TaskState>
Modifier and Type | Field and Description |
---|---|
static int |
ASC_ORDER |
static Comparator<TaskState> |
COMPARE_BY_FINISHED_TIME_ASC |
protected static int |
currentOrder |
protected static int |
currentSort |
static int |
DESC_ORDER |
static int |
SORT_BY_DESCRIPTION |
static int |
SORT_BY_EXEC_DURATION |
static int |
SORT_BY_EXECUTIONLEFT |
static int |
SORT_BY_EXECUTIONONFAILURELEFT |
static int |
SORT_BY_FINISHED_TIME |
static int |
SORT_BY_HOST_NAME |
static int |
SORT_BY_ID
Sorting constant, this will allow the user to sort the descriptor.
|
static int |
SORT_BY_NAME |
static int |
SORT_BY_STARTED_TIME |
static int |
SORT_BY_STATUS |
cScript, description, flowBlock, flowScript, fork, forkEnvironment, inputFiles, name, outputFiles, parallelEnvironment, postScript, preciousLogs, preciousResult, preScript, runAsMe, sScripts, tag, variables, wallTime
DEFAULT_TASK_RETRY_DELAY, GENERIC_INFO_START_AT_KEY, genericInformation, maxNumberOfExecution, onTaskError, restartTaskOnError, taskRetryDelay, unresolvedGenericInformation
Constructor and Description |
---|
TaskState()
ProActive default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDependence(Task task)
If the Task was submitted, a call to this method will throw a
RuntimeException.
|
void |
addDependences(List<Task> tasks)
If the Task was submitted, a call to this method will throw a
RuntimeException.
|
int |
compareTo(TaskState task) |
boolean |
equals(Object obj) |
abstract List<TaskState> |
getDependences()
To get the dependences of this task.
|
List<Task> |
getDependencesList()
If the Task was submitted, a call to this method will throw a
RuntimeException.
|
long |
getExecutionDuration()
Get the real task duration in millis.
|
String |
getExecutionHostName()
Get the last execution HostName of the task.
|
String[] |
getExecutionHostNameList()
To get the list of execution hosts name.
|
long |
getFinishedTime()
To get the finishedTime
|
TaskId |
getId()
To get the taskId
|
abstract int |
getIterationIndex()
When Control Flow actions are performed (see
Task.getFlowScript() ),
some tasks are replicated. |
JobId |
getJobId()
To get the jobID
|
abstract int |
getMaxNumberOfExecutionOnFailure()
Get the number of execution on failure allowed by the task.
|
String |
getName()
To get the name of this task.
|
int |
getNumberOfExecutionLeft()
Get the number of execution left.
|
int |
getNumberOfExecutionOnFailureLeft()
Get the numberOfExecutionOnFailureLeft value.
|
int |
getProgress()
Return the latest progress value for this task.
|
abstract int |
getReplicationIndex()
When Control Flow actions are performed (see
Task.getFlowScript() ),
some tasks are replicated. |
Map<String,String> |
getRuntimeGenericInformation()
Returns a map of generic information, with replacement done from the runtime variables map
|
Map<String,Serializable> |
getRuntimeVariables()
Returns a map containing both scope variables and system variables
|
long |
getScheduledTime()
To get the scheduledTime
|
Map<String,Serializable> |
getScopeVariables()
Returns a map containing all scope variables defined in this Task (i.e.
|
long |
getStartTime()
To get the startTime
|
TaskStatus |
getStatus()
To get the status of this task
|
Map<String,Serializable> |
getSystemVariables()
Returns a map containing all variables defined by the system for this task, such as PA_JOB_ID, PA_USER, etc.
|
abstract TaskInfo |
getTaskInfo()
To get the taskInfo
|
int |
hashCode() |
boolean |
isTaskAlive()
Returns true if the task is alive (a task is alive when it's waiting to be executed or being executed
|
abstract TaskState |
replicate()
Replicates a task
|
static void |
setSortingBy(int sortBy)
Set the field to sort on.
|
static void |
setSortingOrder(int order)
Set the order for the next sort.
|
String |
toString() |
abstract void |
update(TaskInfo taskInfo)
To update this taskState using a taskInfo
|
addInputFiles, addInputFiles, addOutputFiles, addOutputFiles, addSelectionScript, display, getCleaningScript, getDescription, getFlowBlock, getFlowScript, getForkEnvironment, getInputFilesList, getNumberOfNodesNeeded, getOutputFilesList, getParallelEnvironment, getPostScript, getPreScript, getSelectionScripts, getTag, getUnresolvedVariables, getVariables, getVariablesOverriden, getWallTime, getWorkingDir, isFork, isParallel, isPreciousLogs, isPreciousResult, isRunAsMe, isWallTimeSet, setCleaningScript, setDescription, setFlowBlock, setFlowScript, setFork, setForkEnvironment, setName, setNumberOfNeededNodes, setParallelEnvironment, setPostScript, setPreciousLogs, setPreciousResult, setPreScript, setRunAsMe, setSelectionScript, setSelectionScripts, setTag, setUnresolvedVariables, setVariables, setWallTime, verifyVariableMap
addGenericInformation, addGenericInformations, applyReplacementsOnGenericInformation, getGenericInformation, getMaxNumberOfExecution, getMaxNumberOfExecutionProperty, getOnTaskErrorProperty, getRestartTaskOnError, getRestartTaskOnErrorProperty, getTaskRetryDelay, getTaskRetryDelayProperty, getUnresolvedGenericInformation, setGenericInformation, setMaxNumberOfExecution, setOnTaskError, setRestartTaskOnError, setTaskRetryDelay, setUnresolvedGenericInformation
public static final int SORT_BY_ID
public static final int SORT_BY_NAME
public static final int SORT_BY_STATUS
public static final int SORT_BY_DESCRIPTION
public static final int SORT_BY_EXECUTIONLEFT
public static final int SORT_BY_EXECUTIONONFAILURELEFT
public static final int SORT_BY_STARTED_TIME
public static final int SORT_BY_FINISHED_TIME
public static final int SORT_BY_HOST_NAME
public static final int SORT_BY_EXEC_DURATION
public static final int ASC_ORDER
public static final int DESC_ORDER
protected static int currentSort
protected static int currentOrder
public static final Comparator<TaskState> COMPARE_BY_FINISHED_TIME_ASC
public abstract void update(TaskInfo taskInfo)
taskInfo
- the taskInfo to setpublic abstract List<TaskState> getDependences()
public List<Task> getDependencesList()
getDependences()
getDependencesList
in class Task
public void addDependence(Task task)
addDependence
in class Task
task
- the parent task to add to this task.IllegalStateException
- if this task was already submitted to the schedulerpublic void addDependences(List<Task> tasks)
addDependences
in class Task
tasks
- the parent tasks to add to this task.IllegalStateException
- if this task was already submitted to the schedulerpublic static void setSortingBy(int sortBy)
sortBy
- the field on which the sort will be made.public static void setSortingOrder(int order)
order
- ASC_ORDER or DESC_ORDERpublic int compareTo(TaskState task)
compareTo
in interface Comparable<TaskState>
Comparable.compareTo(java.lang.Object)
public abstract TaskInfo getTaskInfo()
public boolean isTaskAlive()
public long getFinishedTime()
public JobId getJobId()
public long getStartTime()
public long getScheduledTime()
public TaskId getId()
public TaskStatus getStatus()
public int getProgress()
public String getExecutionHostName()
public String[] getExecutionHostNameList()
public int getNumberOfExecutionLeft()
public int getNumberOfExecutionOnFailureLeft()
public long getExecutionDuration()
public abstract int getMaxNumberOfExecutionOnFailure()
public String getName()
Task
getName
in class Task
Task.getName()
public String toString()
toString
in class Task
Object.toString()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public abstract TaskState replicate() throws Exception
Deep copies all fields, does not share any reference
Exception
public abstract int getIterationIndex()
Task.getFlowScript()
),
some tasks are replicated.
A task replicated by a FlowActionType.LOOP
action
is differentiated from the original by an incremented Iteration Index.>= 0
)public abstract int getReplicationIndex()
Task.getFlowScript()
),
some tasks are replicated.
A task replicated by a FlowActionType.REPLICATE
action
is differentiated from the original by an incremented Replication Index.>= 0
)public Map<String,Serializable> getScopeVariables()
public Map<String,Serializable> getSystemVariables()
public Map<String,Serializable> getRuntimeVariables()