• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RMAppAttemptContainerFinishedEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent的典型用法代码示例。如果您正苦于以下问题:Java RMAppAttemptContainerFinishedEvent类的具体用法?Java RMAppAttemptContainerFinishedEvent怎么用?Java RMAppAttemptContainerFinishedEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RMAppAttemptContainerFinishedEvent类属于org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event包,在下文中一共展示了RMAppAttemptContainerFinishedEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: transition

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Override
public void transition(RMContainerImpl container, RMContainerEvent event) {
  RMContainerFinishedEvent finishedEvent = (RMContainerFinishedEvent) event;

  container.finishTime = System.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);
  container.rmContext.getSystemMetricsPublisher().containerFinished(
      container, container.finishTime);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:RMContainerImpl.java


示例2: transition

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Override
public void transition(RMAppAttemptImpl appAttempt,
    RMAppAttemptEvent event) {
  RMAppAttemptContainerFinishedEvent finishEvent =
      ((RMAppAttemptContainerFinishedEvent)event);

  // UnRegister from AMLivelinessMonitor
  appAttempt.rmContext.getAMLivelinessMonitor().unregister(
      appAttempt.getAppAttemptId());

  // Setup diagnostic message and exit status
  appAttempt.setAMContainerCrashedDiagnosticsAndExitStatus(finishEvent);

  // Tell the app, scheduler
  super.transition(appAttempt, finishEvent);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:RMAppAttemptImpl.java


示例3: getAMContainerCrashedDiagnostics

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
private String getAMContainerCrashedDiagnostics(
    RMAppAttemptContainerFinishedEvent finishEvent) {
  ContainerStatus status = finishEvent.getContainerStatus();
  StringBuilder diagnosticsBuilder = new StringBuilder();
  diagnosticsBuilder.append("AM Container for ").append(
    finishEvent.getApplicationAttemptId()).append(
    " exited with ").append(" exitCode: ").append(status.getExitStatus()).
    append("\n");
  if (this.getTrackingUrl() != null) {
    diagnosticsBuilder.append("For more detailed output,").append(
      " check application tracking page:").append(
      this.getTrackingUrl()).append(
      "Then, click on links to logs of each attempt.\n");
  }
  diagnosticsBuilder.append("Diagnostics: ").append(status.getDiagnostics())
      .append("Failing this attempt");
  return diagnosticsBuilder.toString();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:RMAppAttemptImpl.java


示例4: testAMCrashAtScheduled

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Test
public void testAMCrashAtScheduled() {
  // This is to test sending CONTAINER_FINISHED event at SCHEDULED state.
  // Verify the state transition is correct.
  scheduleApplicationAttempt();
  ContainerStatus cs =
      SchedulerUtils.createAbnormalContainerStatus(
          BuilderUtils.newContainerId(
              applicationAttempt.getAppAttemptId(), 1),
          SchedulerUtils.LOST_CONTAINER);
  // send CONTAINER_FINISHED event at SCHEDULED state,
  // The state should be FINAL_SAVING with previous state SCHEDULED
  NodeId anyNodeId = NodeId.newInstance("host", 1234);
  applicationAttempt.handle(new RMAppAttemptContainerFinishedEvent(
      applicationAttempt.getAppAttemptId(), cs, anyNodeId));
  // createApplicationAttemptState will return previous state (SCHEDULED),
  // if the current state is FINAL_SAVING.
  assertEquals(YarnApplicationAttemptState.SCHEDULED,
      applicationAttempt.createApplicationAttemptState());
  // send ATTEMPT_UPDATE_SAVED event,
  // verify the state is changed to state FAILED.
  sendAttemptUpdateSavedEvent(applicationAttempt);
  assertEquals(RMAppAttemptState.FAILED,
      applicationAttempt.getAppAttemptState());
  verifyApplicationAttemptFinished(RMAppAttemptState.FAILED);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:TestRMAppAttemptTransitions.java


示例5: testAMCrashAtAllocated

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Test
public void testAMCrashAtAllocated() {
  Container amContainer = allocateApplicationAttempt();
  String containerDiagMsg = "some error";
  int exitCode = 123;
  ContainerStatus cs =
      BuilderUtils.newContainerStatus(amContainer.getId(),
        ContainerState.COMPLETE, containerDiagMsg, exitCode);
  NodeId anyNodeId = NodeId.newInstance("host", 1234);
  applicationAttempt.handle(new RMAppAttemptContainerFinishedEvent(
    applicationAttempt.getAppAttemptId(), cs, anyNodeId));
  assertEquals(YarnApplicationAttemptState.ALLOCATED,
      applicationAttempt.createApplicationAttemptState());
  sendAttemptUpdateSavedEvent(applicationAttempt);
  assertEquals(RMAppAttemptState.FAILED,
    applicationAttempt.getAppAttemptState());
  verifyTokenCount(applicationAttempt.getAppAttemptId(), 1);
  verifyApplicationAttemptFinished(RMAppAttemptState.FAILED);
  boolean shouldCheckURL = (applicationAttempt.getTrackingUrl() != null);
  verifyAMCrashAtAllocatedDiagnosticInfo(applicationAttempt.getDiagnostics(),
    exitCode, shouldCheckURL);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:TestRMAppAttemptTransitions.java


示例6: testFinishingToFinishing

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Test
public void testFinishingToFinishing() {
  Container amContainer = allocateApplicationAttempt();
  launchApplicationAttempt(amContainer);
  runApplicationAttempt(amContainer, "host", 8042, "oldtrackingurl", false);
  FinalApplicationStatus finalStatus = FinalApplicationStatus.SUCCEEDED;
  String trackingUrl = "mytrackingurl";
  String diagnostics = "Successful";
  unregisterApplicationAttempt(amContainer, finalStatus, trackingUrl,
      diagnostics);
  // container must be AM container to move from FINISHING to FINISHED
  NodeId anyNodeId = NodeId.newInstance("host", 1234);
  applicationAttempt.handle(
      new RMAppAttemptContainerFinishedEvent(
          applicationAttempt.getAppAttemptId(),
          BuilderUtils.newContainerStatus(
              BuilderUtils.newContainerId(
                  applicationAttempt.getAppAttemptId(), 42),
              ContainerState.COMPLETE, "", 0), anyNodeId));
  testAppAttemptFinishingState(amContainer, finalStatus, trackingUrl,
      diagnostics);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:TestRMAppAttemptTransitions.java


示例7: testSuccessfulFinishingToFinished

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Test
public void testSuccessfulFinishingToFinished() {
  Container amContainer = allocateApplicationAttempt();
  launchApplicationAttempt(amContainer);
  runApplicationAttempt(amContainer, "host", 8042, "oldtrackingurl", false);
  FinalApplicationStatus finalStatus = FinalApplicationStatus.SUCCEEDED;
  String trackingUrl = "mytrackingurl";
  String diagnostics = "Successful";
  unregisterApplicationAttempt(amContainer, finalStatus, trackingUrl,
      diagnostics);
  NodeId anyNodeId = NodeId.newInstance("host", 1234);
  applicationAttempt.handle(
      new RMAppAttemptContainerFinishedEvent(
          applicationAttempt.getAppAttemptId(),
          BuilderUtils.newContainerStatus(amContainer.getId(),
              ContainerState.COMPLETE, "", 0), anyNodeId));
  testAppAttemptFinishedState(amContainer, finalStatus, trackingUrl,
      diagnostics, 0, false);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestRMAppAttemptTransitions.java


示例8: getAMContainerCrashedDiagnostics

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
private String getAMContainerCrashedDiagnostics(
    RMAppAttemptContainerFinishedEvent finishEvent) {
  ContainerStatus status = finishEvent.getContainerStatus();
  StringBuilder diagnosticsBuilder = new StringBuilder();
  diagnosticsBuilder.append("AM Container for ").append(
    finishEvent.getApplicationAttemptId()).append(
    " exited with ").append(" exitCode: ").append(status.getExitStatus()).
    append("\n");
  diagnosticsBuilder.append("Failing this attempt.").append("Diagnostics: ")
      .append(status.getDiagnostics());
  if (this.getTrackingUrl() != null) {
    diagnosticsBuilder.append("For more detailed output,").append(
      " check the application tracking page: ").append(
      this.getTrackingUrl()).append(
      " Then click on links to logs of each attempt.\n");
  }
  return diagnosticsBuilder.toString();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:19,代码来源:RMAppAttemptImpl.java


示例9: sendAMContainerToNM

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
private void sendAMContainerToNM(RMAppAttemptImpl appAttempt,
    RMAppAttemptContainerFinishedEvent containerFinishedEvent) {
  NodeId nodeId = containerFinishedEvent.getNodeId();
  if (containerFinishedEvent.getContainerStatus() != null) {
    if (shouldCountTowardsNodeBlacklisting(containerFinishedEvent
        .getContainerStatus().getExitStatus())) {
      appAttempt.addAMNodeToBlackList(containerFinishedEvent.getNodeId());
    }
  } else {
    LOG.warn("No ContainerStatus in containerFinishedEvent");
  }
  finishedContainersSentToAM.putIfAbsent(nodeId,
    new ArrayList<ContainerStatus>());
  appAttempt.finishedContainersSentToAM.get(nodeId).add(
    containerFinishedEvent.getContainerStatus());

  if (!appAttempt.getSubmissionContext()
    .getKeepContainersAcrossApplicationAttempts()) {
    appAttempt.sendFinishedContainersToNM();
  } else {
    appAttempt.sendFinishedAMContainerToNM(nodeId,
        containerFinishedEvent.getContainerStatus().getContainerId());
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:25,代码来源:RMAppAttemptImpl.java


示例10: testAMCrashAtAllocated

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Test
public void testAMCrashAtAllocated() {
  Container amContainer = allocateApplicationAttempt();
  String containerDiagMsg = "some error";
  int exitCode = 123;
  ContainerStatus cs =
      BuilderUtils.newContainerStatus(amContainer.getId(),
        ContainerState.COMPLETE, containerDiagMsg, exitCode,
        amContainer.getResource());
  NodeId anyNodeId = NodeId.newInstance("host", 1234);
  applicationAttempt.handle(new RMAppAttemptContainerFinishedEvent(
    applicationAttempt.getAppAttemptId(), cs, anyNodeId));
  assertEquals(YarnApplicationAttemptState.ALLOCATED,
      applicationAttempt.createApplicationAttemptState());
  sendAttemptUpdateSavedEvent(applicationAttempt);
  assertEquals(RMAppAttemptState.FAILED,
    applicationAttempt.getAppAttemptState());
  verifyTokenCount(applicationAttempt.getAppAttemptId(), 1);
  verifyApplicationAttemptFinished(RMAppAttemptState.FAILED);
  boolean shouldCheckURL = (applicationAttempt.getTrackingUrl() != null);
  verifyAMCrashAtAllocatedDiagnosticInfo(applicationAttempt.getDiagnostics(),
    exitCode, shouldCheckURL);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:24,代码来源:TestRMAppAttemptTransitions.java


示例11: testFinishingToFinishing

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Test
public void testFinishingToFinishing() {
  Container amContainer = allocateApplicationAttempt();
  launchApplicationAttempt(amContainer);
  runApplicationAttempt(amContainer, "host", 8042, "oldtrackingurl", false);
  FinalApplicationStatus finalStatus = FinalApplicationStatus.SUCCEEDED;
  String trackingUrl = "mytrackingurl";
  String diagnostics = "Successful";
  unregisterApplicationAttempt(amContainer, finalStatus, trackingUrl,
      diagnostics);
  // container must be AM container to move from FINISHING to FINISHED
  NodeId anyNodeId = NodeId.newInstance("host", 1234);
  applicationAttempt.handle(
      new RMAppAttemptContainerFinishedEvent(
          applicationAttempt.getAppAttemptId(),
          BuilderUtils.newContainerStatus(
              BuilderUtils.newContainerId(
                  applicationAttempt.getAppAttemptId(), 42),
              ContainerState.COMPLETE, "", 0,
                  amContainer.getResource()), anyNodeId));
  testAppAttemptFinishingState(amContainer, finalStatus, trackingUrl,
      diagnostics);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:24,代码来源:TestRMAppAttemptTransitions.java


示例12: testSuccessfulFinishingToFinished

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Test
public void testSuccessfulFinishingToFinished() {
  Container amContainer = allocateApplicationAttempt();
  launchApplicationAttempt(amContainer);
  runApplicationAttempt(amContainer, "host", 8042, "oldtrackingurl", false);
  FinalApplicationStatus finalStatus = FinalApplicationStatus.SUCCEEDED;
  String trackingUrl = "mytrackingurl";
  String diagnostics = "Successful";
  unregisterApplicationAttempt(amContainer, finalStatus, trackingUrl,
      diagnostics);
  NodeId anyNodeId = NodeId.newInstance("host", 1234);
  applicationAttempt.handle(
      new RMAppAttemptContainerFinishedEvent(
          applicationAttempt.getAppAttemptId(),
          BuilderUtils.newContainerStatus(amContainer.getId(),
              ContainerState.COMPLETE, "", 0,
                  amContainer.getResource()), anyNodeId));
  testAppAttemptFinishedState(amContainer, finalStatus, trackingUrl,
      diagnostics, 0, false);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:TestRMAppAttemptTransitions.java


示例13: transition

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Override
public void transition(RMAppAttemptImpl appAttempt,
    RMAppAttemptEvent event) {

  RMAppAttemptContainerFinishedEvent finishEvent =
      ((RMAppAttemptContainerFinishedEvent)event);

  // UnRegister from AMLivelinessMonitor
  appAttempt.rmContext.getAMLivelinessMonitor().unregister(
      appAttempt.getAppAttemptId());

  // Setup diagnostic message
  ContainerStatus status = finishEvent.getContainerStatus();
  appAttempt.diagnostics.append("AM Container for " +
      appAttempt.getAppAttemptId() + " exited with " +
      " exitCode: " + status.getExitStatus() +
      " due to: " +  status.getDiagnostics() + "." +
      "Failing this attempt.");

  // Tell the app, scheduler
  super.transition(appAttempt, finishEvent);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:23,代码来源:RMAppAttemptImpl.java


示例14: testRunningToFailed

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Test
public void testRunningToFailed() {
  Container amContainer = allocateApplicationAttempt();
  launchApplicationAttempt(amContainer);
  runApplicationAttempt(amContainer, "host", 8042, "oldtrackingurl");
  String containerDiagMsg = "some error";
  int exitCode = 123;
  ContainerStatus cs = BuilderUtils.newContainerStatus(amContainer.getId(),
      ContainerState.COMPLETE, containerDiagMsg, exitCode);
  ApplicationAttemptId appAttemptId = applicationAttempt.getAppAttemptId();
  applicationAttempt.handle(new RMAppAttemptContainerFinishedEvent(
      appAttemptId, cs));
  assertEquals(RMAppAttemptState.FAILED,
      applicationAttempt.getAppAttemptState());
  assertEquals(0,applicationAttempt.getJustFinishedContainers().size());
  assertEquals(amContainer, applicationAttempt.getMasterContainer());
  assertEquals(0, applicationAttempt.getRanNodes().size());
  String rmAppPageUrl = pjoin(RM_WEBAPP_ADDR, "cluster", "app",
      applicationAttempt.getAppAttemptId().getApplicationId());
  assertEquals(rmAppPageUrl, applicationAttempt.getOriginalTrackingUrl());
  assertEquals(rmAppPageUrl, applicationAttempt.getTrackingUrl());
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:23,代码来源:TestRMAppAttemptTransitions.java


示例15: testFinishingToFinishing

import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent; //导入依赖的package包/类
@Test
public void testFinishingToFinishing() {
  Container amContainer = allocateApplicationAttempt();
  launchApplicationAttempt(amContainer);
  runApplicationAttempt(amContainer, "host", 8042, "oldtrackingurl");
  FinalApplicationStatus finalStatus = FinalApplicationStatus.SUCCEEDED;
  String trackingUrl = "mytrackingurl";
  String diagnostics = "Successful";
  unregisterApplicationAttempt(amContainer, finalStatus, trackingUrl,
      diagnostics);
  // container must be AM container to move from FINISHING to FINISHED
  applicationAttempt.handle(
      new RMAppAttemptContainerFinishedEvent(
          applicationAttempt.getAppAttemptId(),
          BuilderUtils.newContainerStatus(
              BuilderUtils.newContainerId(
                  applicationAttempt.getAppAttemptId(), 42),
              ContainerState.COMPLETE, "", 0)));
  testAppAttemptFinishingState(amContainer, finalStatus, trackingUrl,
      diagnostics);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:22,代码来源:TestRMAppAttemptTransitions.java



注:本文中的org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LogicalTableModify类代码示例发布时间:2022-05-22
下一篇:
Java DependencySet类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap