public AppAttemptInfo(ResourceManager rm, RMAppAttempt attempt, string user, string schemePrefix) { this.startTime = 0; this.containerId = string.Empty; this.nodeHttpAddress = string.Empty; this.nodeId = string.Empty; this.logsLink = string.Empty; this.blacklistedNodes = string.Empty; if (attempt != null) { this.id = attempt.GetAppAttemptId().GetAttemptId(); this.startTime = attempt.GetStartTime(); Container masterContainer = attempt.GetMasterContainer(); if (masterContainer != null) { this.containerId = masterContainer.GetId().ToString(); this.nodeHttpAddress = masterContainer.GetNodeHttpAddress(); this.nodeId = masterContainer.GetNodeId().ToString(); this.logsLink = WebAppUtils.GetRunningLogURL(schemePrefix + masterContainer.GetNodeHttpAddress (), ConverterUtils.ToString(masterContainer.GetId()), user); if (rm.GetResourceScheduler() is AbstractYarnScheduler) { AbstractYarnScheduler ayScheduler = (AbstractYarnScheduler)rm.GetResourceScheduler (); SchedulerApplicationAttempt sattempt = ayScheduler.GetApplicationAttempt(attempt. GetAppAttemptId()); if (sattempt != null) { blacklistedNodes = StringUtils.Join(sattempt.GetBlacklistedNodes(), ", "); } } } } }
public static ICollection <string> GetBlacklistedNodes(ResourceManager rm, ApplicationAttemptId appid) { if (rm.GetResourceScheduler() is AbstractYarnScheduler) { AbstractYarnScheduler ayScheduler = (AbstractYarnScheduler)rm.GetResourceScheduler (); SchedulerApplicationAttempt attempt = ayScheduler.GetApplicationAttempt(appid); if (attempt != null) { return(attempt.GetBlacklistedNodes()); } } return(null); }