Search in sources :

Example 1 with ApplicationContainerFinishedEvent

use of org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationContainerFinishedEvent in project hadoop by apache.

the class ContainerImpl method sendFinishedEvents.

@SuppressWarnings("unchecked")
private void sendFinishedEvents() {
    // Inform the application
    @SuppressWarnings("rawtypes") EventHandler eventHandler = dispatcher.getEventHandler();
    ContainerStatus containerStatus = cloneAndGetContainerStatus();
    eventHandler.handle(new ApplicationContainerFinishedEvent(containerStatus));
    // Tell the scheduler the container is Done
    eventHandler.handle(new ContainerSchedulerEvent(this, ContainerSchedulerEventType.CONTAINER_COMPLETED));
    // Remove the container from the resource-monitor
    eventHandler.handle(new ContainerStopMonitoringEvent(containerId));
    // Tell the logService too
    eventHandler.handle(new LogHandlerContainerFinishedEvent(containerId, exitCode));
}
Also used : NMContainerStatus(org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus) ContainerStatus(org.apache.hadoop.yarn.api.records.ContainerStatus) RecoveredContainerStatus(org.apache.hadoop.yarn.server.nodemanager.recovery.NMStateStoreService.RecoveredContainerStatus) EventHandler(org.apache.hadoop.yarn.event.EventHandler) LogHandlerContainerFinishedEvent(org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerContainerFinishedEvent) ContainerSchedulerEvent(org.apache.hadoop.yarn.server.nodemanager.containermanager.scheduler.ContainerSchedulerEvent) ContainerStopMonitoringEvent(org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainerStopMonitoringEvent) ApplicationContainerFinishedEvent(org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationContainerFinishedEvent)

Example 2 with ApplicationContainerFinishedEvent

use of org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationContainerFinishedEvent in project hadoop by apache.

the class NMTimelinePublisher method publishApplicationEvent.

public void publishApplicationEvent(ApplicationEvent event) {
    // publish only when the desired event is received
    switch(event.getType()) {
        case INIT_APPLICATION:
        case FINISH_APPLICATION:
        case APPLICATION_LOG_HANDLING_FAILED:
            // not sure to publish under which entity
            break;
        case APPLICATION_CONTAINER_FINISHED:
            // this is actually used to publish the container Event
            ApplicationContainerFinishedEvent evnt = (ApplicationContainerFinishedEvent) event;
            publishContainerFinishedEvent(evnt.getContainerStatus(), event.getTimestamp());
            break;
        default:
            if (LOG.isDebugEnabled()) {
                LOG.debug(event.getType() + " is not a desired ApplicationEvent which" + " needs to be published by NMTimelinePublisher");
            }
            break;
    }
}
Also used : ApplicationContainerFinishedEvent(org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationContainerFinishedEvent)

Aggregations

ApplicationContainerFinishedEvent (org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationContainerFinishedEvent)2 ContainerStatus (org.apache.hadoop.yarn.api.records.ContainerStatus)1 EventHandler (org.apache.hadoop.yarn.event.EventHandler)1 NMContainerStatus (org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus)1 LogHandlerContainerFinishedEvent (org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerContainerFinishedEvent)1 ContainerStopMonitoringEvent (org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainerStopMonitoringEvent)1 ContainerSchedulerEvent (org.apache.hadoop.yarn.server.nodemanager.containermanager.scheduler.ContainerSchedulerEvent)1 RecoveredContainerStatus (org.apache.hadoop.yarn.server.nodemanager.recovery.NMStateStoreService.RecoveredContainerStatus)1