Exemplo n.º 1
0
 public override void Transition(RMContainerImpl container, RMContainerEvent @event
                                 )
 {
     // Tell scheduler to recover request of this container to app
     container.eventHandler.Handle(new ContainerRescheduledEvent(container));
     base.Transition(container, @event);
 }
Exemplo n.º 2
0
 public virtual void Handle(RMContainerEvent @event)
 {
     Log.Debug("Processing " + @event.GetContainerId() + " of type " + @event.GetType(
                   ));
     try
     {
         writeLock.Lock();
         RMContainerState oldState = GetState();
         try
         {
             stateMachine.DoTransition(@event.GetType(), @event);
         }
         catch (InvalidStateTransitonException e)
         {
             Log.Error("Can't handle this event at current state", e);
             Log.Error("Invalid event " + @event.GetType() + " on container " + this.containerId
                       );
         }
         if (oldState != GetState())
         {
             Log.Info(@event.GetContainerId() + " Container Transitioned from " + oldState + " to "
                      + GetState());
         }
     }
     finally
     {
         writeLock.Unlock();
     }
 }
Exemplo n.º 3
0
 public override void Transition(RMContainerImpl container, RMContainerEvent @event
                                 )
 {
     // Unregister from containerAllocationExpirer.
     container.containerAllocationExpirer.Unregister(container.GetContainerId());
     // Inform AppAttempt
     base.Transition(container, @event);
 }
Exemplo n.º 4
0
            public override void Transition(RMContainerImpl container, RMContainerEvent @event
                                            )
            {
                RMContainerReservedEvent e = (RMContainerReservedEvent)@event;

                container.reservedResource = e.GetReservedResource();
                container.reservedNode     = e.GetReservedNode();
                container.reservedPriority = e.GetReservedPriority();
            }
Exemplo n.º 5
0
 public override void Transition(RMContainerImpl container, RMContainerEvent @event
                                 )
 {
     // Unregister from containerAllocationExpirer.
     container.containerAllocationExpirer.Unregister(container.GetContainerId());
     // Inform node
     container.eventHandler.Handle(new RMNodeCleanContainerEvent(container.nodeId, container
                                                                 .containerId));
     // Inform appAttempt
     base.Transition(container, @event);
 }
Exemplo n.º 6
0
 public override void Transition(RMContainerImpl container, RMContainerEvent @event
                                 )
 {
     // Clear ResourceRequest stored in RMContainer
     container.SetResourceRequests(null);
     // Register with containerAllocationExpirer.
     container.containerAllocationExpirer.Register(container.GetContainerId());
     // Tell the app
     container.eventHandler.Handle(new RMAppRunningOnNodeEvent(container.GetApplicationAttemptId
                                                                   ().GetApplicationId(), container.nodeId));
 }
Exemplo n.º 7
0
            public override void Transition(RMContainerImpl container, RMContainerEvent @event
                                            )
            {
                RMContainerFinishedEvent finishedEvent = (RMContainerFinishedEvent)@event;

                container.finishTime     = Runtime.CurrentTimeMillis();
                container.finishedStatus = finishedEvent.GetRemoteContainerStatus();
                // Inform AppAttempt
                // container.getContainer() can return null when a RMContainer is a
                // reserved container
                UpdateAttemptMetrics(container);
                container.eventHandler.Handle(new RMAppAttemptContainerFinishedEvent(container.appAttemptId
                                                                                     , finishedEvent.GetRemoteContainerStatus(), container.GetAllocatedNode()));
                container.rmContext.GetRMApplicationHistoryWriter().ContainerFinished(container);
                bool saveNonAMContainerMetaInfo = container.rmContext.GetYarnConfiguration().GetBoolean
                                                      (YarnConfiguration.ApplicationHistorySaveNonAmContainerMetaInfo, YarnConfiguration
                                                      .DefaultApplicationHistorySaveNonAmContainerMetaInfo);

                if (saveNonAMContainerMetaInfo || container.IsAMContainer())
                {
                    container.rmContext.GetSystemMetricsPublisher().ContainerFinished(container, container
                                                                                      .finishTime);
                }
            }
Exemplo n.º 8
0
 public override void Transition(RMContainerImpl container, RMContainerEvent @event
                                 )
 {
     // Unregister from containerAllocationExpirer.
     container.containerAllocationExpirer.Unregister(container.GetContainerId());
 }
Exemplo n.º 9
0
 public override void Transition(RMContainerImpl container, RMContainerEvent @event
                                 )
 {
     container.eventHandler.Handle(new RMAppAttemptEvent(container.appAttemptId, RMAppAttemptEventType
                                                         .ContainerAllocated));
 }