Package org.apache.hadoop.conf

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


      // When importing image from a checkpoint, the name-node can
      // start with empty set of storage directories.
      Configuration cE = new HdfsConfiguration(false);
      cE.addResource("core-default.xml");
      cE.addResource("core-site.xml");
      cE.addResource("hdfs-default.xml");
      Collection<String> dirNames2 = cE.getTrimmedStringCollection(propertyName);
      dirNames.removeAll(dirNames2);
      if(dirNames.isEmpty())
        LOG.warn("!!! WARNING !!!" +
          "\n\tThe NameNode currently runs without persistent storage." +
View Full Code Here


    }
   
    public synchronized Configuration loadConfFile() throws IOException {
      FileContext fc = FileContext.getFileContext(confFile.toUri(), conf);
      Configuration jobConf = new Configuration(false);
      jobConf.addResource(fc.open(confFile), confFile.toString());
      return jobConf;
    }
  }

  private SerialNumberIndex serialNumberIndex = null;
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

        if (!s.isDir())
        {
          Path resourcePath = s.getPath();
          File tmpResFile = FileUtil.createLocalTempFile(new File(resourcePath.getName()), "-tmp", true);
          FileUtil.copy(fs, resourcePath, tmpResFile, false, conf);
          metaConf.addResource(tmpResFile.toURL());
        }
      }
    }
    else
    {     
View Full Code Here

    }
    else
    {     
      File tmpResFile = FileUtil.createLocalTempFile(new File(metaFilePath.getName()), "-tmp", true);
      FileUtil.copy(fs, metaFilePath, tmpResFile, false, conf);
      metaConf.addResource(tmpResFile.toURL());
    }

    return metaConf;
    }
View Full Code Here

    }
   
    public synchronized Configuration loadConfFile() throws IOException {
      FileContext fc = FileContext.getFileContext(confFile.toUri(), conf);
      Configuration jobConf = new Configuration(false);
      jobConf.addResource(fc.open(confFile), confFile.toString());
      return jobConf;
    }
  }

  private SerialNumberIndex serialNumberIndex = null;
View Full Code Here

      return cachedInstance = new MockInstance(instance);
    if (siteFile != null) {
      AccumuloConfiguration config = new AccumuloConfiguration() {
        Configuration xml = new Configuration();
        {
          xml.addResource(new Path(siteFile));
        }
       
        @Override
        public Iterator<Entry<String,String>> iterator() {
          TreeMap<String,String> map = new TreeMap<String,String>();
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

      if (!confDirFile.canRead()) {
        throw new IOException("Resource directory must be readable by the Solr process: " + confDirFile.getAbsolutePath());
      }
      for (String file : HADOOP_CONF_FILES) {
        if (new File(confDirFile, file).exists()) {
          conf.addResource(new Path(confDir, file));
        }
      }
    }
    return conf;
  }
View Full Code Here

        return SiteConfiguration.getInstance(DefaultConfiguration.getInstance());
      } else {
        return new AccumuloConfiguration() {
          Configuration xml = new Configuration();
          {
            xml.addResource(new Path(siteFile));
          }

          @Override
          public Iterator<Entry<String,String>> iterator() {
            TreeMap<String,String> map = new TreeMap<String,String>();
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.