Examples of RMNodeImpl


Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

    Assert.assertEquals(NodeState.DECOMMISSIONED, node.getState());
  }

  @Test
  public void testUnhealthyDecommission() {
    RMNodeImpl node = getUnhealthyNode();
    node.handle(new RMNodeEvent(node.getNodeID(),
        RMNodeEventType.DECOMMISSION));
    Assert.assertEquals(NodeState.DECOMMISSIONED, node.getState());
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

    Assert.assertEquals(NodeState.DECOMMISSIONED, node.getState());
  }

  @Test
  public void testRunningRebooting() {
    RMNodeImpl node = getRunningNode();
    node.handle(new RMNodeEvent(node.getNodeID(),
        RMNodeEventType.REBOOTING));
    Assert.assertEquals(NodeState.REBOOTED, node.getState());
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

    Assert.assertEquals(NodeState.REBOOTED, node.getState());
  }

  @Test
  public void testUnhealthyRebooting() {
    RMNodeImpl node = getUnhealthyNode();
    node.handle(new RMNodeEvent(node.getNodeID(),
        RMNodeEventType.REBOOTING));
    Assert.assertEquals(NodeState.REBOOTED, node.getState());
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

    Assert.assertEquals(NodeState.REBOOTED, node.getState());
  }

  private RMNodeImpl getRunningNode() {
    NodeId nodeId = BuilderUtils.newNodeId("localhost", 0);
    RMNodeImpl node = new RMNodeImpl(nodeId, rmContext,null, 0, 0,
        null, null);
    node.handle(new RMNodeEvent(node.getNodeID(), RMNodeEventType.STARTED));
    Assert.assertEquals(NodeState.RUNNING, node.getState());
    return node;
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

    Assert.assertEquals(NodeState.RUNNING, node.getState());
    return node;
  }

  private RMNodeImpl getUnhealthyNode() {
    RMNodeImpl node = getRunningNode();
    NodeHealthStatus status = node.getNodeHealthStatus();
    status.setHealthReport("sick");
    status.setIsNodeHealthy(false);
    node.handle(new RMNodeStatusEvent(node.getNodeID(), status,
        new ArrayList<ContainerStatus>(), null, null));
    Assert.assertEquals(NodeState.UNHEALTHY, node.getState());
    return node;
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

    nm.registerNode();
    return nm;
  }

  public void sendNodeStarted(MockNM nm) throws Exception {
    RMNodeImpl node = (RMNodeImpl) getRMContext().getRMNodes().get(
        nm.getNodeId());
    node.handle(new RMNodeEvent(nm.getNodeId(), RMNodeEventType.STARTED));
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

        nm.getNodeId());
    node.handle(new RMNodeEvent(nm.getNodeId(), RMNodeEventType.STARTED));
  }
 
  public void sendNodeLost(MockNM nm) throws Exception {
    RMNodeImpl node = (RMNodeImpl) getRMContext().getRMNodes().get(
        nm.getNodeId());
    node.handle(new RMNodeEvent(nm.getNodeId(), RMNodeEventType.EXPIRE));
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

    // MAPREDUCE-3760.
    MockNM nm3 = rm.registerNode("h3:1236", 5122);
    rm.NMwaitForState(nm3.getNodeId(), RMNodeState.NEW);
    rm.sendNodeStarted(nm3);
    rm.NMwaitForState(nm3.getNodeId(), RMNodeState.RUNNING);
    RMNodeImpl node = (RMNodeImpl) rm.getRMContext().getRMNodes()
        .get(nm3.getNodeId());
    NodeHealthStatus nodeHealth = node.getNodeHealthStatus();
    nodeHealth.setHealthReport("test health report");
    nodeHealth.setIsNodeHealthy(false);
    node.handle(new RMNodeStatusEvent(nm3.getNodeId(), nodeHealth,
        new ArrayList<ContainerStatus>(), null, null));
    rm.NMwaitForState(nm3.getNodeId(), RMNodeState.UNHEALTHY);

    ClientResponse response =
        r.path("ws").path("v1").path("cluster").path("nodes")
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

    MockNM nm1 = rm.registerNode("h1:1234", 5120);
    MockNM nm2 = rm.registerNode("h2:1235", 5121);
    rm.sendNodeStarted(nm1);
    rm.NMwaitForState(nm2.getNodeId(), RMNodeState.NEW);
    rm.NMwaitForState(nm1.getNodeId(), RMNodeState.RUNNING);
    RMNodeImpl node = (RMNodeImpl) rm.getRMContext().getRMNodes()
        .get(nm1.getNodeId());
    NodeHealthStatus nodeHealth = node.getNodeHealthStatus();
    nodeHealth.setHealthReport("test health report");
    nodeHealth.setIsNodeHealthy(false);
    node.handle(new RMNodeStatusEvent(nm1.getNodeId(), nodeHealth,
        new ArrayList<ContainerStatus>(), null, null));
    rm.NMwaitForState(nm1.getNodeId(), RMNodeState.UNHEALTHY);

    ClientResponse response = r.path("ws").path("v1").path("cluster")
        .path("nodes").queryParam("healthy", "true")
View Full Code Here

Examples of org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeImpl

   
    rmDispatcher.register(SchedulerEventType.class,
        new TestSchedulerEventDispatcher());
   
    NodeId nodeId = BuilderUtils.newNodeId("localhost", 0);
    node = new RMNodeImpl(nodeId, rmContext, null, 0, 0, null, null);

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.