Package org.apache.hadoop.conf

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


    else
      hadoopConfPath = Environment.getProperty("hadoop.conf.path");

    // Read the configuration for the Hadoop environment
    Configuration hadoopConf = new Configuration();
    hadoopConf.addResource(new Path(hadoopConfPath + "/hadoop-default.xml"));
    hadoopConf.addResource(new Path(hadoopConfPath + "/hadoop-site.xml"));

    // System.out.println(hadoopConf.get("hadoop.tmp.dir"));
    // System.out.println(hadoopConf.get("fs.default.name"));
    FileSystem fs = FileSystem.get(hadoopConf);
View Full Code Here


      hadoopConfPath = Environment.getProperty("hadoop.conf.path");

    // Read the configuration for the Hadoop environment
    Configuration hadoopConf = new Configuration();
    hadoopConf.addResource(new Path(hadoopConfPath + "/hadoop-default.xml"));
    hadoopConf.addResource(new Path(hadoopConfPath + "/hadoop-site.xml"));

    // System.out.println(hadoopConf.get("hadoop.tmp.dir"));
    // System.out.println(hadoopConf.get("fs.default.name"));
    FileSystem fs = FileSystem.get(hadoopConf);
View Full Code Here

    private OozieUtils() {}

    public static Properties toProperties(String properties) {
        Configuration conf = new Configuration(false);
        conf.addResource(new ByteArrayInputStream(properties.getBytes()));
        Properties jobprops = new Properties();
        for (Map.Entry<String, String> entry : conf) {
            jobprops.put(entry.getKey(), entry.getValue());
        }
        return jobprops;
View Full Code Here

        Path confPath = new Path("file:///"
                + System.getProperty("oozie.action.conf.xml"));

        LOG.info(confPath + " found conf ? "
                + confPath.getFileSystem(conf).exists(confPath));
        conf.addResource(confPath);

        String falconFeedStorageType = cmd.getOptionValue("falconFeedStorageType").trim();
        Storage.TYPE feedStorageType = Storage.TYPE.valueOf(falconFeedStorageType);

        DistCp distCp = (feedStorageType == Storage.TYPE.FILESYSTEM)
View Full Code Here

    public static void main(String[] args) throws Exception {
        Configuration conf = new Configuration();
        Path confPath = new Path("file:///" + System.getProperty("oozie.action.conf.xml"));

        LOG.info(confPath + " found ? " + confPath.getFileSystem(conf).exists(confPath));
        conf.addResource(confPath);
        int ret = ToolRunner.run(conf, new FeedEvictor(), args);
        if (ret != 0) {
            throw new Exception("Unable to perform eviction action args: " + Arrays.toString(args));
        }
    }
View Full Code Here

        Path confPath = new Path("file:///"
                + System.getProperty("oozie.action.conf.xml"));

        LOG.info(confPath + " found ? "
                + confPath.getFileSystem(conf).exists(confPath));
        conf.addResource(confPath);
        ToolRunner.run(conf, new LateDataHandler(), args);
    }

    private static CommandLine getCommand(String[] args) throws ParseException {
        Options options = new Options();
View Full Code Here

  }

  @Test
  public void testHealthChecker() throws Exception {
    Configuration config = getConfForNodeHealthScript();
    config.addResource(healthScriptFile.getName());
    String location = healthScriptFile.getAbsolutePath();
    long timeout = config.getLong(HConstants.HEALTH_SCRIPT_TIMEOUT, 200);

    HealthChecker checker = new HealthChecker();
    checker.init(location, timeout);
View Full Code Here

        String classpathFile = "hadoop-" + jobTrackerSpec + ".xml";
        URL validate = conf.getResource(classpathFile);
        if (validate == null) {
          throw new RuntimeException(classpathFile + " not found on CLASSPATH");
        }
        conf.addResource(classpathFile);
      }
    }
    return conf;
  }
View Full Code Here

   * @throws IndexingException
   */
  @Test
  public void testNonExistingIndexingFilter() throws IndexingException {
    Configuration conf = NutchConfiguration.create();
      conf.addResource("nutch-default.xml");
      conf.addResource("crawl-tests.xml");

    String class1 = "NonExistingFilter";
    String class2 = "org.apache.nutch.indexer.basic.BasicIndexingFilter";
    conf.set(IndexingFilters.INDEXINGFILTER_ORDER, class1 + " " + class2);
View Full Code Here

   */
  @Test
  public void testNonExistingIndexingFilter() throws IndexingException {
    Configuration conf = NutchConfiguration.create();
      conf.addResource("nutch-default.xml");
      conf.addResource("crawl-tests.xml");

    String class1 = "NonExistingFilter";
    String class2 = "org.apache.nutch.indexer.basic.BasicIndexingFilter";
    conf.set(IndexingFilters.INDEXINGFILTER_ORDER, class1 + " " + class2);

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.