|
@@ -1140,7 +1140,8 @@ public class ApplicationMaster {
|
|
ugi.doAs(new PrivilegedExceptionAction<TimelinePutResponse>() {
|
|
ugi.doAs(new PrivilegedExceptionAction<TimelinePutResponse>() {
|
|
@Override
|
|
@Override
|
|
public TimelinePutResponse run() throws Exception {
|
|
public TimelinePutResponse run() throws Exception {
|
|
- return timelineClient.putEntities(entity);
|
|
|
|
|
|
+ return processTimelineResponseErrors(
|
|
|
|
+ timelineClient.putEntities(entity));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -1165,7 +1166,8 @@ public class ApplicationMaster {
|
|
event.addEventInfo("Exit Status", container.getExitStatus());
|
|
event.addEventInfo("Exit Status", container.getExitStatus());
|
|
entity.addEvent(event);
|
|
entity.addEvent(event);
|
|
try {
|
|
try {
|
|
- timelineClient.putEntities(entity);
|
|
|
|
|
|
+ TimelinePutResponse response = timelineClient.putEntities(entity);
|
|
|
|
+ processTimelineResponseErrors(response);
|
|
} catch (YarnException | IOException e) {
|
|
} catch (YarnException | IOException e) {
|
|
LOG.error("Container end event could not be published for "
|
|
LOG.error("Container end event could not be published for "
|
|
+ container.getContainerId().toString(), e);
|
|
+ container.getContainerId().toString(), e);
|
|
@@ -1185,7 +1187,8 @@ public class ApplicationMaster {
|
|
event.setTimestamp(System.currentTimeMillis());
|
|
event.setTimestamp(System.currentTimeMillis());
|
|
entity.addEvent(event);
|
|
entity.addEvent(event);
|
|
try {
|
|
try {
|
|
- timelineClient.putEntities(entity);
|
|
|
|
|
|
+ TimelinePutResponse response = timelineClient.putEntities(entity);
|
|
|
|
+ processTimelineResponseErrors(response);
|
|
} catch (YarnException | IOException e) {
|
|
} catch (YarnException | IOException e) {
|
|
LOG.error("App Attempt "
|
|
LOG.error("App Attempt "
|
|
+ (appEvent.equals(DSEvent.DS_APP_ATTEMPT_START) ? "start" : "end")
|
|
+ (appEvent.equals(DSEvent.DS_APP_ATTEMPT_START) ? "start" : "end")
|
|
@@ -1194,6 +1197,22 @@ public class ApplicationMaster {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static TimelinePutResponse processTimelineResponseErrors(
|
|
|
|
+ TimelinePutResponse response) {
|
|
|
|
+ List<TimelinePutResponse.TimelinePutError> errors = response.getErrors();
|
|
|
|
+ if (errors.size() == 0) {
|
|
|
|
+ LOG.debug("Timeline entities are successfully put");
|
|
|
|
+ } else {
|
|
|
|
+ for (TimelinePutResponse.TimelinePutError error : errors) {
|
|
|
|
+ LOG.error(
|
|
|
|
+ "Error when publishing entity [" + error.getEntityType() + ","
|
|
|
|
+ + error.getEntityId() + "], server side error code: "
|
|
|
|
+ + error.getErrorCode());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return response;
|
|
|
|
+ }
|
|
|
|
+
|
|
RMCallbackHandler getRMCallbackHandler() {
|
|
RMCallbackHandler getRMCallbackHandler() {
|
|
return new RMCallbackHandler();
|
|
return new RMCallbackHandler();
|
|
}
|
|
}
|