Example usage for org.apache.hadoop.yarn.api.records NodeState UNHEALTHY

List of usage examples for org.apache.hadoop.yarn.api.records NodeState UNHEALTHY

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.api.records NodeState UNHEALTHY.

Prototype

NodeState UNHEALTHY

To view the source code for org.apache.hadoop.yarn.api.records NodeState UNHEALTHY.

Click Source Link

Document

Node is unhealthy

Usage

From source file:org.apache.tez.dag.app.rm.node.TestAMNodeMap.java

License:Apache License

@Test
@SuppressWarnings({ "resource", "rawtypes" })
public void testHealthUpdateKnownNode() {

    DrainDispatcher dispatcher = new DrainDispatcher();
    dispatcher.init(new Configuration());
    dispatcher.start();//from   www .  ja  v a  2 s.c om
    EventHandler eventHandler = dispatcher.getEventHandler();

    AppContext appContext = mock(AppContext.class);

    AMNodeMap amNodeMap = new AMNodeMap(eventHandler, appContext);

    NodeId nodeId = NodeId.newInstance("host1", 2342);
    amNodeMap.nodeSeen(nodeId);

    NodeReport nodeReport = generateNodeReport(nodeId, NodeState.UNHEALTHY);
    amNodeMap.handle(new AMNodeEventStateChanged(nodeReport));
    dispatcher.await();
    assertEquals(AMNodeState.UNHEALTHY, amNodeMap.get(nodeId).getState());
    dispatcher.stop();
}

From source file:org.apache.tez.dag.app.rm.node.TestAMNodeMap.java

License:Apache License

@Test
@SuppressWarnings({ "resource", "rawtypes" })
public void testHealthUpdateUnknownNode() {
    DrainDispatcher dispatcher = new DrainDispatcher();
    EventHandler eventHandler = dispatcher.getEventHandler();

    AppContext appContext = mock(AppContext.class);

    AMNodeMap amNodeMap = new AMNodeMap(eventHandler, appContext);

    NodeId nodeId = NodeId.newInstance("unknownhost", 2342);

    NodeReport nodeReport = generateNodeReport(nodeId, NodeState.UNHEALTHY);
    amNodeMap.handle(new AMNodeEventStateChanged(nodeReport));

    // No exceptions - the status update was ignored. Not bothering to capture
    // the log message for verification.
    dispatcher.stop();//from  w  w  w.  ja  va2 s. c o  m
}

From source file:org.apache.tez.dag.app.rm.node.TestAMNodeTracker.java

License:Apache License

@Test(timeout = 5000)
public void testHealthUpdateKnownNode() {
    AppContext appContext = mock(AppContext.class);

    AMNodeTracker amNodeTracker = new AMNodeTracker(eventHandler, appContext);
    doReturn(amNodeTracker).when(appContext).getNodeTracker();
    amNodeTracker.init(new Configuration(false));
    amNodeTracker.start();//from w  w  w .j  av  a  2s .  c  o m

    NodeId nodeId = NodeId.newInstance("host1", 2342);
    amNodeTracker.nodeSeen(nodeId);

    NodeReport nodeReport = generateNodeReport(nodeId, NodeState.UNHEALTHY);
    amNodeTracker.handle(new AMNodeEventStateChanged(nodeReport));
    dispatcher.await();
    assertEquals(AMNodeState.UNHEALTHY, amNodeTracker.get(nodeId).getState());
    amNodeTracker.stop();
}

From source file:org.apache.tez.dag.app.rm.node.TestAMNodeTracker.java

License:Apache License

@Test(timeout = 5000)
public void testHealthUpdateUnknownNode() {
    AppContext appContext = mock(AppContext.class);

    AMNodeTracker amNodeTracker = new AMNodeTracker(eventHandler, appContext);
    doReturn(amNodeTracker).when(appContext).getNodeTracker();
    amNodeTracker.init(new Configuration(false));
    amNodeTracker.start();/* w ww  . j a  va 2s  . com*/

    NodeId nodeId = NodeId.newInstance("unknownhost", 2342);

    NodeReport nodeReport = generateNodeReport(nodeId, NodeState.UNHEALTHY);
    amNodeTracker.handle(new AMNodeEventStateChanged(nodeReport));
    dispatcher.await();

    amNodeTracker.stop();
    // No exceptions - the status update was ignored. Not bothering to capture
    // the log message for verification.
}