@Override @SuppressWarnings("unchecked") public void transition(ContainerImpl container, ContainerEvent event) { container.metrics.releaseContainer(container.resource); container.sendFinishedEvents(); //if the current state is NEW it means the CONTAINER_INIT was never // sent for the event, thus no need to send the CONTAINER_STOP if (container.getCurrentState() != org.apache.hadoop.yarn.api.records.ContainerState.NEW) { container.dispatcher.getEventHandler().handle(new AuxServicesEvent (AuxServicesEventType.CONTAINER_STOP, container)); } container.context.getNodeStatusUpdater().sendOutofBandHeartBeat(); } }
@Override @SuppressWarnings("unchecked") public void transition(ContainerImpl container, ContainerEvent event) { container.metrics.releaseContainer(container.resource); container.sendFinishedEvents(); //if the current state is NEW it means the CONTAINER_INIT was never // sent for the event, thus no need to send the CONTAINER_STOP if (container.getCurrentState() != org.apache.hadoop.yarn.api.records.ContainerState.NEW) { container.dispatcher.getEventHandler().handle(new AuxServicesEvent (AuxServicesEventType.CONTAINER_STOP, container)); } container.context.getNodeStatusUpdater().sendOutofBandHeartBeat(); } }
@Override @SuppressWarnings("unchecked") public void transition(ContainerImpl container, ContainerEvent event) { container.metrics.releaseContainer(container.resource); container.sendFinishedEvents(); //if the current state is NEW it means the CONTAINER_INIT was never // sent for the event, thus no need to send the CONTAINER_STOP if (container.getCurrentState() != org.apache.hadoop.yarn.api.records.ContainerState.NEW) { container.dispatcher.getEventHandler().handle(new AuxServicesEvent (AuxServicesEventType.CONTAINER_STOP, container)); } container.context.getNodeStatusUpdater().sendOutofBandHeartBeat(); } }
@Override @SuppressWarnings("unchecked") public void transition(ContainerImpl container, ContainerEvent event) { container.metrics.releaseContainer( container.containerTokenIdentifier.getResource()); if (container.containerMetrics != null) { container.containerMetrics .recordFinishTimeAndExitCode(clock.getTime(), container.exitCode); container.containerMetrics.finished(); } container.sendFinishedEvents(); // if the current state is NEW it means the CONTAINER_INIT was never // sent for the event, thus no need to send the CONTAINER_STOP if (container.getCurrentState() != org.apache.hadoop.yarn.api.records.ContainerState.NEW) { container.dispatcher.getEventHandler().handle(new AuxServicesEvent (AuxServicesEventType.CONTAINER_STOP, container)); } container.context.getNodeStatusUpdater().sendOutofBandHeartBeat(); } }
/** * Trigger the NM to send a heartbeat using the simulated NodeStatus fixture. * Verify both the RMNode and SchedulerNode have been updated with the new * utilization. */ @Test(timeout=60000) public void testMockNodeStatusHeartbeat() throws InterruptedException, YarnException { assertTrue("NMs fail to connect to the RM", cluster.waitForNodeManagersToConnect(10000)); NodeStatusUpdater updater = nm.getNodeStatusUpdater(); updater.sendOutofBandHeartBeat(); // Give the heartbeat time to propagate to the RM verifySimulatedUtilization(); // Alter utilization nodeStatus = createNodeStatus(nm.getNMContext().getNodeId(), 0, CONTAINER_PMEM_2, CONTAINER_VMEM_2, CONTAINER_CPU_2, NODE_PMEM_2, NODE_VMEM_2, NODE_CPU_2); nm.setNodeStatus(nodeStatus); updater.sendOutofBandHeartBeat(); verifySimulatedUtilization(); }