예제 #1
0
        public virtual void TestReconnect()
        {
            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 RMNodeReconnectEvent(node.GetNodeID(), node, null, null));
            NUnit.Framework.Assert.AreEqual("Active Nodes", initialActive, cm.GetNumActiveNMs
                                                ());
            NUnit.Framework.Assert.AreEqual("Lost Nodes", initialLost, cm.GetNumLostNMs());
            NUnit.Framework.Assert.AreEqual("Unhealthy Nodes", initialUnhealthy, cm.GetUnhealthyNMs
                                                ());
            NUnit.Framework.Assert.AreEqual("Decommissioned Nodes", initialDecommissioned, cm
                                            .GetNumDecommisionedNMs());
            NUnit.Framework.Assert.AreEqual("Rebooted Nodes", initialRebooted, cm.GetNumRebootedNMs
                                                ());
            NUnit.Framework.Assert.AreEqual(NodeState.Running, node.GetState());
            NUnit.Framework.Assert.IsNotNull(nodesListManagerEvent);
            NUnit.Framework.Assert.AreEqual(NodesListManagerEventType.NodeUsable, nodesListManagerEvent
                                            .GetType());
        }
예제 #2
0
        public virtual void TestUnhealthyRebooting()
        {
            RMNodeImpl     node                  = GetUnhealthyNode();
            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.Rebooting));
            NUnit.Framework.Assert.AreEqual("Active Nodes", initialActive, cm.GetNumActiveNMs
                                                ());
            NUnit.Framework.Assert.AreEqual("Lost Nodes", initialLost, cm.GetNumLostNMs());
            NUnit.Framework.Assert.AreEqual("Unhealthy Nodes", initialUnhealthy - 1, cm.GetUnhealthyNMs
                                                ());
            NUnit.Framework.Assert.AreEqual("Decommissioned Nodes", initialDecommissioned, cm
                                            .GetNumDecommisionedNMs());
            NUnit.Framework.Assert.AreEqual("Rebooted Nodes", initialRebooted + 1, cm.GetNumRebootedNMs
                                                ());
            NUnit.Framework.Assert.AreEqual(NodeState.Rebooted, node.GetState());
        }