public virtual void TestRefreshNodes() { resourceManager.GetClientRMService(); RefreshNodesRequest request = recordFactory.NewRecordInstance <RefreshNodesRequest >(); RefreshNodesResponse response = client.RefreshNodes(request); NUnit.Framework.Assert.IsNotNull(response); }
/// <exception cref="System.IO.IOException"/> /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> private int RefreshNodes() { // Refresh the nodes ResourceManagerAdministrationProtocol adminProtocol = CreateAdminProtocol(); RefreshNodesRequest request = recordFactory.NewRecordInstance <RefreshNodesRequest >(); adminProtocol.RefreshNodes(request); return(0); }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public virtual RefreshNodesResponse RefreshNodes(RefreshNodesRequest request) { YarnServerResourceManagerServiceProtos.RefreshNodesRequestProto requestProto = (( RefreshNodesRequestPBImpl)request).GetProto(); try { return(new RefreshNodesResponsePBImpl(proxy.RefreshNodes(null, requestProto))); } catch (ServiceException e) { RPCUtil.UnwrapAndThrowException(e); return(null); } }
public virtual void TestRefreshNodesWithLocalConfigurationProvider() { rm = new MockRM(configuration); rm.Init(configuration); rm.Start(); try { rm.adminService.RefreshNodes(RefreshNodesRequest.NewInstance()); } catch (Exception) { NUnit.Framework.Assert.Fail("Using localConfigurationProvider. Should not get any exception." ); } }
public virtual void TestRefreshNodesWithFileSystemBasedConfigurationProvider() { configuration.Set(YarnConfiguration.RmConfigurationProviderClass, "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider" ); // upload default configurations UploadDefaultConfiguration(); try { rm = new MockRM(configuration); rm.Init(configuration); rm.Start(); } catch (Exception) { NUnit.Framework.Assert.Fail("Should not get any exceptions"); } FilePath excludeHostsFile = new FilePath(tmpDir.ToString(), "excludeHosts"); if (excludeHostsFile.Exists()) { excludeHostsFile.Delete(); } if (!excludeHostsFile.CreateNewFile()) { NUnit.Framework.Assert.Fail("Can not create " + "excludeHosts"); } PrintWriter fileWriter = new PrintWriter(excludeHostsFile); fileWriter.Write("0.0.0.0:123"); fileWriter.Close(); UploadToRemoteFileSystem(new Path(excludeHostsFile.GetAbsolutePath())); Configuration yarnConf = new YarnConfiguration(); yarnConf.Set(YarnConfiguration.RmNodesExcludeFilePath, this.workingPath + "/excludeHosts" ); UploadConfiguration(yarnConf, YarnConfiguration.YarnSiteConfigurationFile); rm.adminService.RefreshNodes(RefreshNodesRequest.NewInstance()); ICollection <string> excludeHosts = rm.GetNodesListManager().GetHostsReader().GetExcludedHosts (); NUnit.Framework.Assert.IsTrue(excludeHosts.Count == 1); NUnit.Framework.Assert.IsTrue(excludeHosts.Contains("0.0.0.0:123")); }
/// <exception cref="Org.Apache.Hadoop.HA.ServiceFailedException"/> private void RefreshAll() { try { RefreshQueues(RefreshQueuesRequest.NewInstance()); RefreshNodes(RefreshNodesRequest.NewInstance()); RefreshSuperUserGroupsConfiguration(RefreshSuperUserGroupsConfigurationRequest.NewInstance ()); RefreshUserToGroupsMappings(RefreshUserToGroupsMappingsRequest.NewInstance()); if (GetConfig().GetBoolean(CommonConfigurationKeysPublic.HadoopSecurityAuthorization , false)) { RefreshServiceAcls(RefreshServiceAclsRequest.NewInstance()); } } catch (Exception ex) { throw new ServiceFailedException(ex.Message); } }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="Org.Apache.Hadoop.Ipc.StandbyException"/> public virtual RefreshNodesResponse RefreshNodes(RefreshNodesRequest request) { string argName = "refreshNodes"; string msg = "refresh nodes."; UserGroupInformation user = CheckAcls("refreshNodes"); CheckRMStatus(user.GetShortUserName(), argName, msg); try { Configuration conf = GetConfiguration(new Configuration(false), YarnConfiguration .YarnSiteConfigurationFile); rmContext.GetNodesListManager().RefreshNodes(conf); RMAuditLogger.LogSuccess(user.GetShortUserName(), argName, "AdminService"); return(recordFactory.NewRecordInstance <RefreshNodesResponse>()); } catch (IOException ioe) { throw LogAndWrapException(ioe, user.GetShortUserName(), argName, msg); } }