Interface Task
- All Superinterfaces:
Serializable,SerializableObject
- All Known Implementing Classes:
TaskEnd,TaskGettingResult,TaskStart
The Task interface represents a task in a distributed computing or data processing system.
This interface extends the SerializableObject interface and defines the methods that should be implemented by a task in order to properly function in such a system.
The Task interface provides methods for setting and getting various properties of a task, including its ID, status, and execution metrics.
The Task interface also includes an enum for representing the status of a task while it is running.
- Author:
- [Adeel Aslam]
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe TaskStatusForRunning enum represents the possible statuses of a task while it is running. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the duration time of this task.Gets the name of the event associated with this task.Returns the ID of the executor assigned to this task.longReturns the finish time of this task.longReturns the getting time of this task.Gets the IP address of the host machine executing this task.getID()Gets the ID of this task.intgetIndex()Returns the index of this task.longReturns the launch time of this task.intReturns the partition of this task.intReturns the ID of the stage to which this task belongs.longReturns the ID of this task.Returns theTaskMetricassociated with this task.booleanReturns the status of this task.Returns the status of this task.Returns the current task status for running.voidsetDurationTime(long time) Sets the duration time of this task.voidsetEventame(String name) Sets the name of the event associated with this task.voidsetFinishTime(long time) Sets the finish time of this task.voidsetGettingTime(long time) Sets the getting time of this task.voidSets the IP address of the host machine executing this task.voidSets the ID of this task.voidsetIndex(int index) Sets the index of this task.voidsetLaunchTime(long time) Sets the launch time of this task.voidsetPartition(int partition) Sets the partition of this task.voidsetStageID(int id) Sets the ID of the stage to which this task belongs.voidsetStringExecutorID(String executorID) Sets the ID of the executor assigned to this task.voidsetTaskID(long taskId) Sets the ID of this task.voidsetTaskMetric(TaskMetric taskMetric) Sets theTaskMetricassociated with this task.voidsetTaskStatus(boolean status) Sets the status of this task.voidsetTaskStatus(String status) Sets the status of this task.voidsetTaskStatusForRunning(Task.TaskStatusForRunning taskStatusForRunning) Sets the task status for running.
-
Method Details
-
setEventame
Sets the name of the event associated with this task.- Parameters:
name- the name of the event
-
getEventName
String getEventName()Gets the name of the event associated with this task.- Returns:
- the name of the event
-
setID
Sets the ID of this task.- Parameters:
id- the task ID
-
getID
String getID()Gets the ID of this task.- Returns:
- the task ID
-
setHostIP
Sets the IP address of the host machine executing this task.- Parameters:
Ip- the IP address of the host machine
-
getHostIP
String getHostIP()Gets the IP address of the host machine executing this task.- Returns:
- the IP address of the host machine
-
setTaskID
void setTaskID(long taskId) Sets the ID of this task.- Parameters:
taskId- the ID of this task
-
setStageID
void setStageID(int id) Sets the ID of the stage to which this task belongs.- Parameters:
id- the ID of the stage to which this task belongs
-
getStageID
int getStageID()Returns the ID of the stage to which this task belongs.- Returns:
- the ID of the stage to which this task belongs
-
getTaskID
long getTaskID()Returns the ID of this task.- Returns:
- the ID of this task
-
setStringExecutorID
Sets the ID of the executor assigned to this task.- Parameters:
executorID- the ID of the executor assigned to this task
-
getExecutorID
String getExecutorID()Returns the ID of the executor assigned to this task.- Returns:
- the ID of the executor assigned to this task
-
setTaskStatus
Sets the status of this task.- Parameters:
status- the status of this task
-
getTaskStatus
String getTaskStatus()Returns the status of this task.- Returns:
- the status of this task
-
setIndex
void setIndex(int index) Sets the index of this task.- Parameters:
index- the index of this task
-
getIndex
int getIndex()Returns the index of this task.- Returns:
- the index of this task
-
setPartition
void setPartition(int partition) Sets the partition of this task.- Parameters:
partition- the partition of this task
-
getPartition
int getPartition()Returns the partition of this task.- Returns:
- the partition of this task
-
setLaunchTime
void setLaunchTime(long time) Sets the launch time of this task.- Parameters:
time- the launch time of this task
-
getLaunchTime
long getLaunchTime()Returns the launch time of this task.- Returns:
- the launch time of this task
-
setFinishTime
void setFinishTime(long time) Sets the finish time of this task.- Parameters:
time- the finish time of this task
-
getFinishTime
long getFinishTime()Returns the finish time of this task.- Returns:
- the finish time of this task
-
setGettingTime
void setGettingTime(long time) Sets the getting time of this task.- Parameters:
time- the getting time of this task
-
getGettingTime
long getGettingTime()Returns the getting time of this task.- Returns:
- the getting time of this task
-
setDurationTime
void setDurationTime(long time) Sets the duration time of this task.- Parameters:
time- the duration time of this task
-
getDurationTime
long getDurationTime()Returns the duration time of this task.- Returns:
- the duration time of this task
-
setTaskStatus
void setTaskStatus(boolean status) Sets the status of this task.- Parameters:
status- the status of this task
-
getTaskSatus
boolean getTaskSatus()Returns the status of this task.- Returns:
- the status of this task
-
setTaskStatusForRunning
Sets the task status for running.- Parameters:
taskStatusForRunning- theTask.TaskStatusForRunningstatus to be set for the task
-
getTaskStatusForRunning
Task.TaskStatusForRunning getTaskStatusForRunning()Returns the current task status for running.- Returns:
- the
Task.TaskStatusForRunningstatus of the task
-
getTaskMetric
TaskMetric getTaskMetric()Returns theTaskMetricassociated with this task.- Returns:
- the
TaskMetricof the task
-
setTaskMetric
Sets theTaskMetricassociated with this task.- Parameters:
taskMetric- theTaskMetricto be set for the task
-