Package org.apache.hadoop.conf

Examples of org.apache.hadoop.conf.Configuration.writeXml()


       
        conf = new XConfiguration();
        conf.set("e", "E");
        conf.set("oozie.launcher.f", "F");
        os = getFileSystem().create(new Path(getFsTestCaseDir(), "job2.xml"));
        conf.writeXml(os);
        os.close();

        conf = ae.createBaseHadoopConf(context, actionXml);
        assertEquals(protoConf.get(WorkflowAppService.HADOOP_USER), conf.get(WorkflowAppService.HADOOP_USER));
        assertEquals(getJobTrackerUri(), conf.get("mapred.job.tracker"));
View Full Code Here


    Configuration.addDeprecation("old.config.yet.to.be.deprecated",
  new String[]{"new.conf.to.replace.deprecated.conf"});
    ByteArrayOutputStream out=new ByteArrayOutputStream();
    String fileContents;
    try {
      conf.writeXml(out);
      fileContents = out.toString();
    } finally {
      out.close();
    }
    assertTrue(fileContents.contains("old.config.yet.to.be.deprecated"));
View Full Code Here

    assertEquals(2, statCache.size());
    // ****** End of imitating JobClient code

    Path jobFile = new Path(TEST_ROOT_DIR, "job.xml");
    FileOutputStream os = new FileOutputStream(new File(jobFile.toString()));
    subConf.writeXml(os);
    os.close();

    // ****** Imitate TaskRunner code.
    TrackerDistributedCacheManager manager =
      new TrackerDistributedCacheManager(conf, taskController);
View Full Code Here

    sslConfig.set("ssl.client.keystore.location", keyStorePath.toString());

    try {
      OutputStream out = new FileOutputStream(workDir + "/" + sslConfFileName);
      try {
        sslConfig.writeXml(out);
      } finally {
        out.close();
      }
      conf.set(DistCpConstants.CONF_LABEL_SSL_KEYSTORE, sslConfFileName);
    } catch (IOException e) {
View Full Code Here

        hiveConf.set("hive.metastore.local", "false");

        OutputStream out = null;
        try {
            out = fs.create(new Path(confPath, prefix + "hive-site.xml"));
            hiveConf.writeXml(out);
        } finally {
            IOUtils.closeQuietly(out);
        }
    }
}
View Full Code Here

    confFilePath = new Path(workDir.getAbsolutePath(), YARN_CLUSTER_CONFIG);
    File confFile = new File(confFilePath.toString());
    try {
      confFile.createNewFile();
      conf.writeXml(new FileOutputStream(confFile));
      confFile.deleteOnExit();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      throw new RuntimeException(e);
View Full Code Here

    if (!localFolderObj.exists()) {
      localFolderObj.mkdir();
    }
    confXMLFile = localDirPath + File.separator + configFile;
    xmlFileObj = new File(confXMLFile);
    initConf.writeXml(new FileOutputStream(xmlFileObj));
    newConfDir = clusterManager.pushConfig(localDirPath);
    stop();
    waitForClusterToStop();
    clusterManager.start(newConfDir);
    waitForClusterToStart();
View Full Code Here

    for (Enumeration<?> e = confProps.propertyNames(); e.hasMoreElements();) {
      String key = (String) e.nextElement();
      config.set(key, confProps.getProperty(key));
    }

    config.writeXml(fos);
    fos.close();
  }

  static JobTracker getJobTracker() {
    JobTracker jt = new JobTracker();
View Full Code Here

    TrackerDistributedCacheManager.determineCacheVisibilities(subConf);
    // ****** End of imitating JobClient code

    Path jobFile = new Path(TEST_ROOT_DIR, "job.xml");
    FileOutputStream os = new FileOutputStream(new File(jobFile.toString()));
    subConf.writeXml(os);
    os.close();

    // ****** Imitate TaskRunner code.
    TrackerDistributedCacheManager manager =
      new TrackerDistributedCacheManager(conf, taskController);
View Full Code Here

    // set jobOwner as mapreduce.job.user.name in aclConf
    String jobOwner = conf.getUser();
    aclConf.set(MRJobConfig.USER_NAME, jobOwner);
    FileOutputStream out = new FileOutputStream(aclFile);
    try {
      aclConf.writeXml(out);
    } finally {
      out.close();
    }
    Localizer.PermissionsHandler.setPermissions(aclFile,
        Localizer.PermissionsHandler.sevenZeroZero);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.