Class TaskStatus
java.lang.Object
org.apache.hadoop.applications.mawo.server.common.TaskStatus
- All Implemented Interfaces:
Cloneable,org.apache.hadoop.io.Writable
Defines TaskStatus for MaWo app.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTask status constructor.TaskStatus(WorkerId localworkerId, TaskId localtaskId, String localtaskCMD, String localtaskType) Task status constructor with workerId, TaskId, TaskCmd, TaskType.TaskStatus(WorkerId localworkerId, TaskId localtaskId, TaskStatus.State localrunState, String localtaskCMD, String localtaskType) Task status constructor with workerId, TaskId, TaskCmd, TaskType and Run State. -
Method Summary
Modifier and TypeMethodDescriptionprotected Objectclone()booleanfinal longGet task end time.final intGet exitcode of a Task.final TaskStatus.StateGet status of a Task.final longGet starttime of a Task.final StringGet Task cmd of a Task.final TaskIdGet Task Id.final TaskStatus.StategetTaskState(TaskId localtaskId) Get Task status of a Task.final StringGet Task Type.final WorkerIdGet workerId.inthashCode()final voidreadFields(DataInput dataInput) final voidSet task end time to current time.final voidsetExitCode(int localexitCode) Set exitcode of a Task.final voidsetRunState(TaskStatus.State localrunState) Update status of a Task.final voidSet current time as start time of a Task.final voidsetTaskCMD(String localcmd) Set Task cmd of a Task.final voidSet TaskId.final voidsetTaskState(TaskId localtaskId, TaskStatus.State localrunState) Set staus of a Task.final voidsetTaskType(String localtaskType) Set Task Type.final voidsetWorkerId(WorkerId localworkerId) Set WorkerId.final voidwrite(DataOutput dataOutput)
-
Constructor Details
-
TaskStatus
public TaskStatus()Task status constructor. -
TaskStatus
public TaskStatus(WorkerId localworkerId, TaskId localtaskId, String localtaskCMD, String localtaskType) Task status constructor with workerId, TaskId, TaskCmd, TaskType.- Parameters:
localworkerId- : Worker IDlocaltaskId- : Task IDlocaltaskCMD- : Task command linelocaltaskType- : Type of Task
-
TaskStatus
public TaskStatus(WorkerId localworkerId, TaskId localtaskId, TaskStatus.State localrunState, String localtaskCMD, String localtaskType) Task status constructor with workerId, TaskId, TaskCmd, TaskType and Run State.- Parameters:
localworkerId- : Worker IdlocaltaskId- : Task IdlocalrunState- : Task run StatelocaltaskCMD- : Task cmdlocaltaskType- : Task type
-
-
Method Details
-
getRunState
Get status of a Task.- Returns:
- Status of a Task
-
setRunState
Update status of a Task.- Parameters:
localrunState- : Status of a Task
-
setExitCode
public final void setExitCode(int localexitCode) Set exitcode of a Task.- Parameters:
localexitCode- : Exitcode of a Task
-
getExitCode
public final int getExitCode()Get exitcode of a Task.- Returns:
- exitCode of Task
-
setTaskCMD
Set Task cmd of a Task.- Parameters:
localcmd- : command line which need to be executed
-
getTaskCMD
Get Task cmd of a Task.- Returns:
- TaskCmd : command line which need to be executed
-
setTaskType
Set Task Type.- Parameters:
localtaskType- : TaskType such as SimpleTask, NullTask
-
getTaskType
Get Task Type.- Returns:
- TaskType : TaskType such as SimpleTask, NullTask
-
getTaskId
Get Task Id.- Returns:
- TaskId : Task identifier
-
setTaskId
Set TaskId.- Parameters:
localtaskId- : Task identifier
-
setTaskState
Set staus of a Task.- Parameters:
localtaskId- : TaskId of a tasklocalrunState- : Run state of a task
-
getTaskState
Get Task status of a Task.- Parameters:
localtaskId- : Task Id- Returns:
- TaskStatus for valid Task otherwise Null
-
getStartTime
public final long getStartTime()Get starttime of a Task.- Returns:
- StartTime of Task
-
setStartTime
public final void setStartTime()Set current time as start time of a Task. -
getEndTime
public final long getEndTime()Get task end time.- Returns:
- End time of task.
-
setEndTime
public final void setEndTime()Set task end time to current time. -
write
- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-
readFields
- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-
getWorkerId
Get workerId.- Returns:
- workerId : Worker identifier
-
setWorkerId
Set WorkerId.- Parameters:
localworkerId- : Worker identifier
-
equals
-
hashCode
public int hashCode() -
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-