use of org.apache.oozie.client.event.SLAEvent in project oozie by apache.
the class LogUtils method setLogPrefix.
public static XLog setLogPrefix(XLog logObj, Event event) {
String jobId = null, actionId = null, appName = null;
if (event instanceof JobEvent) {
JobEvent je = (JobEvent) event;
if (je.getAppType() == AppType.WORKFLOW_JOB || je.getAppType() == AppType.COORDINATOR_JOB || je.getAppType() == AppType.BUNDLE_JOB) {
jobId = je.getId();
} else {
actionId = je.getId();
jobId = Services.get().get(UUIDService.class).getId(actionId);
}
appName = je.getAppName();
} else if (event instanceof SLAEvent) {
SLAEvent se = (SLAEvent) event;
if (se.getAppType() == AppType.WORKFLOW_JOB || se.getAppType() == AppType.COORDINATOR_JOB || se.getAppType() == AppType.BUNDLE_JOB) {
jobId = se.getId();
} else {
actionId = se.getId();
jobId = Services.get().get(UUIDService.class).getId(actionId);
}
appName = se.getAppName();
}
return LogUtils.setLogInfo(logObj, jobId, actionId, appName);
}
Aggregations