org.apache.hadoop.mapred
Class JobHistory.JobInfo

java.lang.Object
  extended by org.apache.hadoop.mapred.JobHistory.JobInfo
Enclosing class:
JobHistory

public static class JobHistory.JobInfo
extends Object

Helper class for logging or reading back events related to job start, finish or failure.


Constructor Summary
JobHistory.JobInfo(String jobId)
          Create new JobInfo
 
Method Summary
static String decodeJobHistoryFileName(String logFileName)
          Helper function to decode the URL of the filename of the job-history log file.
static String encodeJobHistoryFileName(String logFileName)
          Helper function to encode the URL of the filename of the job-history log file.
static String encodeJobHistoryFilePath(String logFile)
          Helper function to encode the URL of the path of the job-history log file.
 String get(JobHistory.Keys k)
          Get 'String' value for given key.
 Map<String,JobHistory.Task> getAllTasks()
          Returns all map and reduce tasks .
 int getInt(JobHistory.Keys k)
          Convert value from history to int and return.
static String getLocalJobFilePath(JobID jobId)
          Get the path of the locally stored job file
static String getLocalJobFilePath(String jobid)
          Deprecated. 
 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(JobID jobid, long timestamp, int finishedMaps, int finishedReduces)
          Logs job failed event.
static void logFailed(String jobid, long timestamp, int finishedMaps, int finishedReduces)
          Deprecated. 
static void logFinished(JobID jobId, long finishTime, int finishedMaps, int finishedReduces, int failedMaps, int failedReduces, Counters counters)
          Log job finished.
static void logFinished(String jobId, long finishTime, int finishedMaps, int finishedReduces, int failedMaps, int failedReduces, Counters counters)
          Deprecated. 
static void logStarted(JobID jobId, long startTime, int totalMaps, int totalReduces)
          Logs launch time of job.
static void logStarted(String jobid, long startTime, int totalMaps, int totalReduces)
          Deprecated. 
static void logSubmitted(JobID jobId, JobConf jobConf, String jobConfPath, long submitTime)
          Log job submitted event to history.
static void logSubmitted(String jobid, JobConf jobConf, String jobConfPath, long submitTime)
          Deprecated. 
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobHistory.JobInfo

public JobHistory.JobInfo(String jobId)
Create new JobInfo

Method Detail

getAllTasks

public Map<String,JobHistory.Task> getAllTasks()
Returns all map and reduce tasks .


getLocalJobFilePath

@Deprecated
public static String getLocalJobFilePath(String jobid)
Deprecated. 


getLocalJobFilePath

public static String getLocalJobFilePath(JobID jobId)
Get the path of the locally stored job file

Parameters:
jobId - id of the job
Returns:
the path of the job file on the local file system

encodeJobHistoryFilePath

public static String encodeJobHistoryFilePath(String logFile)
                                       throws IOException
Helper function to encode the URL of the path of the job-history log file.

Parameters:
logFile - path of the job-history file
Returns:
URL encoded path
Throws:
IOException

encodeJobHistoryFileName

public static String encodeJobHistoryFileName(String logFileName)
                                       throws IOException
Helper function to encode the URL of the filename of the job-history log file.

Parameters:
logFileName - file name of the job-history file
Returns:
URL encoded filename
Throws:
IOException

decodeJobHistoryFileName

public static String decodeJobHistoryFileName(String logFileName)
                                       throws IOException
Helper function to decode the URL of the filename of the job-history log file.

Parameters:
logFileName - file name of the job-history file
Returns:
URL decoded filename
Throws:
IOException

logSubmitted

@Deprecated
public static void logSubmitted(String jobid,
                                           JobConf jobConf,
                                           String jobConfPath,
                                           long submitTime)
                         throws IOException
Deprecated. 

Throws:
IOException

logSubmitted

public static void logSubmitted(JobID jobId,
                                JobConf jobConf,
                                String jobConfPath,
                                long submitTime)
                         throws IOException
Log job submitted event to history. Creates a new file in history for the job. if history file creation fails, it disables history for all other events.

Parameters:
jobId - job id assigned by job tracker.
jobConf - job conf of the job
jobConfPath - path to job conf xml file in HDFS.
submitTime - time when job tracker received the job
Throws:
IOException

logStarted

@Deprecated
public static void logStarted(String jobid,
                                         long startTime,
                                         int totalMaps,
                                         int totalReduces)
Deprecated. 


logStarted

public static void logStarted(JobID jobId,
                              long startTime,
                              int totalMaps,
                              int totalReduces)
Logs launch time of job.

Parameters:
jobId - job id, assigned by jobtracker.
startTime - start time of job.
totalMaps - total maps assigned by jobtracker.
totalReduces - total reduces.

logFinished

@Deprecated
public static void logFinished(String jobId,
                                          long finishTime,
                                          int finishedMaps,
                                          int finishedReduces,
                                          int failedMaps,
                                          int failedReduces,
                                          Counters counters)
Deprecated. 


logFinished

public static void logFinished(JobID jobId,
                               long finishTime,
                               int finishedMaps,
                               int finishedReduces,
                               int failedMaps,
                               int failedReduces,
                               Counters counters)
Log job finished. closes the job file in history.

Parameters:
jobId - job id, assigned by jobtracker.
finishTime - finish time of job in ms.
finishedMaps - no of maps successfully finished.
finishedReduces - no of reduces finished sucessfully.
failedMaps - no of failed map tasks.
failedReduces - no of failed reduce tasks.
counters - the counters from the job

logFailed

@Deprecated
public static void logFailed(String jobid,
                                        long timestamp,
                                        int finishedMaps,
                                        int finishedReduces)
Deprecated. 


logFailed

public static void logFailed(JobID jobid,
                             long timestamp,
                             int finishedMaps,
                             int finishedReduces)
Logs job failed event. Closes the job history log file.

Parameters:
jobid - job id
timestamp - time when job failure was detected in ms.
finishedMaps - no finished map tasks.
finishedReduces - no of finished reduce tasks.

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