@Test(expected = IllegalArgumentException.class) public void testCreateJobHistoryFileParserNullCreation() { JobHistoryFileParser historyFileParser = JobHistoryFileParserFactory .createJobHistoryFileParser(null, null); assertNull(historyFileParser); }
public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = getVersion(historyFileContents); switch (version) { case TWO: return new JobHistoryFileParserHadoop2(jobConf); default: throw new IllegalArgumentException( " Unknown format of job history file "); } }
JobHistoryFileParserFactory { public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = getVersion(historyFileContents); switch (version) { case TWO: return new JobHistoryFileParserHadoop2(jobConf); default: throw new IllegalArgumentException( " Unknown format of job history file "); } } }
JobHistoryFileParserFactory { public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = getVersion(historyFileContents); switch (version) { case TWO: return new JobHistoryFileParserHadoop2(jobConf); default: throw new IllegalArgumentException( " Unknown format of job history file "); } }  }
JobHistoryFileParserFactory { public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = getVersion(historyFileContents); switch (version) { case TWO: return new JobHistoryFileParserHadoop2(jobConf); default: throw new IllegalArgumentException( " Unknown format of job history file "); } }  static HadoopVersion getVersion(byte[] historyFileContents); static JobHistoryFileParser createJobHistoryFileParser(
      byte[] historyFileContents, Configuration jobConf); static HadoopVersion getHistoryFileVersion2(); }
JobHistoryFileParserFactory { public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = getVersion(historyFileContents); switch (version) { case TWO: return new JobHistoryFileParserHadoop2(jobConf); default: throw new IllegalArgumentException( " Unknown format of job history file "); } }  static HadoopVersion getVersion(byte[] historyFileContents); static JobHistoryFileParser createJobHistoryFileParser(
      byte[] historyFileContents, Configuration jobConf); static HadoopVersion getHistoryFileVersion2(); static final String HADOOP2_VERSION_STRING; }