/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public virtual void TestHelper(bool isAHSEnabled) { conf.SetBoolean(YarnConfiguration.ApplicationHistoryEnabled, isAHSEnabled); appManager = Org.Mockito.Mockito.Mock <ApplicationClientProtocol>(); Org.Mockito.Mockito.When(appManager.GetApplicationReport(Org.Mockito.Mockito.Any < GetApplicationReportRequest>())).ThenThrow(new ApplicationNotFoundException(appNotFoundExceptionMsg )); fetcher = new TestAppReportFetcher.AppReportFetcherForTest(conf, appManager); ApplicationId appId = ApplicationId.NewInstance(0, 0); fetcher.GetApplicationReport(appId); }
/// <exception cref="System.Exception"/> protected override void ServiceInit(Configuration conf) { string auth = conf.Get(CommonConfigurationKeys.HadoopSecurityAuthentication); if (auth == null || "simple".Equals(auth)) { isSecurityEnabled = false; } else { if ("kerberos".Equals(auth)) { isSecurityEnabled = true; } else { Log.Warn("Unrecongized attribute value for " + CommonConfigurationKeys.HadoopSecurityAuthentication + " of " + auth); } } string proxy = WebAppUtils.GetProxyHostAndPort(conf); string[] proxyParts = proxy.Split(":"); proxyHost = proxyParts[0]; fetcher = new AppReportFetcher(conf); bindAddress = conf.Get(YarnConfiguration.ProxyAddress); if (bindAddress == null || bindAddress.IsEmpty()) { throw new YarnRuntimeException(YarnConfiguration.ProxyAddress + " is not set so the proxy will not run." ); } Log.Info("Instantiating Proxy at " + bindAddress); string[] parts = StringUtils.Split(bindAddress, ':'); port = 0; if (parts.Length == 2) { bindAddress = parts[0]; port = System.Convert.ToInt32(parts[1]); } acl = new AccessControlList(conf.Get(YarnConfiguration.YarnAdminAcl, YarnConfiguration .DefaultYarnAdminAcl)); base.ServiceInit(conf); }
public virtual void CleanUp() { historyManager = null; appManager = null; fetcher = null; }