public virtual void TestEmptyConf() { HdfsConfiguration conf = new HdfsConfiguration(false); try { IDictionary <string, IDictionary <string, IPEndPoint> > map = DFSUtil.GetNNServiceRpcAddresses (conf); NUnit.Framework.Assert.Fail("Expected IOException is not thrown, result was: " + DFSUtil.AddressMapToString(map)); } catch (IOException) { } try { IDictionary <string, IDictionary <string, IPEndPoint> > map = DFSUtil.GetBackupNodeAddresses (conf); NUnit.Framework.Assert.Fail("Expected IOException is not thrown, result was: " + DFSUtil.AddressMapToString(map)); } catch (IOException) { } try { IDictionary <string, IDictionary <string, IPEndPoint> > map = DFSUtil.GetSecondaryNameNodeAddresses (conf); NUnit.Framework.Assert.Fail("Expected IOException is not thrown, result was: " + DFSUtil.AddressMapToString(map)); } catch (IOException) { } }
/// <summary> /// Using DFSUtil methods get the list of given /// <paramref name="type"/> /// of address /// </summary> /// <exception cref="System.IO.IOException"/> private IDictionary <string, IDictionary <string, IPEndPoint> > GetAddressListFromConf (TestGetConf.TestType type, HdfsConfiguration conf) { switch (type) { case TestGetConf.TestType.Namenode: { return(DFSUtil.GetNNServiceRpcAddressesForCluster(conf)); } case TestGetConf.TestType.Backup: { return(DFSUtil.GetBackupNodeAddresses(conf)); } case TestGetConf.TestType.Secondary: { return(DFSUtil.GetSecondaryNameNodeAddresses(conf)); } case TestGetConf.TestType.Nnrpcaddresses: { return(DFSUtil.GetNNServiceRpcAddressesForCluster(conf)); } } return(null); }
/// <exception cref="System.IO.IOException"/> internal override int DoWorkInternal(GetConf tool, string[] args) { tool.PrintMap(DFSUtil.GetBackupNodeAddresses(tool.GetConf())); return(0); }