org.apache.hadoop.mapreduce.jobhistory
Class JobHistoryParser

java.lang.Object
  extended by org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class JobHistoryParser
extends Object

Default Parser for the JobHistory files. Typical usage is JobHistoryParser parser = new JobHistoryParser(fs, historyFile); job = parser.parse();


Nested Class Summary
static class JobHistoryParser.AMInfo
          Stores AM information
static class JobHistoryParser.JobInfo
          The class where job information is aggregated into after parsing
static class JobHistoryParser.TaskAttemptInfo
          Task Attempt Information is aggregated in this class after parsing
static class JobHistoryParser.TaskInfo
          TaskInformation is aggregated in this class after parsing
 
Constructor Summary
JobHistoryParser(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path historyFile)
          Create the job history parser for the given history file using the given file system
JobHistoryParser(org.apache.hadoop.fs.FileSystem fs, String file)
          Create a job history parser for the given history file using the given file system
JobHistoryParser(org.apache.hadoop.fs.FSDataInputStream in)
          Create the history parser based on the input stream
 
Method Summary
 IOException getParseException()
          Get the parse exception, if any.
 JobHistoryParser.JobInfo parse()
          Parse the entire history file and populate the JobInfo object The first invocation will populate the object, subsequent calls will return the already parsed object.
 JobHistoryParser.JobInfo parse(EventReader reader)
          Only used for unit tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobHistoryParser

public JobHistoryParser(org.apache.hadoop.fs.FileSystem fs,
                        String file)
                 throws IOException
Create a job history parser for the given history file using the given file system

Parameters:
fs -
file -
Throws:
IOException

JobHistoryParser

public JobHistoryParser(org.apache.hadoop.fs.FileSystem fs,
                        org.apache.hadoop.fs.Path historyFile)
                 throws IOException
Create the job history parser for the given history file using the given file system

Parameters:
fs -
historyFile -
Throws:
IOException

JobHistoryParser

public JobHistoryParser(org.apache.hadoop.fs.FSDataInputStream in)
Create the history parser based on the input stream

Parameters:
in -
Method Detail

parse

public JobHistoryParser.JobInfo parse()
                               throws IOException
Parse the entire history file and populate the JobInfo object The first invocation will populate the object, subsequent calls will return the already parsed object. The input stream is closed on return This api ignores partial records and stops parsing on encountering one. getParseException() can be used to fetch the exception, if any.

Returns:
The populated jobInfo object
Throws:
IOException
See Also:
getParseException()

parse

@InterfaceAudience.Private
public JobHistoryParser.JobInfo parse(EventReader reader)
                               throws IOException
Only used for unit tests.

Throws:
IOException

getParseException

public IOException getParseException()
Get the parse exception, if any.

Returns:
the parse exception, if any
See Also:
parse()


Copyright © 2012 Apache Software Foundation. All Rights Reserved.