org.apache.hadoop.mapred
Class JobHistory.MapAttempt

java.lang.Object
  extended by org.apache.hadoop.mapred.JobHistory.Task
      extended by org.apache.hadoop.mapred.JobHistory.TaskAttempt
          extended by org.apache.hadoop.mapred.JobHistory.MapAttempt
Enclosing class:
JobHistory

public static class JobHistory.MapAttempt
extends JobHistory.TaskAttempt

Helper class for logging or reading back events related to start, finish or failure of a Map Attempt on a node.


Constructor Summary
JobHistory.MapAttempt()
           
 
Method Summary
 String get(JobHistory.Keys k)
          Get 'String' value for given key.
 int getInt(JobHistory.Keys k)
          Convert value from history to int and return.
 long getLong(JobHistory.Keys k)
          Convert value from history to int and return.
 Map<JobHistory.Keys,String> getValues()
          Returns Map containing all key-values.
 void handle(Map<JobHistory.Keys,String> values)
          Reads values back from the history, input is same Map as passed to Listener by parseHistory().
static void logFailed(String jobId, String taskId, String taskAttemptId, long timestamp, String hostName, String error)
          Log task attempt failed event.
static void logFinished(String jobId, String taskId, String taskAttemptId, long finishTime, String hostName)
          Log finish time of map task attempt.
static void logStarted(String jobId, String taskId, String taskAttemptId, long startTime, String hostName)
          Log start time of this map task attempt.
 void set(JobHistory.Keys k, String s)
          Set value for the key.
 void set(Map<JobHistory.Keys,String> m)
          Adds all values in the Map argument to its own values.
 
Methods inherited from class org.apache.hadoop.mapred.JobHistory.Task
getTaskAttempts, logFailed, logFinished, logStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobHistory.MapAttempt

public JobHistory.MapAttempt()
Method Detail

logStarted

public static void logStarted(String jobId,
                              String taskId,
                              String taskAttemptId,
                              long startTime,
                              String hostName)
Log start time of this map task attempt.

Parameters:
jobId - job id
taskId - task id
taskAttemptId - task attempt id
startTime - start time of task attempt as reported by task tracker.
hostName - host name of the task attempt.

logFinished

public static void logFinished(String jobId,
                               String taskId,
                               String taskAttemptId,
                               long finishTime,
                               String hostName)
Log finish time of map task attempt.

Parameters:
jobId - job id
taskId - task id
taskAttemptId - task attempt id
finishTime - finish time
hostName - host name

logFailed

public static void logFailed(String jobId,
                             String taskId,
                             String taskAttemptId,
                             long timestamp,
                             String hostName,
                             String error)
Log task attempt failed event.

Parameters:
jobId - jobid
taskId - taskid
taskAttemptId - task attempt id
timestamp - timestamp
hostName - hostname of this task attempt.
error - error message if any for this task attempt.

get

public String get(JobHistory.Keys k)
Get 'String' value for given key. Most of the places use Strings as values so the default get' method returns 'String'. This method never returns null to ease on GUIs. if no value is found it returns empty string ""

Parameters:
k -
Returns:
if null it returns empty string - ""

getInt

public int getInt(JobHistory.Keys k)
Convert value from history to int and return. if no value is found it returns 0.

Parameters:
k - key

getLong

public long getLong(JobHistory.Keys k)
Convert value from history to int and return. if no value is found it returns 0.

Parameters:
k -

set

public void set(JobHistory.Keys k,
                String s)
Set value for the key.

Parameters:
k -
s -

set

public void set(Map<JobHistory.Keys,String> m)
Adds all values in the Map argument to its own values.

Parameters:
m -

handle

public void handle(Map<JobHistory.Keys,String> values)
Reads values back from the history, input is same Map as passed to Listener by parseHistory().

Parameters:
values -

getValues

public Map<JobHistory.Keys,String> getValues()
Returns Map containing all key-values.



Copyright © 2006 The Apache Software Foundation