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

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

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

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

private void sendStartedEvent(RMNode node) {
 ((RMNodeImpl) node)
   .handle(new RMNodeStartedEvent(node.getNodeID(), null, null));
}
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 (timeout = 5000)
public void testContainerUpdate() throws InterruptedException{
 node.handle(new RMNodeStartedEvent(null, null, null));
 node2.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: 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

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

private RMNodeImpl getRebootedNode() {
 NodeId nodeId = BuilderUtils.newNodeId("localhost", 0);
 Resource capability = Resource.newInstance(4096, 4);
 RMNodeImpl node = new RMNodeImpl(nodeId, rmContext,null, 0, 0,
   null, capability, null);
 node.handle(new RMNodeStartedEvent(node.getNodeID(), null, null));
 Assert.assertEquals(NodeState.RUNNING, node.getState());
 node.handle(new RMNodeEvent(node.getNodeID(), RMNodeEventType.REBOOTING));
 Assert.assertEquals(NodeState.REBOOTED, node.getState());
 return node;
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

new RMNodeStartedEvent(newNode.getNodeID(), null, null));
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

new RMNodeStartedEvent(newNode.getNodeID(), null, null));
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

RMNodeImpl node2 = (RMNodeImpl) resourceManager.getRMContext().getRMNodes().get(
  nm2.getNodeId());
node1.handle(new RMNodeStartedEvent(nm1.getNodeId(), null, null));
node2.handle(new RMNodeStartedEvent(nm2.getNodeId(), null, null));
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testAdd() {
 RMNodeImpl node = getNewNode();
 ClusterMetrics cm = ClusterMetrics.getMetrics();
 int initialActive = cm.getNumActiveNMs();
 int initialLost = cm.getNumLostNMs();
 int initialUnhealthy = cm.getUnhealthyNMs();
 int initialDecommissioned = cm.getNumDecommisionedNMs();
 int initialRebooted = cm.getNumRebootedNMs();
 node.handle(new RMNodeStartedEvent(node.getNodeID(), null, null));
 Assert.assertEquals("Active Nodes", initialActive + 1, cm.getNumActiveNMs());
 Assert.assertEquals("Lost Nodes", initialLost, cm.getNumLostNMs());
 Assert.assertEquals("Unhealthy Nodes",
   initialUnhealthy, cm.getUnhealthyNMs());
 Assert.assertEquals("Decommissioned Nodes",
   initialDecommissioned, cm.getNumDecommisionedNMs());
 Assert.assertEquals("Rebooted Nodes",
   initialRebooted, cm.getNumRebootedNMs());
 Assert.assertEquals(NodeState.RUNNING, node.getState());
 Assert.assertNotNull(nodesListManagerEvent);
 Assert.assertEquals(NodesListManagerEventType.NODE_USABLE, 
   nodesListManagerEvent.getType());
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testAdd() {
 RMNodeImpl node = getNewNode();
 ClusterMetrics cm = ClusterMetrics.getMetrics();
 int initialActive = cm.getNumActiveNMs();
 int initialLost = cm.getNumLostNMs();
 int initialUnhealthy = cm.getUnhealthyNMs();
 int initialDecommissioned = cm.getNumDecommisionedNMs();
 int initialRebooted = cm.getNumRebootedNMs();
 node.handle(new RMNodeStartedEvent(node.getNodeID(), null, null));
 Assert.assertEquals("Active Nodes", initialActive + 1, cm.getNumActiveNMs());
 Assert.assertEquals("Lost Nodes", initialLost, cm.getNumLostNMs());
 Assert.assertEquals("Unhealthy Nodes",
   initialUnhealthy, cm.getUnhealthyNMs());
 Assert.assertEquals("Decommissioned Nodes",
   initialDecommissioned, cm.getNumDecommisionedNMs());
 Assert.assertEquals("Rebooted Nodes",
   initialRebooted, cm.getNumRebootedNMs());
 Assert.assertEquals(NodeState.RUNNING, node.getState());
 Assert.assertNotNull(nodesListManagerEvent);
 Assert.assertEquals(NodesListManagerEventType.NODE_USABLE, 
   nodesListManagerEvent.getType());
}
org.apache.hadoop.yarn.server.resourcemanager.rmnodeRMNodeStartedEvent<init>

Popular methods of RMNodeStartedEvent

  • getNMContainerStatuses
  • getRunningApplications
  • getLogAggregationReportsForApps
  • setLogAggregationReportsForApps

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JLabel (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • CodeWhisperer alternatives
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