#include "XMLFileCatalog.h"
#include <iostream>
#include <cstdio>
#include <ctime>
#include <sstream>
Go to the source code of this file.
int testXMLFileCatalogRead |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 65 of file XMLCatalogTest.cpp.
74 start =
time(
nullptr);
77 start =
time(
nullptr);
78 size_t mult = prt ? 1 : 10;
80 for(
size_t i=0, tot=(mult*fids.
size()); i<tot; ++i) {
81 size_t ent = i%fids.
size();
84 XMLFileCatalog::Files pfn, lfn;
85 XMLFileCatalog::Attributes attrs;
87 for(
auto & elem : lfn) {
88 if ( !
c.existsLFN(elem.first) ) {
99 for(
auto & elem : pfn) {
100 if ( !
c.existsPFN(elem.first) ) {
110 c.getMetaData(fid, attrs);
111 size_t n = lfn.size() > pfn.size() ? lfn.size() : pfn.size();
112 n = n > attrs.size() ? n : attrs.size();
115 for(
size_t j=0; j<
n; ++j) {
116 if ( j < lfn.size() )
std::cout << lfn[j].first <<
" ";
118 if ( j < pfn.size() )
std::cout << pfn[j].first <<
" ";
120 if ( j < attrs.size() )
std::cout << attrs[j].first <<
" " << attrs[j].
second <<
" ";
127 std::cout <<
"Used " << end <<
" seconds (" << (long)fids.
size()*mult <<
" entries)." 128 <<
" Corresponding to " << float(end)/float(fids.
size()*mult) <<
" entries/second."
auto end(reverse_wrapper< T > &w)
This class constitutes the core of the XML based FileCatalog API for POOL.
int testXMLFileCatalogWrite |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 9 of file XMLCatalogTest.cpp.
13 if (
argc>2 ) nwrite = ::atol(
argv[2]);
19 for(
size_t n=fids.
size(), i=
n; i<
n+nwrite; ++i) {
24 txt <<
"PFN1_Test_" << i <<
".dat";
25 c.registerPFN(fid,txt.
str(),
"ROOT");
26 c.registerPFN(fid,txt.
str(),
"ROOT");
28 txt <<
"PFN2_Test_" << i <<
".dat";
29 c.registerPFN(fid,txt.
str(),
"ROOT");
31 txt <<
"PFN3_Test_" << i <<
".dat";
32 c.registerPFN(fid,txt.
str(),
"ROOT");
34 txt <<
"lfn1_Test_" << i <<
".dat";
35 c.registerLFN(fid,txt.
str());
37 txt <<
"lfn2_Test_" << i <<
".dat";
38 c.registerLFN(fid,txt.
str());
40 txt <<
"lfn3_Test_" << i <<
".dat";
41 c.registerLFN(fid,txt.
str());
42 c.setMetaData(fid,
"Name1",
"Value1");
43 c.setMetaData(fid,
"Name1",
"Value111");
44 c.setMetaData(fid,
"Name2",
"Value2");
45 c.setMetaData(fid,
"Name3",
"Value3");
48 std::cout <<
"Used " << end <<
" seconds." 49 <<
" corresponding to " << float(end)/float(nwrite) <<
" entries/second." 53 time_t saved =
time(
nullptr)-(start+
end);
54 std::cout <<
"Used " << saved <<
" seconds." 55 <<
" corresponding to " << float(saved)/float(nwrite) <<
" entries/second."
auto end(reverse_wrapper< T > &w)
This class constitutes the core of the XML based FileCatalog API for POOL.