Tabnine Logo
RMAppRunningOnNodeEvent.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppRunningOnNodeEvent
constructor

Best Java code snippets using org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppRunningOnNodeEvent.<init> (Showing top 14 results out of 315)

origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

private static void handleRunningAppOnNode(RMNodeImpl rmNode,
  RMContext context, ApplicationId appId, NodeId nodeId) {
 RMApp app = context.getRMApps().get(appId);
 // if we failed getting app by appId, maybe something wrong happened, just
 // add the app to the finishedApplications list so that the app can be
 // cleaned up on the NM
 if (null == app) {
  LOG.warn("Cannot get RMApp by appId=" + appId
    + ", just added it to finishedApplications list for cleanup");
  rmNode.finishedApplications.add(appId);
  return;
 }
 context.getDispatcher().getEventHandler()
   .handle(new RMAppRunningOnNodeEvent(appId, nodeId));
}

origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private static void handleRunningAppOnNode(RMNodeImpl rmNode,
  RMContext context, ApplicationId appId, NodeId nodeId) {
 RMApp app = context.getRMApps().get(appId);
 // if we failed getting app by appId, maybe something wrong happened, just
 // add the app to the finishedApplications list so that the app can be
 // cleaned up on the NM
 if (null == app) {
  LOG.warn("Cannot get RMApp by appId=" + appId
    + ", just added it to finishedApplications list for cleanup");
  rmNode.finishedApplications.add(appId);
  rmNode.runningApplications.remove(appId);
  return;
 }
 // Add running applications back due to Node add or Node reconnection.
 rmNode.runningApplications.add(appId);
 context.getDispatcher().getEventHandler()
   .handle(new RMAppRunningOnNodeEvent(appId, nodeId));
}

origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private static void handleRunningAppOnNode(RMNodeImpl rmNode,
  RMContext context, ApplicationId appId, NodeId nodeId) {
 RMApp app = context.getRMApps().get(appId);
 // if we failed getting app by appId, maybe something wrong happened, just
 // add the app to the finishedApplications list so that the app can be
 // cleaned up on the NM
 if (null == app) {
  LOG.warn("Cannot get RMApp by appId=" + appId
    + ", just added it to finishedApplications list for cleanup");
  rmNode.finishedApplications.add(appId);
  return;
 }
 context.getDispatcher().getEventHandler()
   .handle(new RMAppRunningOnNodeEvent(appId, nodeId));
}

origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

 @Override
 public void transition(RMContainerImpl container, RMContainerEvent event) {
  // Clear ResourceRequest stored in RMContainer
  container.setResourceRequests(null);
  
  // Register with containerAllocationExpirer.
  container.containerAllocationExpirer.register(container.getContainerId());
  // Tell the app
  container.eventHandler.handle(new RMAppRunningOnNodeEvent(container
    .getApplicationAttemptId().getApplicationId(), container.nodeId));
 }
}
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

 @Override
 public void transition(RMContainerImpl container, RMContainerEvent event) {
  // Clear ResourceRequest stored in RMContainer
  container.setResourceRequests(null);
  
  // Register with containerAllocationExpirer.
  container.containerAllocationExpirer.register(container.getContainerId());
  // Tell the app
  container.eventHandler.handle(new RMAppRunningOnNodeEvent(container
    .getApplicationAttemptId().getApplicationId(), container.nodeId));
 }
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

 @Override
 public void transition(RMContainerImpl container, RMContainerEvent event) {
  // Clear ResourceRequest stored in RMContainer, we don't need to remember
  // this anymore.
  container.setContainerRequest(null);
  
  // Register with containerAllocationExpirer.
  container.containerAllocationExpirer.register(
    new AllocationExpirationInfo(container.getContainerId()));
  // Tell the app
  container.eventHandler.handle(new RMAppRunningOnNodeEvent(container
    .getApplicationAttemptId().getApplicationId(), container.nodeId));
  publishNonAMContainerEventstoATS(container);
 }
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private void testUnmanagedAMSuccess(String url) {
 unmanagedAM = true;
 when(submissionContext.getUnmanagedAM()).thenReturn(true);
 // submit AM and check it goes to LAUNCHED state
 scheduleApplicationAttempt();
 testAppAttemptLaunchedState(null);
 verify(amLivelinessMonitor, times(1)).register(
   applicationAttempt.getAppAttemptId());
 // launch AM
 runApplicationAttempt(null, "host", 8042, url, true);
 // complete a container
 Container container = mock(Container.class);
 when(container.getNodeId()).thenReturn(NodeId.newInstance("host", 1234));
 application.handle(new RMAppRunningOnNodeEvent(application.getApplicationId(),
   container.getNodeId()));
 applicationAttempt.handle(new RMAppAttemptContainerFinishedEvent(
   applicationAttempt.getAppAttemptId(), mock(ContainerStatus.class),
   container.getNodeId()));
 // complete AM
 String diagnostics = "Successful";
 FinalApplicationStatus finalStatus = FinalApplicationStatus.SUCCEEDED;
 applicationAttempt.handle(new RMAppAttemptUnregistrationEvent(
   applicationAttempt.getAppAttemptId(), url, finalStatus,
   diagnostics));
 testAppAttemptFinishedState(null, finalStatus, url, diagnostics, 1,
   true);
 assertFalse(transferStateFromPreviousAttempt);
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

when(container1.getNodeId()).thenReturn(NodeId.newInstance("host", 1234));
application.handle(new RMAppRunningOnNodeEvent(application
  .getApplicationId(),
  container1.getNodeId()));
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

when(container1.getNodeId()).thenReturn(NodeId.newInstance("host", 1234));
application.handle(new RMAppRunningOnNodeEvent(application
  .getApplicationId(),
  container1.getNodeId()));
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

 @Override
 public RMContainerState transition(RMContainerImpl container,
   RMContainerEvent event) {
  NMContainerStatus report =
    ((RMContainerRecoverEvent) event).getContainerReport();
  if (report.getContainerState().equals(ContainerState.COMPLETE)) {
   ContainerStatus status =
     ContainerStatus.newInstance(report.getContainerId(),
      report.getContainerState(), report.getDiagnostics(),
      report.getContainerExitStatus());
   new FinishedTransition().transition(container,
    new RMContainerFinishedEvent(container.containerId, status,
     RMContainerEventType.FINISHED));
   return RMContainerState.COMPLETED;
  } else if (report.getContainerState().equals(ContainerState.RUNNING)) {
   // Tell the app
   container.eventHandler.handle(new RMAppRunningOnNodeEvent(container
     .getApplicationAttemptId().getApplicationId(), container.nodeId));
   return RMContainerState.RUNNING;
  } else {
   // This can never happen.
   LOG.warn("RMContainer received unexpected recover event with container"
     + " state " + report.getContainerState() + " while recovering.");
   return RMContainerState.RUNNING;
  }
 }
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private void testUnmanagedAMSuccess(String url) {
 unmanagedAM = true;
 when(submissionContext.getUnmanagedAM()).thenReturn(true);
 // submit AM and check it goes to LAUNCHED state
 scheduleApplicationAttempt();
 testAppAttemptLaunchedState(null, RMAppAttemptState.LAUNCHED);
 verify(amLivelinessMonitor, times(1)).register(
   applicationAttempt.getAppAttemptId());
 // launch AM
 runApplicationAttempt(null, "host", 8042, url, true);
 // complete a container
 Container container = mock(Container.class);
 when(container.getNodeId()).thenReturn(NodeId.newInstance("host", 1234));
 application.handle(new RMAppRunningOnNodeEvent(application.getApplicationId(),
   container.getNodeId()));
 applicationAttempt.handle(new RMAppAttemptContainerFinishedEvent(
   applicationAttempt.getAppAttemptId(), mock(ContainerStatus.class),
   container.getNodeId()));
 // complete AM
 String diagnostics = "Successful";
 FinalApplicationStatus finalStatus = FinalApplicationStatus.SUCCEEDED;
 applicationAttempt.handle(new RMAppAttemptUnregistrationEvent(
   applicationAttempt.getAppAttemptId(), url, finalStatus,
   diagnostics));
 sendAttemptUpdateSavedEvent(applicationAttempt);
 testAppAttemptFinishedState(null, finalStatus, url, diagnostics, 1,
   true);
 assertFalse(transferStateFromPreviousAttempt);
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

 @Override
 public RMContainerState transition(RMContainerImpl container,
   RMContainerEvent event) {
  NMContainerStatus report =
    ((RMContainerRecoverEvent) event).getContainerReport();
  if (report.getContainerState().equals(ContainerState.COMPLETE)) {
   ContainerStatus status =
     ContainerStatus.newInstance(report.getContainerId(),
      report.getContainerState(), report.getDiagnostics(),
      report.getContainerExitStatus());
   new FinishedTransition().transition(container,
    new RMContainerFinishedEvent(container.containerId, status,
     RMContainerEventType.FINISHED));
   return RMContainerState.COMPLETED;
  } else if (report.getContainerState().equals(ContainerState.RUNNING)) {
   // Tell the app
   container.eventHandler.handle(new RMAppRunningOnNodeEvent(container
     .getApplicationAttemptId().getApplicationId(), container.nodeId));
   return RMContainerState.RUNNING;
  } else {
   // This can never happen.
   LOG.warn("RMContainer received unexpected recover event with container"
     + " state " + report.getContainerState() + " while recovering.");
   return RMContainerState.RUNNING;
  }
 }
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

} else if (report.getContainerState().equals(ContainerState.RUNNING)) {
 container.eventHandler.handle(new RMAppRunningOnNodeEvent(container
   .getApplicationAttemptId().getApplicationId(), container.nodeId));
 return RMContainerState.RUNNING;
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

  new RMNodeImpl(nodeId1, rmContext, null, 0, 0, null, capability, null);
node1.handle(new RMNodeStartedEvent(nodeId1, null, null));
rmApp.handle(new RMAppRunningOnNodeEvent(this.appId, nodeId1));
  new RMNodeImpl(nodeId2, rmContext, null, 0, 0, null, capability, null);
node2.handle(new RMNodeStartedEvent(node2.getNodeID(), null, null));
rmApp.handle(new RMAppRunningOnNodeEvent(this.appId, nodeId2));
org.apache.hadoop.yarn.server.resourcemanager.rmappRMAppRunningOnNodeEvent<init>

Popular methods of RMAppRunningOnNodeEvent

  • getApplicationId
  • getNodeId

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Collectors (java.util.stream)
  • JOptionPane (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now