/** * Retrieves diagnostics information preserved in the history file * * @return diagnostics as of the time of job termination */ public String getDiagnostics() { final CharSequence diagnostics = datum.getDiagnostics(); return diagnostics == null ? NODIAGS : diagnostics.toString(); } }
/** Get the job finish time */ public long getFinishTime() { return datum.getFinishTime(); } /** Get the number of finished maps */
/** Get the number of finished maps */ public int getFinishedMaps() { return datum.getFinishedMaps(); } /** Get the number of finished reduces */
/** * Create an event to record unsuccessful completion (killed/failed) of jobs * @param id Job ID * @param finishTime Finish time of the job * @param finishedMaps Number of finished maps * @param finishedReduces Number of finished reduces * @param status Status of the job * @param diagnostics job runtime diagnostics */ public JobUnsuccessfulCompletionEvent(JobID id, long finishTime, int finishedMaps, int finishedReduces, String status, Iterable<String> diagnostics) { datum.setJobid(new Utf8(id.toString())); datum.setFinishTime(finishTime); datum.setFinishedMaps(finishedMaps); datum.setFinishedReduces(finishedReduces); datum.setJobStatus(new Utf8(status)); if (diagnostics == null) { diagnostics = NODIAGS_LIST; } datum.setDiagnostics(new Utf8(Joiner.on('\n').skipNulls() .join(diagnostics))); }
private void handleJobUnsuccessfulCompletion(Event wrapper) throws Exception { JobUnsuccessfulCompletion js = ((JobUnsuccessfulCompletion) wrapper.getEvent()); Map<Keys, String> values = new HashMap<>(); if (js.getJobid() != null) { values.put(Keys.JOBID, js.getJobid().toString()); } if (js.getFinishTime() != null) { values.put(Keys.FINISH_TIME, js.getFinishTime().toString()); } if (js.getFinishedMaps() != null) { values.put(Keys.FINISHED_MAPS, js.getFinishedMaps().toString()); } if (js.getFinishedReduces() != null) { values.put(Keys.FINISHED_REDUCES, js.getFinishedReduces().toString()); } if (js.getJobStatus() != null) { values.put(Keys.JOB_STATUS, js.getJobStatus().toString()); } if (js.getDiagnostics() != null) { values.put(Keys.DIAGNOSTICS, js.getDiagnostics().toString()); } handleJob(wrapper.getType(), values, null, null, null); }
/** Get the status */ public String getStatus() { return datum.getJobStatus().toString(); } /** Get the event type */
/** Get the number of finished reduces */ public int getFinishedReduces() { return datum.getFinishedReduces(); } /** Get the status */
@Override public JobUnsuccessfulCompletion build() { try { JobUnsuccessfulCompletion record = new JobUnsuccessfulCompletion(); record.jobid = fieldSetFlags()[0] ? this.jobid : (java.lang.CharSequence) defaultValue(fields()[0]); record.finishTime = fieldSetFlags()[1] ? this.finishTime : (java.lang.Long) defaultValue(fields()[1]); record.finishedMaps = fieldSetFlags()[2] ? this.finishedMaps : (java.lang.Integer) defaultValue(fields()[2]); record.finishedReduces = fieldSetFlags()[3] ? this.finishedReduces : (java.lang.Integer) defaultValue(fields()[3]); record.jobStatus = fieldSetFlags()[4] ? this.jobStatus : (java.lang.CharSequence) defaultValue(fields()[4]); record.diagnostics = fieldSetFlags()[5] ? this.diagnostics : (java.lang.CharSequence) defaultValue(fields()[5]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Create an event to record unsuccessful completion (killed/failed) of jobs * @param id Job ID * @param finishTime Finish time of the job * @param finishedMaps Number of finished maps * @param finishedReduces Number of finished reduces * @param status Status of the job * @param diagnostics job runtime diagnostics */ public JobUnsuccessfulCompletionEvent(JobID id, long finishTime, int finishedMaps, int finishedReduces, String status, Iterable<String> diagnostics) { datum.setJobid(new Utf8(id.toString())); datum.setFinishTime(finishTime); datum.setFinishedMaps(finishedMaps); datum.setFinishedReduces(finishedReduces); datum.setJobStatus(new Utf8(status)); if (diagnostics == null) { diagnostics = NODIAGS_LIST; } datum.setDiagnostics(new Utf8(Joiner.on('\n').skipNulls() .join(diagnostics))); }
/** Get the status */ public String getStatus() { return datum.getJobStatus().toString(); } /** Get the event type */
/** Get the number of finished reduces */ public int getFinishedReduces() { return datum.getFinishedReduces(); } /** Get the status */
@Override public JobUnsuccessfulCompletion build() { try { JobUnsuccessfulCompletion record = new JobUnsuccessfulCompletion(); record.jobid = fieldSetFlags()[0] ? this.jobid : (java.lang.CharSequence) defaultValue(fields()[0]); record.finishTime = fieldSetFlags()[1] ? this.finishTime : (java.lang.Long) defaultValue(fields()[1]); record.finishedMaps = fieldSetFlags()[2] ? this.finishedMaps : (java.lang.Integer) defaultValue(fields()[2]); record.finishedReduces = fieldSetFlags()[3] ? this.finishedReduces : (java.lang.Integer) defaultValue(fields()[3]); record.jobStatus = fieldSetFlags()[4] ? this.jobStatus : (java.lang.CharSequence) defaultValue(fields()[4]); record.diagnostics = fieldSetFlags()[5] ? this.diagnostics : (java.lang.CharSequence) defaultValue(fields()[5]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Create an event to record unsuccessful completion (killed/failed) of jobs * @param id Job ID * @param finishTime Finish time of the job * @param finishedMaps Number of finished maps * @param finishedReduces Number of finished reduces * @param status Status of the job * @param diagnostics job runtime diagnostics */ public JobUnsuccessfulCompletionEvent(JobID id, long finishTime, int finishedMaps, int finishedReduces, String status, Iterable<String> diagnostics) { datum.setJobid(new Utf8(id.toString())); datum.setFinishTime(finishTime); datum.setFinishedMaps(finishedMaps); datum.setFinishedReduces(finishedReduces); datum.setJobStatus(new Utf8(status)); if (diagnostics == null) { diagnostics = NODIAGS_LIST; } datum.setDiagnostics(new Utf8(Joiner.on('\n').skipNulls() .join(diagnostics))); }
/** * Retrieves diagnostics information preserved in the history file * * @return diagnostics as of the time of job termination */ public String getDiagnostics() { final CharSequence diagnostics = datum.getDiagnostics(); return diagnostics == null ? NODIAGS : diagnostics.toString(); } }
/** Get the number of finished maps */ public int getFinishedMaps() { return datum.getFinishedMaps(); } /** Get the number of finished reduces */
/** Get the status */ public String getStatus() { return datum.getJobStatus().toString(); } /** Get the event type */
/** Get the number of finished reduces */ public int getFinishedReduces() { return datum.getFinishedReduces(); } /** Get the status */
/** Get the job finish time */ public long getFinishTime() { return datum.getFinishTime(); } /** Get the number of finished maps */
@Override public JobUnsuccessfulCompletion build() { try { JobUnsuccessfulCompletion record = new JobUnsuccessfulCompletion(); record.jobid = fieldSetFlags()[0] ? this.jobid : (java.lang.CharSequence) defaultValue(fields()[0]); record.finishTime = fieldSetFlags()[1] ? this.finishTime : (java.lang.Long) defaultValue(fields()[1]); record.finishedMaps = fieldSetFlags()[2] ? this.finishedMaps : (java.lang.Integer) defaultValue(fields()[2]); record.finishedReduces = fieldSetFlags()[3] ? this.finishedReduces : (java.lang.Integer) defaultValue(fields()[3]); record.jobStatus = fieldSetFlags()[4] ? this.jobStatus : (java.lang.CharSequence) defaultValue(fields()[4]); record.diagnostics = fieldSetFlags()[5] ? this.diagnostics : (java.lang.CharSequence) defaultValue(fields()[5]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
private FakeEvent getJobKilledEvent() { FakeEvent result = new FakeEvent(EventType.JOB_KILLED); JobUnsuccessfulCompletion datum = new JobUnsuccessfulCompletion(); datum.setFinishedMaps(1); datum.setFinishedReduces(2); datum.setFinishTime(3L); datum.setJobid("ID"); datum.setJobStatus("STATUS"); datum.setDiagnostics(JobImpl.JOB_KILLED_DIAG); result.setDatum(datum); return result; }