/// <summary>Verify the support for decommissioning a datanode that is already dead.</summary> /// <remarks> /// Verify the support for decommissioning a datanode that is already dead. /// Under this scenario the datanode should immediately be marked as /// DECOMMISSIONED /// </remarks> /// <exception cref="System.Exception"/> public virtual void TestDecommissionDeadDN() { Logger log = Logger.GetLogger(typeof(DecommissionManager)); log.SetLevel(Level.Debug); DatanodeID dnID = cluster.GetDataNodes()[0].GetDatanodeId(); string dnName = dnID.GetXferAddr(); MiniDFSCluster.DataNodeProperties stoppedDN = cluster.StopDataNode(0); DFSTestUtil.WaitForDatanodeState(cluster, dnID.GetDatanodeUuid(), false, 30000); FSNamesystem fsn = cluster.GetNamesystem(); DatanodeManager dm = fsn.GetBlockManager().GetDatanodeManager(); DatanodeDescriptor dnDescriptor = dm.GetDatanode(dnID); DecommissionNode(fsn, localFileSys, dnName); dm.RefreshNodes(conf); BlockManagerTestUtil.RecheckDecommissionState(dm); NUnit.Framework.Assert.IsTrue(dnDescriptor.IsDecommissioned()); // Add the node back cluster.RestartDataNode(stoppedDN, true); cluster.WaitActive(); // Call refreshNodes on FSNamesystem with empty exclude file to remove the // datanode from decommissioning list and make it available again. WriteConfigFile(localFileSys, excludeFile, null); dm.RefreshNodes(conf); }
internal virtual void Compare(DatanodeID dn, DatanodeID dn2) { NUnit.Framework.Assert.AreEqual(dn.GetIpAddr(), dn2.GetIpAddr()); NUnit.Framework.Assert.AreEqual(dn.GetHostName(), dn2.GetHostName()); NUnit.Framework.Assert.AreEqual(dn.GetDatanodeUuid(), dn2.GetDatanodeUuid()); NUnit.Framework.Assert.AreEqual(dn.GetXferPort(), dn2.GetXferPort()); NUnit.Framework.Assert.AreEqual(dn.GetInfoPort(), dn2.GetInfoPort()); NUnit.Framework.Assert.AreEqual(dn.GetIpcPort(), dn2.GetIpcPort()); }