当前位置: 首页>>代码示例>>Java>>正文


Java RMAppAttemptContainerFinishedEvent类代码示例

本文整理汇总了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;未经允许,请勿转载。