use of com.tencent.angel.master.ps.attempt.PSAttemptDiagnosticsUpdateEvent in project angel by Tencent.
the class YarnContainerAllocator method handleFinishContainers.
@SuppressWarnings("unchecked")
private void handleFinishContainers(List<ContainerStatus> finishedContainers) {
for (ContainerStatus cont : finishedContainers) {
LOG.info("Received completed container:" + cont);
Id id = assignedContainerToIDMap.get(cont.getContainerId());
if (id == null) {
LOG.error("Container complete event for unknown container id " + cont.getContainerId());
} else {
assignedContainerToIDMap.remove(cont.getContainerId());
idToContainerMap.remove(id);
// dispatch container exit message to corresponding components
String diagnostics = StringInterner.weakIntern(cont.getDiagnostics());
if (id instanceof PSAttemptId) {
context.getEventHandler().handle(new PSAttemptDiagnosticsUpdateEvent(diagnostics, (PSAttemptId) id));
context.getEventHandler().handle(createContainerFinishedEvent(cont, (PSAttemptId) id));
} else if (id instanceof PSAgentAttemptId) {
context.getEventHandler().handle(new PSAgentAttemptDiagnosticsUpdateEvent((PSAgentAttemptId) id, diagnostics));
context.getEventHandler().handle(createContainerFinishedEvent(cont, (PSAgentAttemptId) id));
} else if (id instanceof WorkerAttemptId) {
context.getEventHandler().handle(new WorkerAttemptDiagnosticsUpdateEvent((WorkerAttemptId) id, diagnostics));
context.getEventHandler().handle(createContainerFinishedEvent(cont, (WorkerAttemptId) id));
}
}
}
}
Aggregations