예제 #1
0
        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)
            {
            }
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <exception cref="System.IO.IOException"/>
 internal override int DoWorkInternal(GetConf tool, string[] args)
 {
     tool.PrintMap(DFSUtil.GetBackupNodeAddresses(tool.GetConf()));
     return(0);
 }