13 if ( argc > 1 ) fname = argv[1];
14 if ( argc > 2 ) nwrite = ::atol( argv[2] );
20 for (
size_t n = fids.
size(), i =
n; i <
n + nwrite; ++i ) {
25 txt <<
"PFN1_Test_" << i <<
".dat";
29 txt <<
"PFN2_Test_" << i <<
".dat";
32 txt <<
"PFN3_Test_" << i <<
".dat";
35 txt <<
"lfn1_Test_" << i <<
".dat";
38 txt <<
"lfn2_Test_" << i <<
".dat";
41 txt <<
"lfn3_Test_" << i <<
".dat";
49 std::cout <<
"Used " << end <<
" seconds." 50 <<
" corresponding to " << float( end ) / float( nwrite ) <<
" entries/second." <<
std::endl;
53 time_t saved =
time(
nullptr ) - ( start +
end );
54 std::cout <<
"Used " << saved <<
" seconds." 55 <<
" corresponding to " << float( saved ) / float( nwrite ) <<
" entries/second." <<
std::endl;
67 if ( argc > 1 ) fname = argv[1];
73 start =
time(
nullptr );
76 start =
time(
nullptr );
77 size_t mult = prt ? 1 : 10;
79 for (
size_t i = 0, tot = ( mult * fids.
size() ); i < tot; ++i ) {
80 size_t ent = i % fids.
size();
83 XMLFileCatalog::Files pfn, lfn;
84 XMLFileCatalog::Attributes attrs;
86 for (
auto& elem : lfn ) {
98 for (
auto& elem : pfn ) {
110 size_t n = lfn.size() > pfn.size() ? lfn.size() : pfn.size();
111 n = n > attrs.size() ? n : attrs.size();
114 for (
size_t j = 0; j <
n; ++j ) {
115 if ( j < lfn.size() )
119 if ( j < pfn.size() )
123 if ( j < attrs.size() )
132 std::cout <<
"Used " << end <<
" seconds (" << (long)fids.
size() * mult <<
" entries)." 133 <<
" Corresponding to " << float( end ) / float( fids.
size() * mult ) <<
" entries/second." << std::endl;
void registerPFN(CSTR fid, CSTR pfn, CSTR ftype) const override
Create a FileID and Node of the physical file name with all the attributes.
std::string lookupPFN(CSTR fid) const override
Lookup file identifier by physical file name.
std::string lookupLFN(CSTR lfn) const override
Lookup file identifier by logical file name.
bool existsPFN(CSTR pfn) const override
Return the status of a physical file name.
void getMetaData(CSTR fid, Attributes &attr) const override
Dump all MetaData of the catalog for a given file ID.
auto end(reverse_wrapper< T > &w)
bool existsLFN(CSTR lfn) const override
Return the status of a logical file name.
void getLFN(CSTR fid, Files &files) const override
Dump all logical file names of the catalog associate to the FileID.
void setMetaData(CSTR fid, CSTR name, CSTR value) const override
Insert/update metadata item.
void registerLFN(CSTR fid, CSTR lfn) const override
Create a FileID and Node of the logical file name with all the attributes.
void commit() override
Save DOM catalog to file.
int testXMLFileCatalogWrite(int argc, char **argv)
void init() override
Parse the DOM tree of the XML catalog.
void registerFID(CSTR fid) const override
Create a FileID and Node.
void getPFN(CSTR fid, Files &files) const override
Dump all physical file names of the catalog and their attributes associate to the FileID...
This class constitutes the core of the XML based FileCatalog API for POOL.
bool dirty() const override
Check if the catalog should be updated.
std::string createFID() const override
Catalog interface.
int testXMLFileCatalogRead(int argc, char **argv)
Helper functions to set/get the application return code.
void getFID(Strings &fids) const override
Dump all file Identifiers.