#include "XMLFileCatalog.h"
#include <cstdio>
#include <ctime>
#include <iostream>
#include <sstream>
Go to the source code of this file.
int testXMLFileCatalogRead |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 62 of file XMLCatalogTest.cpp.
71 start =
time(
nullptr );
74 start =
time(
nullptr );
75 size_t mult = prt ? 1 : 10;
77 for (
size_t i = 0, tot = ( mult * fids.
size() ); i < tot; ++i ) {
78 size_t ent = i % fids.
size();
81 XMLFileCatalog::Files pfn, lfn;
82 XMLFileCatalog::Attributes attrs;
84 for (
auto& elem : lfn ) {
85 if ( !
c.existsLFN( elem.first ) ) {
96 for (
auto& elem : pfn ) {
97 if ( !
c.existsPFN( elem.first ) ) {
107 c.getMetaData( fid, attrs );
108 size_t n = lfn.size() > pfn.size() ? lfn.size() : pfn.size();
109 n = n > attrs.size() ? n : attrs.size();
112 for (
size_t j = 0; j <
n; ++j ) {
113 if ( j < lfn.size() )
117 if ( j < pfn.size() )
121 if ( j < attrs.size() )
130 std::cout <<
"Used " << end <<
" seconds (" << (long)fids.
size() * mult <<
" entries)." 131 <<
" Corresponding to " << float( end ) / float( fids.
size() * mult ) <<
" entries/second." << std::endl;
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." <<
std::endl;
52 time_t saved =
time(
nullptr ) - ( start +
end );
53 std::cout <<
"Used " << saved <<
" seconds." 54 <<
" corresponding to " << float( saved ) / float( nwrite ) <<
" entries/second." <<
std::endl;
This class constitutes the core of the XML based FileCatalog API for POOL.