Codota Logo
RMNodeStartedEvent
Code IndexAdd Codota to your IDE (free)

How to use
RMNodeStartedEvent
in
org.apache.hadoop.yarn.server.resourcemanager.rmnode

Best Java code snippets using org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeStartedEvent (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private void sendStartedEvent(RMNode node) {
 ((RMNodeImpl) node)
   .handle(new RMNodeStartedEvent(node.getNodeID(), null, null));
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

 containers = startEvent.getNMContainerStatuses();
 if (containers != null && !containers.isEmpty()) {
  for (NMContainerStatus container : containers) {
if (null != startEvent.getRunningApplications()) {
 for (ApplicationId appId : startEvent.getRunningApplications()) {
  handleRunningAppOnNode(rmNode, rmNode.context, appId, rmNode.nodeId);
   NodesListManagerEventType.NODE_USABLE, rmNode));
List<LogAggregationReport> logAggregationReportsForApps =
  startEvent.getLogAggregationReportsForApps();
if (logAggregationReportsForApps != null
  && !logAggregationReportsForApps.isEmpty()) {
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

RMNodeStartedEvent startEvent = new RMNodeStartedEvent(nodeId,
  request.getNMContainerStatuses(),
  request.getRunningApplications());
    + request.getLogAggregationReportsForApps().size());
 startEvent.setLogAggregationReportsForApps(request
   .getLogAggregationReportsForApps());
   .handle(new RMNodeStartedEvent(nodeId, null, null));
} else {
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private static List<NMContainerStatus> updateNewNodeMetricsAndContainers(
  RMNodeImpl rmNode, RMNodeStartedEvent startEvent) {
 List<NMContainerStatus> containers;
 ClusterMetrics.getMetrics().incrNumActiveNodes();
 containers = startEvent.getNMContainerStatuses();
 if (containers != null && !containers.isEmpty()) {
  for (NMContainerStatus container : containers) {
   if (container.getContainerState() == ContainerState.RUNNING) {
    rmNode.launchedContainers.add(container.getContainerId());
   }
  }
 }
 return containers;
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

if (null != startEvent.getRunningApplications()) {
 for (ApplicationId appId : startEvent.getRunningApplications()) {
  handleRunningAppOnNode(rmNode, rmNode.context, appId, rmNode.nodeId);
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

private static List<NMContainerStatus> updateNewNodeMetricsAndContainers(
  RMNodeImpl rmNode, RMNodeStartedEvent startEvent) {
 List<NMContainerStatus> containers;
 ClusterMetrics.getMetrics().incrNumActiveNodes();
 containers = startEvent.getNMContainerStatuses();
 if (containers != null && !containers.isEmpty()) {
  for (NMContainerStatus container : containers) {
   if (container.getContainerState() == ContainerState.RUNNING) {
    rmNode.launchedContainers.add(container.getContainerId());
   }
  }
 }
 return containers;
}
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

if (null != startEvent.getRunningApplications()) {
 for (ApplicationId appId : startEvent.getRunningApplications()) {
  handleRunningAppOnNode(rmNode, rmNode.context, appId, rmNode.nodeId);
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

public void sendNodeStarted(MockNM nm) throws Exception {
 RMNodeImpl node = (RMNodeImpl) getRMContext().getRMNodes().get(
   nm.getNodeId());
 node.handle(new RMNodeStartedEvent(nm.getNodeId(), null, null));
}

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

@Test (timeout = 5000)
public void testExpiredContainer() {
 // Start the node
 node.handle(new RMNodeStartedEvent(null, null, null));
 verify(scheduler).handle(any(NodeAddedSchedulerEvent.class));
 
 // Expire a container
 ContainerId completedContainerId = BuilderUtils.newContainerId(
   BuilderUtils.newApplicationAttemptId(
     BuilderUtils.newApplicationId(0, 0), 0), 0);
 node.handle(new RMNodeCleanContainerEvent(null, completedContainerId));
 Assert.assertEquals(1, node.getContainersToCleanUp().size());
 
 // Now verify that scheduler isn't notified of an expired container
 // by checking number of 'completedContainers' it got in the previous event
 RMNodeStatusEvent statusEvent = getMockRMNodeStatusEvent();
 ContainerStatus containerStatus = mock(ContainerStatus.class);
 doReturn(completedContainerId).when(containerStatus).getContainerId();
 doReturn(Collections.singletonList(containerStatus)).
   when(statusEvent).getContainers();
 node.handle(statusEvent);
 /* Expect the scheduler call handle function 2 times
  * 1. RMNode status from new to Running, handle the add_node event
  * 2. handle the node update event
  */
 verify(scheduler,times(2)).handle(any(NodeUpdateSchedulerEvent.class));     
}

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

@Test (timeout = 5000)
public void testExpiredContainer() {
 // Start the node
 node.handle(new RMNodeStartedEvent(null, null, null));
 verify(scheduler).handle(any(NodeAddedSchedulerEvent.class));
 
 // Expire a container
 ContainerId completedContainerId = BuilderUtils.newContainerId(
   BuilderUtils.newApplicationAttemptId(
     BuilderUtils.newApplicationId(0, 0), 0), 0);
 node.handle(new RMNodeCleanContainerEvent(null, completedContainerId));
 Assert.assertEquals(1, node.getContainersToCleanUp().size());
 
 // Now verify that scheduler isn't notified of an expired container
 // by checking number of 'completedContainers' it got in the previous event
 RMNodeStatusEvent statusEvent = getMockRMNodeStatusEvent(null);
 ContainerStatus containerStatus = mock(ContainerStatus.class);
 doReturn(completedContainerId).when(containerStatus).getContainerId();
 doReturn(Collections.singletonList(containerStatus)).
   when(statusEvent).getContainers();
 node.handle(statusEvent);
 /* Expect the scheduler call handle function 2 times
  * 1. RMNode status from new to Running, handle the add_node event
  * 2. handle the node update event
  */
 verify(scheduler,times(2)).handle(any(NodeUpdateSchedulerEvent.class));     
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

public void sendNodeStarted(MockNM nm) throws Exception {
 RMNodeImpl node = (RMNodeImpl) getRMContext().getRMNodes().get(
   nm.getNodeId());
 node.handle(new RMNodeStartedEvent(nm.getNodeId(), null, null));
 drainEventsImplicitly();
}

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

@Test (timeout = 5000)
public void testStatusChange(){
 node.handle(new RMNodeStartedEvent(null, null, null));
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Test (timeout = 5000)
public void testStatusChange(){
 node.handle(new RMNodeStartedEvent(null, null, null));
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testForHandlingDuplicatedCompltedContainers() {
 node.handle(new RMNodeStartedEvent(null, null, null));
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test (timeout = 5000)
public void testContainerUpdate() throws InterruptedException{
 node.handle(new RMNodeStartedEvent(null, null, null));
 node2.handle(new RMNodeStartedEvent(null, null, null));
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Test (timeout = 5000)
public void testContainerUpdate() throws InterruptedException{
 node.handle(new RMNodeStartedEvent(null, null, null));
 node2.handle(new RMNodeStartedEvent(null, null, null));
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private RMNodeImpl getRunningNode(String nmVersion) {
 NodeId nodeId = BuilderUtils.newNodeId("localhost", 0);
 Resource capability = Resource.newInstance(4096, 4);
 RMNodeImpl node = new RMNodeImpl(nodeId, rmContext,null, 0, 0,
   null, capability, nmVersion);
 node.handle(new RMNodeStartedEvent(node.getNodeID(), null, null));
 Assert.assertEquals(NodeState.RUNNING, node.getState());
 return node;
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private RMNodeImpl getRunningNode(String nmVersion, int port) {
 NodeId nodeId = BuilderUtils.newNodeId("localhost", port);
 Resource capability = Resource.newInstance(4096, 4);
 RMNodeImpl node = new RMNodeImpl(nodeId, rmContext, null, 0, 0, null,
   capability, nmVersion);
 node.handle(new RMNodeStartedEvent(node.getNodeID(), null, null));
 Assert.assertEquals(NodeState.RUNNING, node.getState());
 return node;
}
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

if (oldNode == null) {
 this.rmContext.getDispatcher().getEventHandler().handle(
     new RMNodeStartedEvent(nodeId, request.getNMContainerStatuses(),
       request.getRunningApplications()));
} else {
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

if (oldNode == null) {
 this.rmContext.getDispatcher().getEventHandler().handle(
     new RMNodeStartedEvent(nodeId, request.getNMContainerStatuses(),
       request.getRunningApplications()));
} else {
org.apache.hadoop.yarn.server.resourcemanager.rmnodeRMNodeStartedEvent

Most used methods

  • <init>
  • getNMContainerStatuses
  • getRunningApplications
  • getLogAggregationReportsForApps
  • setLogAggregationReportsForApps

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now