List of usage examples for org.apache.hadoop.yarn.event DrainDispatcher stop
@Override public void stop()
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();/*w w w.j a va2 s . c o m*/ 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(); }