public static void SetUpResourceManager() { Configuration.AddDefaultResource("config-with-security.xml"); Configuration configuration = new YarnConfiguration(); resourceManager = new _ResourceManager_74(); resourceManager.Init(configuration); new _Thread_80().Start(); int waitCount = 0; while (resourceManager.GetServiceState() == Service.STATE.Inited && waitCount++ < 10) { Log.Info("Waiting for RM to start..."); Sharpen.Thread.Sleep(1000); } if (resourceManager.GetServiceState() != Service.STATE.Started) { throw new IOException("ResourceManager failed to start. Final state is " + resourceManager .GetServiceState()); } Log.Info("ResourceManager RMAdmin address: " + configuration.Get(YarnConfiguration .RmAdminAddress)); client = new ResourceManagerAdministrationProtocolPBClientImpl(1L, GetProtocolAddress (configuration), configuration); }
static HdfsConfiguration() { AddDeprecatedKeys(); // adds the default resources Configuration.AddDefaultResource("hdfs-default.xml"); Configuration.AddDefaultResource("hdfs-site.xml"); }
static TestDFSIO() { // Constants Configuration.AddDefaultResource("hdfs-default.xml"); Configuration.AddDefaultResource("hdfs-site.xml"); Configuration.AddDefaultResource("mapred-default.xml"); Configuration.AddDefaultResource("mapred-site.xml"); }
/// <exception cref="System.Exception"/> public virtual void TestReload() { TestConfigurationSubclass.SubConf conf = new TestConfigurationSubclass.SubConf(true ); NUnit.Framework.Assert.IsFalse(conf.IsReloaded()); Configuration.AddDefaultResource(EmptyConfigurationXml); Assert.True(conf.IsReloaded()); Properties properties = conf.GetProperties(); }
/// <exception cref="System.IO.FileNotFoundException"/> /// <exception cref="System.IO.UnsupportedEncodingException"/> private void AddNewConfigResource(string rsrcName, string keyGroup, string groups , string keyHosts, string hosts) { // location for temp resource should be in CLASSPATH Configuration conf = new Configuration(); Uri url = conf.GetResource("hdfs-site.xml"); string urlPath = URLDecoder.Decode(url.AbsolutePath.ToString(), "UTF-8"); Path p = new Path(urlPath); Path dir = p.GetParent(); tempResource = dir.ToString() + "/" + rsrcName; string newResource = "<configuration>" + "<property><name>" + keyGroup + "</name><value>" + groups + "</value></property>" + "<property><name>" + keyHosts + "</name><value>" + hosts + "</value></property>" + "</configuration>"; PrintWriter writer = new PrintWriter(new FileOutputStream(tempResource)); writer.WriteLine(newResource); writer.Close(); Configuration.AddDefaultResource(rsrcName); }
public virtual void SetUp() { Configuration.AddDefaultResource("hdfs-site.malformed.xml"); config = new Configuration(); }
static TestConfigurationDeprecation() { Configuration.AddDefaultResource("test-fake-default.xml"); }
static SliveTest() { // ensures the hdfs configurations are loaded if they exist Configuration.AddDefaultResource("hdfs-default.xml"); Configuration.AddDefaultResource("hdfs-site.xml"); }