Search in sources :

Example 1 with ContainerSchedulerEvent

use of org.apache.hadoop.yarn.server.nodemanager.containermanager.scheduler.ContainerSchedulerEvent 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)

Aggregations

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 ApplicationContainerFinishedEvent (org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationContainerFinishedEvent)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