|
@@ -260,7 +260,21 @@ public class TestRMNodeTransitions {
|
|
@Test
|
|
@Test
|
|
public void testRunningExpire() {
|
|
public void testRunningExpire() {
|
|
RMNodeImpl node = getRunningNode();
|
|
RMNodeImpl node = getRunningNode();
|
|
|
|
+ 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 RMNodeEvent(node.getNodeID(), RMNodeEventType.EXPIRE));
|
|
node.handle(new RMNodeEvent(node.getNodeID(), RMNodeEventType.EXPIRE));
|
|
|
|
+ Assert.assertEquals("Active Nodes", initialActive - 1, cm.getNumActiveNMs());
|
|
|
|
+ Assert.assertEquals("Lost Nodes", initialLost + 1, 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.LOST, node.getState());
|
|
Assert.assertEquals(NodeState.LOST, node.getState());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -297,8 +311,22 @@ public class TestRMNodeTransitions {
|
|
@Test
|
|
@Test
|
|
public void testRunningDecommission() {
|
|
public void testRunningDecommission() {
|
|
RMNodeImpl node = getRunningNode();
|
|
RMNodeImpl node = getRunningNode();
|
|
|
|
+ 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 RMNodeEvent(node.getNodeID(),
|
|
node.handle(new RMNodeEvent(node.getNodeID(),
|
|
RMNodeEventType.DECOMMISSION));
|
|
RMNodeEventType.DECOMMISSION));
|
|
|
|
+ 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 + 1, cm.getNumDecommisionedNMs());
|
|
|
|
+ Assert.assertEquals("Rebooted Nodes",
|
|
|
|
+ initialRebooted, cm.getNumRebootedNMs());
|
|
Assert.assertEquals(NodeState.DECOMMISSIONED, node.getState());
|
|
Assert.assertEquals(NodeState.DECOMMISSIONED, node.getState());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -327,8 +355,22 @@ public class TestRMNodeTransitions {
|
|
@Test
|
|
@Test
|
|
public void testRunningRebooting() {
|
|
public void testRunningRebooting() {
|
|
RMNodeImpl node = getRunningNode();
|
|
RMNodeImpl node = getRunningNode();
|
|
|
|
+ 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 RMNodeEvent(node.getNodeID(),
|
|
node.handle(new RMNodeEvent(node.getNodeID(),
|
|
RMNodeEventType.REBOOTING));
|
|
RMNodeEventType.REBOOTING));
|
|
|
|
+ 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 + 1, cm.getNumRebootedNMs());
|
|
Assert.assertEquals(NodeState.REBOOTED, node.getState());
|
|
Assert.assertEquals(NodeState.REBOOTED, node.getState());
|
|
}
|
|
}
|
|
|
|
|