Package org.apache.hadoop.conf

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


   * Test behaviour when NutchDOcument is null
   */
  @Test
  public void testNutchDocumentNullIndexingFilter() throws IndexingException{
    Configuration conf = NutchConfiguration.create();
    conf.addResource("nutch-default.xml");
    conf.addResource("crawl-tests.xml");

    IndexingFilters filters = new IndexingFilters(conf);
    NutchDocument doc = filters.filter(null, new ParseImpl("text", new ParseData(
      new ParseStatus(), "title", new Outlink[0], new Metadata())), new Text(
View Full Code Here


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

    IndexingFilters filters = new IndexingFilters(conf);
    NutchDocument doc = filters.filter(null, new ParseImpl("text", new ParseData(
      new ParseStatus(), "title", new Outlink[0], new Metadata())), new Text(
      "http://www.example.com/"), new CrawlDatum(), new Inlinks());
View Full Code Here

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

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

View Full Code Here

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

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

    IndexingFilters filters1 = new IndexingFilters(conf);
View Full Code Here

    JobConf job = new NutchJob(config);
    PluginRepository repo1 = PluginRepository.get(job);
    Assert.assertTrue(repo == repo1);
    // now construct a config without UUID
    config = new Configuration();
    config.addResource("nutch-default.xml");
    config.addResource("nutch-site.xml");
    repo = PluginRepository.get(config);
    job = new NutchJob(config);
    repo1 = PluginRepository.get(job);
    Assert.assertTrue(repo1 != repo);
View Full Code Here

    PluginRepository repo1 = PluginRepository.get(job);
    Assert.assertTrue(repo == repo1);
    // now construct a config without UUID
    config = new Configuration();
    config.addResource("nutch-default.xml");
    config.addResource("nutch-site.xml");
    repo = PluginRepository.get(config);
    job = new NutchJob(config);
    repo1 = PluginRepository.get(job);
    Assert.assertTrue(repo1 != repo);
  }
View Full Code Here

      InputStream inputStream =
          this.rmContext.getConfigurationProvider()
              .getConfigurationInputStream(conf,
                  YarnConfiguration.HADOOP_POLICY_CONFIGURATION_FILE);
      if (inputStream != null) {
        conf.addResource(inputStream);
      }
      refreshServiceAcls(conf, RMPolicyProvider.getInstance());
    }
   
    this.server.start();
View Full Code Here

      InputStream inputStream =
          this.rmContext.getConfigurationProvider()
              .getConfigurationInputStream(conf,
                  YarnConfiguration.HADOOP_POLICY_CONFIGURATION_FILE);
      if (inputStream != null) {
        conf.addResource(inputStream);
      }
      refreshServiceAcls(conf, RMPolicyProvider.getInstance());
    }

    this.server.start();
View Full Code Here

  private Configuration loadHadoopConf(File dir) throws IOException {
    Configuration hadoopConf = new Configuration(false);
    for (String file : HADOOP_CONF_FILES) {
      File f = new File(dir, file);
      if (f.exists()) {
        hadoopConf.addResource(new Path(f.getAbsolutePath()));
      }
    }
    return hadoopConf;
  }
View Full Code Here

    if (sslClient == null) {
      LOG.warn("SSL Client config file not found. Was looking for " + sslConfFileName +
          " in " + Arrays.toString(cacheFiles));
      return;
    }
    sslConfig.addResource(sslClient);

    String trustStoreFile = conf.get("ssl.client.truststore.location");
    Path trustStorePath = findCacheFile(cacheFiles, trustStoreFile);
    sslConfig.set("ssl.client.truststore.location", trustStorePath.toString());
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.