/// <exception cref="System.IO.IOException"/> internal static void AssertReports(int numDatanodes, HdfsConstants.DatanodeReportType type, DFSClient client, IList <DataNode> datanodes, string bpid) { DatanodeInfo[] infos = client.DatanodeReport(type); NUnit.Framework.Assert.AreEqual(numDatanodes, infos.Length); DatanodeStorageReport[] reports = client.GetDatanodeStorageReport(type); NUnit.Framework.Assert.AreEqual(numDatanodes, reports.Length); for (int i = 0; i < infos.Length; i++) { NUnit.Framework.Assert.AreEqual(infos[i], reports[i].GetDatanodeInfo()); DataNode d = FindDatanode(infos[i].GetDatanodeUuid(), datanodes); if (bpid != null) { //check storage StorageReport[] computed = reports[i].GetStorageReports(); Arrays.Sort(computed, Cmp); StorageReport[] expected = d.GetFSDataset().GetStorageReports(bpid); Arrays.Sort(expected, Cmp); NUnit.Framework.Assert.AreEqual(expected.Length, computed.Length); for (int j = 0; j < expected.Length; j++) { NUnit.Framework.Assert.AreEqual(expected[j].GetStorage().GetStorageID(), computed [j].GetStorage().GetStorageID()); } } } }