Package org.apache.hadoop.mapreduce
Class TaskCompletionEvent
java.lang.Object
org.apache.hadoop.mapreduce.TaskCompletionEvent
- All Implemented Interfaces:
Writable
- Direct Known Subclasses:
TaskCompletionEvent
This is used to track task completion events on
job tracker.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for Writable.TaskCompletionEvent(int eventId, TaskAttemptID taskId, int idWithinJob, boolean isMap, TaskCompletionEvent.Status status, String taskTrackerHttp) Constructor. eventId should be created externally and incremented per event for each job. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns event Id.ReturnsTaskCompletionEvent.StatusReturns task id.intReturns time (in millisec) the task took to complete.http location of the tasktracker where this task ran.inthashCode()intbooleanvoidreadFields(DataInput in) Deserialize the fields of this object fromin.protected voidsetEventId(int eventId) set event Id. should be assigned incrementally starting from 0.protected voidsetTaskAttemptId(TaskAttemptID taskId) Sets task id.protected voidsetTaskRunTime(int taskCompletionTime) Set the task completion timeprotected voidSet task status.protected voidsetTaskTrackerHttp(String taskTrackerHttp) Set task tracker http location.toString()voidwrite(DataOutput out) Serialize the fields of this object toout.
-
Field Details
-
EMPTY_ARRAY
-
-
Constructor Details
-
TaskCompletionEvent
public TaskCompletionEvent()Default constructor for Writable. -
TaskCompletionEvent
public TaskCompletionEvent(int eventId, TaskAttemptID taskId, int idWithinJob, boolean isMap, TaskCompletionEvent.Status status, String taskTrackerHttp) Constructor. eventId should be created externally and incremented per event for each job.- Parameters:
eventId- event id, event id should be unique and assigned in incrementally, starting from 0.taskId- task idstatus- task's statustaskTrackerHttp- task tracker's host:port for http.
-
-
Method Details
-
getEventId
public int getEventId()Returns event Id.- Returns:
- event id
-
getTaskAttemptId
Returns task id.- Returns:
- task id
-
getStatus
ReturnsTaskCompletionEvent.Status- Returns:
- task completion status
-
getTaskTrackerHttp
http location of the tasktracker where this task ran.- Returns:
- http location of tasktracker user logs
-
getTaskRunTime
public int getTaskRunTime()Returns time (in millisec) the task took to complete. -
setTaskRunTime
protected void setTaskRunTime(int taskCompletionTime) Set the task completion time- Parameters:
taskCompletionTime- time (in millisec) the task took to complete
-
setEventId
protected void setEventId(int eventId) set event Id. should be assigned incrementally starting from 0.- Parameters:
eventId-
-
setTaskAttemptId
Sets task id.- Parameters:
taskId-
-
setTaskStatus
Set task status.- Parameters:
status-
-
setTaskTrackerHttp
Set task tracker http location.- Parameters:
taskTrackerHttp-
-
toString
-
equals
-
hashCode
public int hashCode() -
isMapTask
public boolean isMapTask() -
idWithinJob
public int idWithinJob() -
write
Description copied from interface:WritableSerialize the fields of this object toout.- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-