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 enum
The TaskStatusForRunning enum represents the possible statuses of a task while it is running. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns 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.long
Returns the finish time of this task.long
Returns the getting time of this task.Gets the IP address of the host machine executing this task.getID()
Gets the ID of this task.int
getIndex()
Returns the index of this task.long
Returns the launch time of this task.int
Returns the partition of this task.int
Returns the ID of the stage to which this task belongs.long
Returns the ID of this task.Returns theTaskMetric
associated with this task.boolean
Returns the status of this task.Returns the status of this task.Returns the current task status for running.void
setDurationTime
(long time) Sets the duration time of this task.void
setEventame
(String name) Sets the name of the event associated with this task.void
setFinishTime
(long time) Sets the finish time of this task.void
setGettingTime
(long time) Sets the getting time of this task.void
Sets the IP address of the host machine executing this task.void
Sets the ID of this task.void
setIndex
(int index) Sets the index of this task.void
setLaunchTime
(long time) Sets the launch time of this task.void
setPartition
(int partition) Sets the partition of this task.void
setStageID
(int id) Sets the ID of the stage to which this task belongs.void
setStringExecutorID
(String executorID) Sets the ID of the executor assigned to this task.void
setTaskID
(long taskId) Sets the ID of this task.void
setTaskMetric
(TaskMetric taskMetric) Sets theTaskMetric
associated with this task.void
setTaskStatus
(boolean status) Sets the status of this task.void
setTaskStatus
(String status) Sets the status of this task.void
setTaskStatusForRunning
(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.TaskStatusForRunning
status to be set for the task
-
getTaskStatusForRunning
Task.TaskStatusForRunning getTaskStatusForRunning()Returns the current task status for running.- Returns:
- the
Task.TaskStatusForRunning
status of the task
-
getTaskMetric
TaskMetric getTaskMetric()Returns theTaskMetric
associated with this task.- Returns:
- the
TaskMetric
of the task
-
setTaskMetric
Sets theTaskMetric
associated with this task.- Parameters:
taskMetric
- theTaskMetric
to be set for the task
-