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)); }
private static void UpdateAttemptMetrics(RMContainerImpl container) { // If this is a preempted container, update preemption metrics Resource resource = container.GetContainer().GetResource(); RMAppAttempt rmAttempt = container.rmContext.GetRMApps()[container.GetApplicationAttemptId ().GetApplicationId()].GetCurrentAppAttempt(); if (ContainerExitStatus.Preempted == container.finishedStatus.GetExitStatus()) { rmAttempt.GetRMAppAttemptMetrics().UpdatePreemptionInfo(resource, container); } if (rmAttempt != null) { long usedMillis = container.finishTime - container.creationTime; long memorySeconds = resource.GetMemory() * usedMillis / DateUtils.MillisPerSecond; long vcoreSeconds = resource.GetVirtualCores() * usedMillis / DateUtils.MillisPerSecond; rmAttempt.GetRMAppAttemptMetrics().UpdateAggregateAppResourceUsage(memorySeconds, vcoreSeconds); } }