#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 63 of file XMLCatalogTest.cpp.
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 ) {
87 if ( !
c.existsLFN( elem.first ) ) {
98 for (
auto& elem : pfn ) {
99 if ( !
c.existsPFN( elem.first ) ) {
109 c.getMetaData( fid, attrs );
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;
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.
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";
26 c.registerPFN( fid, txt.
str(),
"ROOT" );
27 c.registerPFN( fid, txt.
str(),
"ROOT" );
29 txt <<
"PFN2_Test_" << i <<
".dat";
30 c.registerPFN( fid, txt.
str(),
"ROOT" );
32 txt <<
"PFN3_Test_" << i <<
".dat";
33 c.registerPFN( fid, txt.
str(),
"ROOT" );
35 txt <<
"lfn1_Test_" << i <<
".dat";
36 c.registerLFN( fid, txt.
str() );
38 txt <<
"lfn2_Test_" << i <<
".dat";
39 c.registerLFN( fid, txt.
str() );
41 txt <<
"lfn3_Test_" << i <<
".dat";
42 c.registerLFN( fid, txt.
str() );
43 c.setMetaData( fid,
"Name1",
"Value1" );
44 c.setMetaData( fid,
"Name1",
"Value111" );
45 c.setMetaData( fid,
"Name2",
"Value2" );
46 c.setMetaData( fid,
"Name3",
"Value3" );
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;
This class constitutes the core of the XML based FileCatalog API for POOL.