@Override public String toString() { return toShortString(); }
/** {@inheritDoc} */ @Override public void onUpdateJob(JobSpec updatedJob) { if (_log.isPresent()) { _log.get().info("JobSpec changed: " + updatedJob.toShortString()); } }
/** {@inheritDoc} */ @Override public void onAddJob(JobSpec addedJob) { if (_log.isPresent()) { _log.get().info("New JobSpec detected: " + addedJob.toShortString()); } }
/** {@inheritDoc} */ @Override public void onAddJob(JobSpec addedJob) { if (_log.isPresent()) { _log.get().info("New JobSpec detected: " + addedJob.toShortString()); } }
private static Logger getJobLogger(Logger parentLog, JobSpec jobSpec) { return LoggerFactory.getLogger(parentLog.getName() + "." + jobSpec.toShortString()); }
/** {@inheritDoc} */ @Override public void onUpdateJob(JobSpec updatedJob) { if (_log.isPresent()) { _log.get().info("JobSpec changed: " + updatedJob.toShortString()); } }
/** {@inheritDoc} */ @Override public void onStatusChange(JobExecutionState state, RunningState previousStatus, RunningState newStatus) { if (_log.isPresent()) { _log.get().info("JobExection status change for " + state.getJobSpec().toShortString() + ": " + previousStatus + " --> " + newStatus); } }
/** {@inheritDoc} */ @Override public void onStatusChange(JobExecutionState state, RunningState previousStatus, RunningState newStatus) { if (_log.isPresent()) { _log.get().info("JobExection status change for " + state.getJobSpec().toShortString() + ": " + previousStatus + " --> " + newStatus); } }
/** {@inheritDoc} */ @Override public void onMetadataChange(JobExecutionState state, String key, Object oldValue, Object newValue) { if (_log.isPresent()) { _log.get().info("JobExection metadata change for " + state.getJobSpec().toShortString() + key + ": '" + oldValue + "' --> '" + newValue + "'"); } }
/** {@inheritDoc} */ @Override public void onStageTransition(JobExecutionState state, String previousStage, String newStage) { if (_log.isPresent()) { _log.get().info("JobExection stage change for " + state.getJobSpec().toShortString() + ": " + previousStage + " --> " + newStage); } }
/** {@inheritDoc} */ @Override public void onStageTransition(JobExecutionState state, String previousStage, String newStage) { if (_log.isPresent()) { _log.get().info("JobExection stage change for " + state.getJobSpec().toShortString() + ": " + previousStage + " --> " + newStage); } }
/** {@inheritDoc} */ @Override public void onMetadataChange(JobExecutionState state, String key, Object oldValue, Object newValue) { if (_log.isPresent()) { _log.get().info("JobExection metadata change for " + state.getJobSpec().toShortString() + key + ": '" + oldValue + "' --> '" + newValue + "'"); } }
LOGGER.info("Sending job failure email for job: {}", state.getJobSpec().toShortString()); EmailUtils.sendJobFailureAlertEmail(state.getJobSpec().toShortString(), getEmailBody(state, previousStatus, newStatus), 1, ConfigUtils.configToState(state.getJobSpec().getConfig())); } catch (EmailException ee) { LOGGER.error("Failed to send job failure alert email for job " + state.getJobSpec().toShortString(), ee); LOGGER.info("Sending job completion email for job: {}", state.getJobSpec().toShortString()); EmailUtils.sendJobCompletionEmail(state.getJobSpec().toShortString(), getEmailBody(state, previousStatus, newStatus), newStatus.toString(), ConfigUtils.configToState(state.getJobSpec().getConfig())); } catch (EmailException ee) { LOGGER.error("Failed to send job completion notification email for job " + state.getJobSpec().toShortString(), ee);