protected internal virtual void ReleaseContainers(IList <ContainerId> containers, SchedulerApplicationAttempt attempt) { foreach (ContainerId containerId in containers) { RMContainer rmContainer = GetRMContainer(containerId); if (rmContainer == null) { if (Runtime.CurrentTimeMillis() - ResourceManager.GetClusterTimeStamp() < nmExpireInterval) { Log.Info(containerId + " doesn't exist. Add the container" + " to the release request cache as it maybe on recovery." ); lock (attempt) { attempt.GetPendingRelease().AddItem(containerId); } } else { RMAuditLogger.LogFailure(attempt.GetUser(), RMAuditLogger.AuditConstants.ReleaseContainer , "Unauthorized access or invalid container", "Scheduler", "Trying to release container not owned by app or with invalid id." , attempt.GetApplicationId(), containerId); } } CompletedContainer(rmContainer, SchedulerUtils.CreateAbnormalContainerStatus(containerId , SchedulerUtils.ReleasedContainer), RMContainerEventType.Released); } }
public static bool IsBlacklisted(SchedulerApplicationAttempt application, SchedulerNode node, Log Log) { if (application.IsBlacklisted(node.GetNodeName())) { if (Log.IsDebugEnabled()) { Log.Debug("Skipping 'host' " + node.GetNodeName() + " for " + application.GetApplicationId () + " since it has been blacklisted"); } return(true); } if (application.IsBlacklisted(node.GetRackName())) { if (Log.IsDebugEnabled()) { Log.Debug("Skipping 'rack' " + node.GetRackName() + " for " + application.GetApplicationId () + " since it has been blacklisted"); } return(true); } return(false); }