本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler.getApplicationAttempt方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractYarnScheduler.getApplicationAttempt方法的具体用法?Java AbstractYarnScheduler.getApplicationAttempt怎么用?Java AbstractYarnScheduler.getApplicationAttempt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler
的用法示例。
在下文中一共展示了AbstractYarnScheduler.getApplicationAttempt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: waitForNumContainersToRecover
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler; //导入方法依赖的package包/类
public static void waitForNumContainersToRecover(int num, MockRM rm,
ApplicationAttemptId attemptId) throws Exception {
AbstractYarnScheduler scheduler =
(AbstractYarnScheduler) rm.getResourceScheduler();
SchedulerApplicationAttempt attempt =
scheduler.getApplicationAttempt(attemptId);
while (attempt == null) {
System.out.println("Wait for scheduler attempt " + attemptId
+ " to be created");
Thread.sleep(200);
attempt = scheduler.getApplicationAttempt(attemptId);
}
while (attempt.getLiveContainers().size() < num) {
System.out.println("Wait for " + num
+ " containers to recover. currently: "
+ attempt.getLiveContainers().size());
Thread.sleep(200);
}
}
示例2: waitForNumContainersToRecover
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public static void waitForNumContainersToRecover(int num, MockRM rm,
ApplicationAttemptId attemptId) throws Exception {
AbstractYarnScheduler scheduler =
(AbstractYarnScheduler) rm.getResourceScheduler();
SchedulerApplicationAttempt attempt =
scheduler.getApplicationAttempt(attemptId);
while (attempt == null) {
System.out.println("Wait for scheduler attempt " + attemptId
+ " to be created");
Thread.sleep(200);
attempt = scheduler.getApplicationAttempt(attemptId);
}
while (attempt.getLiveContainers().size() < num) {
System.out.println("Wait for " + num
+ " containers to recover. currently: "
+ attempt.getLiveContainers().size());
Thread.sleep(200);
}
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:TestWorkPreservingRMRestartForNodeLabel.java
示例3: waitForNumContainersToRecover
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler; //导入方法依赖的package包/类
public static void waitForNumContainersToRecover(int num, MockRM rm,
ApplicationAttemptId attemptId) throws Exception {
AbstractYarnScheduler scheduler =
(AbstractYarnScheduler) rm.getResourceScheduler();
SchedulerApplicationAttempt attempt =
scheduler.getApplicationAttempt(attemptId);
while (attempt == null) {
LOG.info("Wait for scheduler attempt " + attemptId
+ " to be created");
Thread.sleep(200);
attempt = scheduler.getApplicationAttempt(attemptId);
}
while (attempt.getLiveContainers().size() < num) {
LOG.info("Wait for " + num
+ " containers to recover. currently: "
+ attempt.getLiveContainers().size());
Thread.sleep(200);
}
}
示例4: AppAttemptInfo
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler; //导入方法依赖的package包/类
public AppAttemptInfo(ResourceManager rm, RMAppAttempt attempt, String user,
String schemePrefix) {
this.startTime = 0;
this.containerId = "";
this.nodeHttpAddress = "";
this.nodeId = "";
this.logsLink = "";
this.blacklistedNodes = "";
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() instanceof AbstractYarnScheduler) {
AbstractYarnScheduler ayScheduler =
(AbstractYarnScheduler) rm.getResourceScheduler();
SchedulerApplicationAttempt sattempt =
ayScheduler.getApplicationAttempt(attempt.getAppAttemptId());
if (sattempt != null) {
blacklistedNodes =
StringUtils.join(sattempt.getBlacklistedNodes(), ", ");
}
}
}
}
}
示例5: getBlacklistedNodes
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler; //导入方法依赖的package包/类
public static Set<String> getBlacklistedNodes(ResourceManager rm,
ApplicationAttemptId appid) {
if (rm.getResourceScheduler() instanceof AbstractYarnScheduler) {
AbstractYarnScheduler ayScheduler =
(AbstractYarnScheduler) rm.getResourceScheduler();
SchedulerApplicationAttempt attempt =
ayScheduler.getApplicationAttempt(appid);
if (attempt != null) {
return attempt.getBlacklistedNodes();
}
}
return null;
}
示例6: AppAttemptInfo
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler; //导入方法依赖的package包/类
public AppAttemptInfo(ResourceManager rm, RMAppAttempt attempt, String user,
String schemePrefix) {
this.startTime = 0;
this.containerId = "";
this.nodeHttpAddress = "";
this.nodeId = "";
this.logsLink = "";
this.blacklistedNodes = "";
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(),
masterContainer.getId().toString(), user);
nodesBlacklistedBySystem =
StringUtils.join(attempt.getAMBlacklistManager()
.getBlacklistUpdates().getBlacklistAdditions(), ", ");
if (rm.getResourceScheduler() instanceof AbstractYarnScheduler) {
AbstractYarnScheduler ayScheduler =
(AbstractYarnScheduler) rm.getResourceScheduler();
SchedulerApplicationAttempt sattempt =
ayScheduler.getApplicationAttempt(attempt.getAppAttemptId());
if (sattempt != null) {
blacklistedNodes =
StringUtils.join(sattempt.getBlacklistedNodes(), ", ");
}
}
}
}
}
示例7: getBlacklistedNodes
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler; //导入方法依赖的package包/类
@Override
public Set<String> getBlacklistedNodes() {
if (scheduler instanceof AbstractYarnScheduler) {
AbstractYarnScheduler ayScheduler =
(AbstractYarnScheduler) scheduler;
SchedulerApplicationAttempt attempt =
ayScheduler.getApplicationAttempt(applicationAttemptId);
if (attempt != null) {
return attempt.getBlacklistedNodes();
}
}
return Collections.EMPTY_SET;
}