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(TaskAttemptID taskAttemptId, long timestamp, String hostName, String error)
          Deprecated. Use logFailed(TaskAttemptID, long, String, String, String)
static void logFailed(TaskAttemptID taskAttemptId, long timestamp, String hostName, String error, String taskType)
          Log task attempt failed event.
static void logFinished(TaskAttemptID taskAttemptId, long finishTime, String hostName)
          Deprecated. Use logFinished(TaskAttemptID, long, String, String, String, Counters)
static void logFinished(TaskAttemptID taskAttemptId, long finishTime, String hostName, String taskType, String stateString, Counters counter)
          Log finish time of map task attempt.
static void logKilled(TaskAttemptID taskAttemptId, long timestamp, String hostName, String error)
          Deprecated. Use logKilled(TaskAttemptID, long, String, String, String)
static void logKilled(TaskAttemptID taskAttemptId, long timestamp, String hostName, String error, String taskType)
          Log task attempt killed event.
static void logStarted(TaskAttemptID taskAttemptId, long startTime, String hostName)
          Deprecated. Use logStarted(TaskAttemptID, long, String, int, String)
static void logStarted(TaskAttemptID taskAttemptId, long startTime, String trackerName, int httpPort, String taskType)
          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, logFailed, logFinished, logStarted, logUpdates
 
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

@Deprecated
public static void logStarted(TaskAttemptID taskAttemptId,
                                         long startTime,
                                         String hostName)
Deprecated. Use logStarted(TaskAttemptID, long, String, int, String)

Log start time of this map task attempt.

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

logStarted

public static void logStarted(TaskAttemptID taskAttemptId,
                              long startTime,
                              String trackerName,
                              int httpPort,
                              String taskType)
Log start time of this map task attempt.

Parameters:
taskAttemptId - task attempt id
startTime - start time of task attempt as reported by task tracker.
trackerName - name of the tracker executing the task attempt.
httpPort - http port of the task tracker executing the task attempt
taskType - Whether the attempt is cleanup or setup or map

logFinished

@Deprecated
public static void logFinished(TaskAttemptID taskAttemptId,
                                          long finishTime,
                                          String hostName)
Deprecated. Use logFinished(TaskAttemptID, long, String, String, String, Counters)

Log finish time of map task attempt.

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

logFinished

public static void logFinished(TaskAttemptID taskAttemptId,
                               long finishTime,
                               String hostName,
                               String taskType,
                               String stateString,
                               Counters counter)
Log finish time of map task attempt.

Parameters:
taskAttemptId - task attempt id
finishTime - finish time
hostName - host name
taskType - Whether the attempt is cleanup or setup or map
stateString - state string of the task attempt
counter - counters of the task attempt

logFailed

@Deprecated
public static void logFailed(TaskAttemptID taskAttemptId,
                                        long timestamp,
                                        String hostName,
                                        String error)
Deprecated. Use logFailed(TaskAttemptID, long, String, String, String)

Log task attempt failed event.

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

logFailed

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

Parameters:
taskAttemptId - task attempt id
timestamp - timestamp
hostName - hostname of this task attempt.
error - error message if any for this task attempt.
taskType - Whether the attempt is cleanup or setup or map

logKilled

@Deprecated
public static void logKilled(TaskAttemptID taskAttemptId,
                                        long timestamp,
                                        String hostName,
                                        String error)
Deprecated. Use logKilled(TaskAttemptID, long, String, String, String)

Log task attempt killed event.

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

logKilled

public static void logKilled(TaskAttemptID taskAttemptId,
                             long timestamp,
                             String hostName,
                             String error,
                             String taskType)
Log task attempt killed event.

Parameters:
taskAttemptId - task attempt id
timestamp - timestamp
hostName - hostname of this task attempt.
error - error message if any for this task attempt.
taskType - Whether the attempt is cleanup or setup or map

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 © 2009 The Apache Software Foundation