optional HBaseConfigurationLoader::LoadResources()

in src/hbase/client/hbase-configuration-loader.cc [134:156]


optional<Configuration> HBaseConfigurationLoader::LoadResources(
    const std::string &search_path, const std::vector<std::string> &resources) {
  SetSearchPath(search_path);
  for (const auto &resource : resources) AddResources(resource);
  ConfigMap conf_property;
  bool success = false;
  for (auto dir : search_paths_) {
    for (auto file : resources_) {
      std::string config_file = dir + file;
      std::ifstream stream(config_file);
      if (stream.is_open()) {
        success |= LoadProperties(config_file, conf_property);
      } else {
        DLOG(WARNING) << "Unable to open file[" << config_file << "]";
      }
    }
  }
  if (success) {
    return Configuration(conf_property);
  } else {
    return none;
  }
}