Skip to content

Commit 0b7c531

Browse files
committed
Remove obsolete TrivialFileCatalog
1 parent 66c19aa commit 0b7c531

File tree

14 files changed

+165
-539
lines changed

14 files changed

+165
-539
lines changed

FWCore/Catalog/interface/FileLocator.h

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,48 @@
11
#ifndef FWCore_Catalog_FileLocator_h
22
#define FWCore_Catalog_FileLocator_h
33

4-
#include "FWCore/Catalog/interface/SiteLocalConfig.h"
5-
#include <string>
6-
#include <list>
74
#include <map>
8-
#include <utility>
95
#include <regex>
10-
#include "tinyxml2.h"
6+
#include <string>
7+
#include <vector>
8+
119
#include <boost/property_tree/ptree.hpp>
1210

1311
namespace edm {
1412

13+
struct CatalogAttributes;
14+
1515
class FileLocator {
1616
public:
1717
explicit FileLocator(
18-
edm::CatalogAttributes const& catAttr,
18+
CatalogAttributes const& catalogAttributes,
1919
unsigned iCatalog = 0,
2020
//storageDescriptionPath is used to override path provided by SiteLocalConfig. This is used in FileLocator_t.cpp tests
2121
std::string const& storageDescriptionPath = std::string());
22-
explicit FileLocator(std::string const& catUrl, unsigned iCatalog = 0);
2322

24-
~FileLocator();
25-
26-
std::string pfn(std::string const& ilfn, edm::CatalogType catType) const;
23+
std::string pfn(std::string const& ilfn) const;
2724

2825
private:
29-
/** For the time being the only allowed configuration item is a
30-
* prefix to be added to the GUID/LFN.
31-
*/
3226
struct Rule {
3327
std::regex pathMatch;
34-
std::regex destinationMatch;
3528
std::string result;
3629
std::string chain;
3730
};
3831

39-
typedef std::vector<Rule> Rules;
40-
typedef std::map<std::string, Rules> ProtocolRules;
32+
using Rules = std::vector<Rule>;
33+
using ProtocolRules = std::map<std::string, Rules>;
4134

42-
void init_trivialCatalog(std::string const& catUrl, unsigned iCatalog);
35+
void init(CatalogAttributes const& catalogAttributes, unsigned iCatalog, std::string const& storageDescriptionPath);
4336

44-
void parseRuleTrivialCatalog(tinyxml2::XMLElement* ruleNode, ProtocolRules& rules);
45-
//using data-access
46-
void init(edm::CatalogAttributes const& input_dataCatalog,
47-
unsigned iCatalog,
48-
std::string const& storageDescriptionPath);
4937
void parseRule(boost::property_tree::ptree::value_type const& storageRule,
5038
std::string const& protocol,
5139
ProtocolRules& rules);
5240

53-
std::string applyRules(ProtocolRules const& protocolRules,
54-
std::string const& protocol,
55-
std::string const& destination,
56-
bool direct,
57-
std::string name) const;
58-
59-
std::string convert(std::string const& input, ProtocolRules const& rules, bool direct) const;
41+
std::string applyRules(ProtocolRules const& protocolRules, std::string const& protocol, std::string name) const;
6042

61-
/** Direct rules are used to do the mapping from LFN to PFN.*/
62-
ProtocolRules m_directRules_trivialCatalog;
63-
/** Inverse rules are used to do the mapping from PFN to LFN*/
64-
ProtocolRules m_inverseRules;
6543
/** Direct rules are used to do the mapping from LFN to PFN taken from storage.json*/
6644
ProtocolRules m_directRules;
67-
68-
std::string m_fileType;
69-
std::string m_filename;
70-
//TFC allows more than one protocols provided in a catalog, separated by a comma
71-
//In new Rucio storage description, only one protocol is provided in a catalog
72-
//This variable can be simplified in the future
73-
std::vector<std::string> m_protocols;
74-
std::string m_destination;
45+
std::string m_protocol;
7546
};
7647
} // namespace edm
7748

FWCore/Catalog/interface/InputFileCatalog.h

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,40 @@
22
#define FWCore_Catalog_InputFileCatalog_h
33
//////////////////////////////////////////////////////////////////////
44
//
5-
// Class InputFileCatalog. Services to manage InputFile catalog.
6-
// Physical file names, pfns_ of FileCatalogItem, are constructed from multiple data catalogs in site-local-config.xml. Each member of pfns_ corresponds to a data catalog.
7-
// Note that fileNames(unsigned iCatalog) of InputFileCatalog return physical file names of all input files corresponding to a data catalog (for example, a job has 10 input files provided as a PoolSource, the fileNames(unsigned iCatalog) will return PFNs of these 10 files constructed from a data catalog)
8-
// Set catType=TrivialCatalog: use trivial data catalogs from <event-data>
9-
// Set catType=RucioCatalog: use data catalogs from <data-access> and storage.json
5+
// Class InputFileCatalog.
6+
//
7+
// The physical file names, pfns_ of each FileCatalogItem, are constructed from
8+
// multiple data catalogs in site-local-config.xml. Each member of pfns_ corresponds
9+
// to a data catalog.
10+
//
11+
// Note that InputFileCatalog::fileNames(unsigned iCatalog) returns the physical file
12+
// names of all input files corresponding to a data catalog (for example, a job has
13+
// 10 input files provided via a PoolSource, InputFileCatalog::fileNames(unsigned iCatalog)
14+
// will return the PFNs of those 10 files constructed from one data catalog)
15+
//
16+
// Catalogs are based on Rucio (from <data-access> and storage.json)
17+
//
18+
// Note that support for TrivialFileCatalog was removed in 2025.
1019
//
1120
//////////////////////////////////////////////////////////////////////
1221

