14 #include <boost/algorithm/string.hpp> 22 bool useLFNasPFNifLFNnotFound,
24 : logicalFileNames_(
fileNames), fileNames_(
fileNames), fileCatalogItems_(), overrideFileLocator_() {
25 init(
override, useLFNasPFNifLFNnotFound, catType);
31 std::vector<std::string>
tmp;
34 tmp.push_back(
item.fileName(iCatalog));
40 bool useLFNasPFNifLFNnotFound,
42 typedef std::vector<std::string>::iterator iter;
47 std::make_unique<FileLocator>(inputOverride);
50 std::vector<std::string> tmps;
52 if (tmps.size() != 5) {
54 ex <<
"Trying to override input file catalog but invalid input override string " << inputOverride
55 <<
" (Should be site,subSite,storageSite,volume,protocol)";
56 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
67 std::make_unique<FileLocator>(inputOverride_struct);
74 ex <<
"edm::SiteLocalConfigService is not available";
75 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
80 std::vector<std::string>
const& tmp_dataCatalogs = localconfservice->trivialDataCatalogs();
84 for (
const auto&
catalog : tmp_dataCatalogs) {
89 <<
"Caught an exception while constructing a file locator in InputFileCatalog::init: " <<
e.what()
90 <<
"Skip this catalog";
95 ex <<
"Unable to construct any file locator in InputFileCatalog::init";
96 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
100 std::vector<edm::CatalogAttributes>
const& tmp_dataCatalogs = localconfservice->dataCatalogs();
104 for (
const auto&
catalog : tmp_dataCatalogs) {
109 <<
"Caught an exception while constructing a file locator in InputFileCatalog::init: " <<
e.what()
110 <<
"Skip this catalog";
115 ex <<
"Unable to construct any file locator in InputFileCatalog::init";
116 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
121 ex <<
"Undefined catalog type";
122 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
129 std::vector<std::string> pfns;
132 ex <<
"An empty string specified in the fileNames parameter for input source";
133 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
137 if (it->back() ==
':') {
139 ex <<
"An empty physical file name specified in the fileNames parameter for input source";
140 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
148 findFile(*lt, pfns, useLFNasPFNifLFNnotFound, catType);
156 std::vector<std::string>& pfns,
157 bool useLFNasPFNifLFNnotFound,
165 if (pfn.empty() && useLFNasPFNifLFNnotFound)
173 if (pfn.empty() && useLFNasPFNifLFNnotFound)
180 ex <<
"Undefined catalog type";
181 ex.
addContext(
"Calling edm::InputFileCatalog::findFile()");
static void trim(std::string &s)
def split(sequence, size)
void addContext(std::string const &context)
Log< level::Warning, false > LogWarning