/** * Load a Hadoop configuration from a local file. * @param file file to load * @return a configuration which hasn't actually had the load triggered * yet. * @throws FileNotFoundException file is not there * @throws IOException any other IO problem */ public static Configuration loadConfFromFile(File file) throws IOException { return loadConfFromFile(file, false); }
/** * Load a Hadoop configuration from a local file. * @param file file to load * @return a configuration which hasn't actually had the load triggered * yet. * @throws FileNotFoundException file is not there * @throws IOException any other IO problem */ public static Configuration loadConfFromFile(File file) throws IOException { return loadConfFromFile(file, false); }
/** * Add a configuration from a file to an existing configuration * @param conf existing configuration * @param file file to load * @param overwrite flag to indicate new values should overwrite the predecessor * @return the merged configuration * @throws IOException */ public static Configuration addConfigurationFile(Configuration conf, File file, boolean overwrite) throws IOException { Configuration c2 = loadConfFromFile(file, false); mergeConfigurations(conf, c2, file.getAbsolutePath(), overwrite); return conf; }
/** * Add a configuration from a file to an existing configuration * @param conf existing configuration * @param file file to load * @param overwrite flag to indicate new values should overwrite the predecessor * @return the merged configuration * @throws IOException */ public static Configuration addConfigurationFile(Configuration conf, File file, boolean overwrite) throws IOException { Configuration c2 = loadConfFromFile(file, false); mergeConfigurations(conf, c2, file.getAbsolutePath(), overwrite); return conf; }
/** * Load a specific XML configuration file for the provider config * @param confDir configuration directory * @param siteXMLFilename provider-specific filename * @return a configuration to be included in status * @throws BadCommandArgumentsException argument problems * @throws IOException IO problems */ protected Configuration loadProviderConfigurationInformation(File confDir, String siteXMLFilename) throws BadCommandArgumentsException, IOException { Configuration siteConf; File siteXML = new File(confDir, siteXMLFilename); if (!siteXML.exists()) { throw new BadCommandArgumentsException( "Configuration directory %s doesn't contain %s - listing is %s", confDir, siteXMLFilename, SliderUtils.listDir(confDir)); } //now read it in siteConf = ConfigHelper.loadConfFromFile(siteXML); log.info("{} file is at {}", siteXMLFilename, siteXML); log.info(ConfigHelper.dumpConfigToString(siteConf)); return siteConf; }
/** * Load a specific XML configuration file for the provider config * @param confDir configuration directory * @param siteXMLFilename provider-specific filename * @return a configuration to be included in status * @throws BadCommandArgumentsException argument problems * @throws IOException IO problems */ protected Configuration loadProviderConfigurationInformation(File confDir, String siteXMLFilename) throws BadCommandArgumentsException, IOException { Configuration siteConf; File siteXML = new File(confDir, siteXMLFilename); if (!siteXML.exists()) { throw new BadCommandArgumentsException( "Configuration directory %s doesn't contain %s - listing is %s", confDir, siteXMLFilename, SliderUtils.listDir(confDir)); } //now read it in siteConf = ConfigHelper.loadConfFromFile(siteXML); log.info("{} file is at {}", siteXMLFilename, siteXML); log.info(ConfigHelper.dumpConfigToString(siteConf)); return siteConf; }
siteConf = ConfigHelper.loadConfFromFile(siteXML);
Configuration accumuloSite = ConfigHelper.loadConfFromFile( siteXML); String zkQuorum =