1322
#include <memory>
1423
#include <string>
24+
#include <utility>
1525
#include <vector>
16-
#include "FWCore/Catalog/interface/FileLocator.h"
26+
1727
#include "FWCore/Utilities/interface/propagate_const.h"
1828

1929
namespace edm {
30+
31+
class FileLocator;
32+
2033
class FileCatalogItem {
2134
public:
2235
FileCatalogItem(std::vector<std::string> pfns, std::string lfn) : pfns_(std::move(pfns)), lfn_(std::move(lfn)) {}
2336

2437
std::string const& fileName(unsigned iCatalog) const { return pfns_[iCatalog]; }
2538
std::string const& logicalFileName() const { return lfn_; }
26-
2739
std::vector<std::string> const& fileNames() const { return pfns_; }
2840

2941
private:
@@ -33,34 +45,23 @@ namespace edm {
3345

3446
class InputFileCatalog {
3547
public:
36-
InputFileCatalog(std::vector<std::string> fileNames,
48+
InputFileCatalog(std::vector<std::string> logicalFileNames,
3749
std::string const& override,
38-
bool useLFNasPFNifLFNnotFound = false,
39-
//switching between two catalog types
40-
//edm::CatalogType catType = edm::CatalogType::TrivialCatalog);
41-
edm::CatalogType catType = edm::CatalogType::RucioCatalog);
42-
50+
bool useLFNasPFNifLFNnotFound = false);
4351
~InputFileCatalog();
52+
4453
std::vector<FileCatalogItem> const& fileCatalogItems() const { return fileCatalogItems_; }
4554
std::vector<std::string> fileNames(unsigned iCatalog) const;
4655
bool empty() const { return fileCatalogItems_.empty(); }
4756
static bool isPhysical(std::string const& name) { return (name.empty() || name.find(':') != std::string::npos); }
4857

4958
private:
50-
void init(std::vector<std::string> logicalFileNames,
51-
std::string const& override,
52-
bool useLFNasPFNifLFNnotFound,
53-
edm::CatalogType catType);
54-
void findFile(std::string const& lfn,
55-
std::vector<std::string>& pfns,
56-
bool useLFNasPFNifLFNnotFound,
57-
edm::CatalogType catType);
58-
std::vector<FileCatalogItem> fileCatalogItems_;
59-
edm::propagate_const<std::unique_ptr<FileLocator>> overrideFileLocator_;
59+
void init(std::vector<std::string> logicalFileNames, std::string const& override, bool useLFNasPFNifLFNnotFound);
60+
void findFile(std::string const& lfn, std::vector<std::string>& pfns, bool useLFNasPFNifLFNnotFound);
6061

61-
std::vector<edm::propagate_const<std::unique_ptr<FileLocator>>> fileLocators_trivalCatalog_;
62-
std::vector<edm::propagate_const<std::unique_ptr<FileLocator>>> fileLocators_;
62+
std::vector<FileCatalogItem> fileCatalogItems_;
63+
propagate_const<std::unique_ptr<FileLocator>> overrideFileLocator_;
64+
std::vector<propagate_const<std::unique_ptr<FileLocator>>> fileLocators_;
6365
};
6466
} // namespace edm
65-
6667
#endif

FWCore/Catalog/interface/SiteLocalConfig.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ namespace edm {
4343
std::string volume;
4444
std::string protocol;
4545
};
46-
47-
enum class CatalogType { TrivialCatalog, RucioCatalog };
4846
} // namespace edm
4947

5048
// PUBLIC VARIABLES
@@ -57,7 +55,6 @@ namespace edm {
5755
SiteLocalConfig() {}
5856
virtual ~SiteLocalConfig() {}
5957

60-
virtual std::vector<std::string> const& trivialDataCatalogs() const = 0;
6158
virtual std::vector<edm::CatalogAttributes> const& dataCatalogs() const = 0;
6259
virtual std::filesystem::path const storageDescriptionPath(const edm::CatalogAttributes& aDataCatalog) const = 0;
6360
virtual std::string const lookupCalibConnect(std::string const& input) const = 0;

0 commit comments

Comments
 (0)