Exemplo n.º 1
0
        public virtual void TestRMWebAppURLRemoteAndLocal()
        {
            Configuration configuration = new Configuration();
            string        rmAddress     = "host1:8088";

            configuration.Set(YarnConfiguration.RmWebappAddress, rmAddress);
            string rm1Address = "host2:8088";
            string rm2Address = "host3:8088";

            configuration.Set(YarnConfiguration.RmWebappAddress + "." + Rm1NodeId, rm1Address
                              );
            configuration.Set(YarnConfiguration.RmWebappAddress + "." + Rm2NodeId, rm2Address
                              );
            configuration.SetBoolean(YarnConfiguration.RmHaEnabled, true);
            configuration.Set(YarnConfiguration.RmHaIds, Rm1NodeId + "," + Rm2NodeId);
            string rmRemoteUrl = WebAppUtils.GetResolvedRemoteRMWebAppURLWithoutScheme(configuration
                                                                                       );

            NUnit.Framework.Assert.AreEqual("ResolvedRemoteRMWebAppUrl should resolve to the first HA RM address"
                                            , rm1Address, rmRemoteUrl);
            string rmLocalUrl = WebAppUtils.GetResolvedRMWebAppURLWithoutScheme(configuration
                                                                                );

            NUnit.Framework.Assert.AreEqual("ResolvedRMWebAppUrl should resolve to the default RM webapp address"
                                            , rmAddress, rmLocalUrl);
        }