![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Main file.
More...
#include <iostream>
#include <fstream>
#include <iomanip>
#include <nlohmann/json.hpp>
#include <CrestApi/CrestApiExt.h>
#include <filesystem>
#include <CrestApi/picosha2.h>
#include "CxxUtils/checker_macros.h"
Go to the source code of this file.
|
void | print_path () |
|
bool | createDirTree (const std::string &full_path) |
|
void | testCreateTag (const std::string &tagname) |
|
void | testCreateTag2 () |
|
void | testCreateTagF (const std::string &tagname) |
|
void | testListTags () |
|
void | testListTagsParams () |
|
void | testListTagsParams (const std::string &name) |
|
void | testFindTag (const std::string &tagname) |
|
void | testRemoveTag (const std::string &tagname) |
|
void | testUpdateTag (const std::string &tagname) |
|
void | testUpdateTagSpecification (const std::string &tagname) |
|
void | testCreateGlobalTag (const std::string &tagname) |
|
void | testFindGlobalTag (const std::string &tagname) |
|
void | testListGlobalTags () |
|
void | testListGlobalTagsAsString () |
|
void | testListGlobalTagsParams (const std::string &name, int size, int page) |
|
void | testRemoveGlobalTag (const std::string &tagname) |
|
void | testUpdateGlobalTag (const std::string &tagname) |
|
void | testFindGlobalTagAsString (const std::string &tagname) |
|
void | testCreateRunLumiInfo () |
|
void | testCreateRunLumiInfo2 () |
|
void | testListRunLumiInfo () |
|
void | testFindGlobalTagMap (const std::string &mapname) |
|
void | testCreateGlobalTagMap (const std::string &globaltag, const std::string &tagname) |
|
void | testGetJson () |
|
void | testStorePayload (const std::string &tagname) |
|
void | testStorePayloadDump (const std::string &tagname) |
|
void | testFindAllIovs (const std::string &tagname) |
|
void | testFindAllIovsParams (const std::string &tagname, int size, int page) |
|
void | testFindAllIovsFS (const std::string &tagname) |
|
void | testFindAllIovsFSPlus (const std::string &tagname, int size, int page) |
|
void | testSelectIovsParams (const std::string &tagname, long since, long until) |
|
void | testSelectIovsFS (const std::string &tagname, long since, long until) |
|
void | testSelectIovs (const std::string &tagname) |
|
void | testSelectIovs (const std::string &tagname, long since, long until, long snapshot) |
|
void | testSelectGroups (const std::string &tagname) |
|
void | testCreateTagMetaInfo (const std::string &tagname) |
|
void | testCreateTagMetaInfo2Args (const std::string &tagname) |
|
void | testCreateTagMetaInfo2 (const std::string &tagname) |
|
void | testCreateTagMetaInfoDetailed (const std::string &tagname) |
|
void | testGetTagMetaInfo (const std::string &tagname) |
|
void | testUpdateTagMetainfo (const std::string &tagname) |
|
void | testCreateTagMetaInfoIOVDbSvc (const std::string &tagname) |
|
void | testGetTagMetaInfoIOVDbSvc (const std::string &tagname) |
|
void | testConvertTagMetaInfo2CREST () |
|
void | testListPayloadTagInfo () |
|
void | testListPayloadTagInfo (const std::string &tagname) |
|
void | testGetBlobInStream (const std::string &hash) |
|
void | testGetBlob (const std::string &hash) |
|
void | testGetPayloadAsJson (const std::string &hash) |
|
void | testGetPayloadAsString (const std::string &hash) |
|
void | testGetPayloadMetaInfoAsString (const std::string &hash) |
|
void | testGetPayloadMetaInfo (const std::string &hash) |
|
void | testCreateTagMetaInfoDetailedFs (const std::string &tagname) |
|
void | testGetTagMetaInfoFs (const std::string &tagname) |
|
void | testUpdateTagMetaInfoFs (const std::string &tagname) |
|
void | testFindTagFs (const std::string &tagname) |
|
void | testCreateTagFs (const std::string &tagname) |
|
void | testStoreBatchPayloadsFs (const std::string &tagname) |
|
void | testCreateGlobalTagFs (const std::string &tagname) |
|
void | testFindGlobalTagFs (const std::string &tagname) |
|
void | testCreateGlobalTagMapFs (const std::string &globaltag, const std::string &tagname) |
|
void | testFindGlobalTagMapFs (const std::string &tagname) |
|
void | testGetHash (const std::string &str) |
|
void | hashCalculationTest (const std::string &str) |
|
void | testCreateGlobalTag (const std::string &tagname, const std::string &description) |
|
void | testCreateGlobalTagMap (const std::string &globaltag, const std::string &tagname, const std::string &record, const std::string &label) |
|
void | testGetDateAndTime () |
|
void | testGetPayloadAsStringFS (const std::string &hash) |
|
void | testGetPayloadAsJsonFS (const std::string &hash) |
|
void | testGetPayloadMetaInfoAsStringFS (const std::string &hash) |
|
void | testGetPayloadMetaInfoAsJsonFS (const std::string &hash) |
|
void | testGetBlobInStreamFS (const std::string &hash) |
|
void | testGetBlobFS (const std::string &hash) |
|
void | testReturnJArray () |
|
void | testStoreBatchPayloads (const std::string &tagname) |
|
void | testStoreBatchPayloadsB (const std::string &tagname) |
|
void | testTagAndStoreBatchFsNItems (const std::string &tagname, int n) |
|
void | testTagAndStoreBatchFs (const std::string &tagname) |
|
void | testTagAndStoreBatchFsB (const std::string &tagname) |
|
void | testGetSize (const std::string &tagname) |
|
void | testGetSizeFS (const std::string &tagname) |
|
void | test01 () |
|
void | testGetTagDataInfo (const std::string &tagname) |
|
void | testGetFirstLetters (const std::string &str) |
|
void | testCreateIOV (const std::string &tagname1, const std::string &tagname2) |
|
void | testStoreBatchIOVs (const std::string &tagname1, const std::string &tagname2) |
|
void | testGetMgmtInfo () |
|
void | testGetCrestVersion () |
|
void | testGetClientVersion () |
|
void | testGetMajorVersion () |
|
void | testCheckCrestVersion () |
|
void | testGetCrestVersion2 () |
|
void | testCheckCrestVersion2 () |
|
void | testConstructor () |
|
void | testRemoveTagFromGlobalTagMap (const std::string &global_tag) |
|
void | testStoreBatchPayloadsFiles (const std::string &tagname) |
|
void | testStoreData (const std::string &tagname) |
|
void | testStoreDataArray (const std::string &tagname) |
|
void | testCreateGlobalTagMap2 (const std::string &globaltag, const std::string &tagname) |
|
void | testSelectGroups2 (const std::string &tagname, int groupsize) |
|
int | main (int argc, char *argv[]) |
|
Main file.
This file contains the examples for the CREST C++ Client Library. Main part of the examples is commented. Pl testCreateGlobalTagMapFsease uncomment the code you need. Check and correct (if it is necessary) the CREST Server parameters in CrestClient instances.
Definition in file crest_example.cxx.
◆ createDirTree()
bool createDirTree |
( |
const std::string & |
full_path | ) |
|
Definition at line 33 of file crest_example.cxx.
37 while (ret_val ==
true &&
pos != std::string::npos) {
38 pos = full_path.find(
'/',
pos + 1);
39 ret_val = std::filesystem::create_directory(full_path.substr(0,
pos));
◆ hashCalculationTest()
void hashCalculationTest |
( |
const std::string & |
str | ) |
|
Definition at line 1481 of file crest_example.cxx.
1482 std::cout <<
"Hash(" <<
str <<
") = ";
1484 std::cout << hash_hex_str << std::endl;
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 2559 of file crest_example.cxx.
2568 std::string
tagname =
"test_tag_01";
2619 std::cout <<
"CREST Server path not found" << std::endl;
2620 std::cout <<
"Please, run this program with a server path:" << std::endl;
2621 std::cout <<
"crest_example http://crest-undertow-api.web.cern.ch" << std::endl;
2623 std::cout <<
"Test ended" << std::endl;
◆ print_path()
◆ test01()
Definition at line 1909 of file crest_example.cxx.
1910 map<std::string, std::string>
m;
1914 cout <<
"Map Listing 1: " << endl;
1915 for (
int i = 0;
it !=
m.end(); ++
it, ++
i) {
1916 cout <<
i <<
") key: " <<
it->first <<
", value: " <<
it->second << endl;
1919 bool rewrite =
true;
1922 std::cout <<
"IOV List = " << std::endl <<
iovs.dump(4) << std::endl;
1925 std::cout <<
"IOV number = " <<
length << std::endl;
1927 std::cout <<
"item (" <<
i <<
") = " << std::endl <<
iovs[
i].dump(4) << std::endl;
1929 auto r =
iovs[
i].find(
"payloadHash");
1931 std::string
hash =
iovs[
i].value(
"payloadHash",
"NONE");
1932 std::cout <<
"hash = " <<
hash << std::endl;
1933 std::cout <<
"iov = " <<
iovs[
i].dump() << std::endl;
1939 cout <<
"Map Listing 2: " << endl;
1940 for (
int i = 0;
it !=
m.end(); ++
it, ++
i) {
1941 cout <<
i <<
") key: " <<
it->first <<
", value: " <<
it->second << endl;
◆ testCheckCrestVersion()
void testCheckCrestVersion |
( |
| ) |
|
Definition at line 2295 of file crest_example.cxx.
2296 std::cout << std::endl <<
"test: checkCrestVersion" << std::endl;
2301 std::cout <<
"test is OK." << std::endl;
2304 std::cout << std::endl <<
"test: checkCrestVersion (failed)" << std::endl;
2305 std::cout <<
e.what() << std::endl;
◆ testCheckCrestVersion2()
void testCheckCrestVersion2 |
( |
| ) |
|
Definition at line 2326 of file crest_example.cxx.
2327 std::cout << std::endl <<
"test: checkCrestVersion2" << std::endl;
2332 std::cout <<
"test is OK." << std::endl;
2335 std::cout << std::endl <<
"test: checkCrestVersion2 (failed)" << std::endl;
2336 std::cout <<
e.what() << std::endl;
◆ testConstructor()
Definition at line 2340 of file crest_example.cxx.
2341 std::cout << std::endl <<
"test: testConstructor" << std::endl;
◆ testConvertTagMetaInfo2CREST()
void testConvertTagMetaInfo2CREST |
( |
| ) |
|
Definition at line 1023 of file crest_example.cxx.
1024 std::cout << std::endl <<
"test: convertTagMetaInfo2CREST" << std::endl;
1027 std::string
tagname =
"test_MvG4";
1036 {
"channel_list", chanList},
1037 {
"node_description",
"description of the node"},
1039 "AlgorithmID:UInt32,LBAvInstLumi:Float,LBAvEvtsPerBX:Float,LumiType:UInt32,Valid:UInt32,BunchInstLumi:Blob64k"}
1042 std::cout << std::endl <<
"tagInfo = " << std::endl
1043 << tagInfo.dump(4) << std::endl;
1047 std::cout << std::endl
1048 <<
"Tag Meta Info in CREST format = " <<
res.dump(4) << std::endl;
1051 std::cout << std::endl <<
"test: convertTagMetaInfo2CREST (failed)" << std::endl;
1052 std::cerr <<
e.what() << std::endl;
◆ testCreateGlobalTag() [1/2]
void testCreateGlobalTag |
( |
const std::string & |
tagname | ) |
|
Definition at line 266 of file crest_example.cxx.
267 std::cout << std::endl <<
"test: createGlobalTag" << std::endl;
274 {
"description",
"test"},
276 {
"insertionTime",
"2018-12-18T11:32:58.081+0000"},
277 {
"snapshotTime",
"2018-12-18T11:32:57.952+0000"},
278 {
"scenario",
"test"},
281 {
"snapshotTimeMilli",
"null"},
282 {
"insertionTimeMilli",
"null"}
287 std::cout << std::endl <<
"test: createGlobalTag (success) " << std::endl;
290 std::cout << std::endl <<
"test: createGlobalTag (failed)" << std::endl;
291 std::cout <<
e.what() << std::endl;
◆ testCreateGlobalTag() [2/2]
void testCreateGlobalTag |
( |
const std::string & |
tagname, |
|
|
const std::string & |
description |
|
) |
| |
Definition at line 1489 of file crest_example.cxx.
1490 std::cout << std::endl <<
"test: createGlobalTag (2 parameters)" << std::endl;
1495 std::cout << std::endl <<
"test: createGlobalTag (success) (2 parameters)" << std::endl;
1498 std::cout << std::endl <<
"test: createGlobalTag (failed) (2 parameters)" << std::endl;
1499 std::cout <<
e.what() << std::endl;
◆ testCreateGlobalTagFs()
void testCreateGlobalTagFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1384 of file crest_example.cxx.
1385 std::cout << std::endl <<
"test: createGlobalTagFs" << std::endl;
1387 bool rewrite =
true;
1394 {
"description",
"test"},
1396 {
"insertionTime",
"2018-12-18T11:32:58.081+0000"},
1397 {
"snapshotTime",
"2018-12-18T11:32:57.952+0000"},
1398 {
"scenario",
"test"},
1401 {
"snapshotTimeMilli",
"null"},
1402 {
"insertionTimeMilli",
"null"}
1407 std::cout << std::endl <<
"test: createGlobalTagFs (success) " << std::endl;
1410 std::cout << std::endl <<
"test: createGlobalTagFs (failed)" << std::endl;
1411 std::cout <<
e.what() << std::endl;
◆ testCreateGlobalTagMap() [1/2]
void testCreateGlobalTagMap |
( |
const std::string & |
globaltag, |
|
|
const std::string & |
tagname |
|
) |
| |
Definition at line 539 of file crest_example.cxx.
540 std::cout << std::endl <<
"test: createGlobalTagMap" << std::endl;
546 {
"record",
"testing2"},
553 std::cout << std::endl <<
"test: createGlobalTagMap (success) " << std::endl;
556 std::cout << std::endl <<
"test: createGlobalTagMap (failed)" << std::endl;
557 std::cout <<
e.what() << std::endl;
◆ testCreateGlobalTagMap() [2/2]
void testCreateGlobalTagMap |
( |
const std::string & |
globaltag, |
|
|
const std::string & |
tagname, |
|
|
const std::string & |
record, |
|
|
const std::string & |
label |
|
) |
| |
Definition at line 1504 of file crest_example.cxx.
1506 std::cout << std::endl <<
"test: createGlobalTagMap (all parameters)" << std::endl;
1519 std::cout << std::endl <<
"test: createGlobalTagMap (all parameters) (success) " << std::endl;
1522 std::cout << std::endl <<
"test: createGlobalTagMap (all parameters) (failed)" << std::endl;
1523 std::cout <<
e.what() << std::endl;
◆ testCreateGlobalTagMap2()
void testCreateGlobalTagMap2 |
( |
const std::string & |
globaltag, |
|
|
const std::string & |
tagname |
|
) |
| |
Definition at line 2521 of file crest_example.cxx.
2522 std::cout << std::endl <<
"test: createGlobalTagMap" << std::endl;
2528 {
"record",
"testing3"},
2535 std::cout << std::endl <<
"test: createGlobalTagMap (success) " << std::endl;
2538 std::cout << std::endl <<
"test: createGlobalTagMap (failed)" << std::endl;
2539 std::cout <<
e.what() << std::endl;
◆ testCreateGlobalTagMapFs()
void testCreateGlobalTagMapFs |
( |
const std::string & |
globaltag, |
|
|
const std::string & |
tagname |
|
) |
| |
Definition at line 1433 of file crest_example.cxx.
1434 std::cout << std::endl <<
"test: createGlobalTagMapFs" << std::endl;
1435 bool rewrite =
true;
1441 {
"record",
"testing2"},
1448 std::cout << std::endl <<
"test: createGlobalTagMapFs (success) " << std::endl;
1451 std::cout << std::endl <<
"test: createGlobalTagMapFs (failed)" << std::endl;
1452 std::cout <<
e.what() << std::endl;
◆ testCreateIOV()
void testCreateIOV |
( |
const std::string & |
tagname1, |
|
|
const std::string & |
tagname2 |
|
) |
| |
Definition at line 1977 of file crest_example.cxx.
1978 std::cout << std::endl <<
"test: createIOV" << std::endl;
1984 {
"description",
"none"},
1985 {
"endOfValidity", 0},
1986 {
"insertionTime",
"2018-12-06T11:18:35.641+0000"},
1987 {
"lastValidatedTime", 0},
1988 {
"modificationTime",
"2018-12-06T11:18:35.641+0000"},
1990 {
"payloadSpec",
"stave: Int32, eta: Int32, mag: Float, base: Float, free: Float"},
1991 {
"synchronization",
"none"},
1992 {
"timeType",
"time"}
1995 std::cout <<
"tag 1 = " << std::endl << js.dump(4) << std::endl;
1999 std::cout << std::endl <<
"Tag " << tagname1 <<
" created" << std::endl;
2002 std::cout << std::endl <<
"ERROR: tag " << tagname1 <<
" creation failed" << std::endl;
2003 std::cout <<
e.what() << std::endl;
2007 js[
"name"] = tagname2;
2009 std::cout <<
"tag 2 = " << std::endl << js.dump(4) << std::endl;
2013 std::cout << std::endl <<
"Tag " << tagname2 <<
" created" << std::endl;
2016 std::cout << std::endl <<
"ERROR: tag " << tagname2 <<
" creation failed" << std::endl;
2017 std::cout <<
e.what() << std::endl;
2027 std::string
str =
"[{\"data\":" +
d1 +
",\"since\":100},{\"data\":" +
d2 +
",\"since\":150}]";
2032 std::cout << std::endl <<
"2 IOVs created in tag " << tagname1 << std::endl;
2035 std::cout << std::endl <<
"ERROR: payloads and IOVs were not created." << std::endl;
2036 std::cerr <<
e.what() << std::endl;
2044 std::cout << std::endl <<
"IOV list for tag " << tagname1 <<
" =" << std::endl;
2045 std::cout <<
iovList.dump(4) << std::endl;
2047 int listSize =
iovList.size();
2049 for (
int j = 0; j < listSize; j++) {
2054 newIov[
"tagName"] = tagname2;
2060 std::cout <<
"ERROR: Cannot write the IOV for the tag \"" << tagname2 <<
"\"" << std::endl;
2061 std::cerr <<
e.what() << std::endl;
2068 std::cout << std::endl <<
"ERROR: cannot get IOV list for tag " << tagname1 << std::endl;
2069 std::cerr <<
e.what() << std::endl;
2075 std::cout << std::endl <<
"IOV list for tag " << tagname2 <<
" =" << std::endl;
2076 std::cout <<
iovList.dump(4) << std::endl;
2079 std::cout << std::endl <<
"ERROR: cannot get IOV list for tag " << tagname2 << std::endl;
2080 std::cerr <<
e.what() << std::endl;
◆ testCreateRunLumiInfo()
void testCreateRunLumiInfo |
( |
| ) |
|
Definition at line 428 of file crest_example.cxx.
429 std::cout << std::endl <<
"test: createRunLumiInfo" << std::endl;
433 "{\"since\":\"10\",\"run\":\"7777771\",\"lb\":\"62\",\"starttime\":\"10\",\"endtime\":\"200\"}";
435 std::cout <<
"run-lumi = " << std::endl
436 << js.dump(4) << std::endl;
440 std::cout << std::endl <<
"test: createRunLumiInfo (success) = " << std::endl;
443 std::cout << std::endl <<
"test: createRunLumiInfo (failed)" << std::endl;
444 std::cout <<
e.what() << std::endl;
◆ testCreateRunLumiInfo2()
void testCreateRunLumiInfo2 |
( |
| ) |
|
Definition at line 448 of file crest_example.cxx.
449 std::cout << std::endl <<
"test: createRunLumiInfo2" << std::endl;
464 {
"additionalProp1",
"test1"},
465 {
"additionalProp2",
"test2"},
466 {
"additionalProp3",
"test3"}
472 {
"totalElements", 0},
484 {
"datatype",
"string"},
485 {
"format",
"RunLumiSetDto"},
487 {
"filter", jsFilter},
491 std::cout <<
"run-lumi = " << std::endl
492 << jsRM.dump(4) << std::endl;
496 std::cout << std::endl <<
"test: createRunLumiInfo (success)" << std::endl;
499 std::cout << std::endl <<
"test: createRunLumiInfo (failed)" << std::endl;
500 std::cout <<
e.what() << std::endl;
◆ testCreateTag()
void testCreateTag |
( |
const std::string & |
tagname | ) |
|
Definition at line 49 of file crest_example.cxx.
50 std::cout << std::endl <<
"test: createTag" << std::endl;
55 {
"description",
"none"},
57 {
"insertionTime",
"2018-12-06T11:18:35.641+0000"},
58 {
"lastValidatedTime", 0},
59 {
"modificationTime",
"2018-12-06T11:18:35.641+0000"},
61 {
"payloadSpec",
"stave: Int32, eta: Int32, mag: Float, base: Float, free: Float"},
62 {
"synchronization",
"none"},
68 std::cout << std::endl <<
"test: createTag (success)" << std::endl;
71 std::cout << std::endl <<
"test: createTag (failed)" << std::endl;
72 std::cout <<
e.what() << std::endl;
◆ testCreateTag2()
Definition at line 76 of file crest_example.cxx.
77 std::cout << std::endl <<
"test: createTag2" << std::endl;
89 {
"name",
"CaloSwClusterCorrections.00-RUN2-02-11-clcon-dummy"},
91 "<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"250904980\" /></addrHeader><typeName>CaloRec::ToolConstants</typeName><fullrep/>"},
92 {
"timeType",
"run-lumi"},
93 {
"payloadSpec",
"PoolRef:String4k"}
98 std::cout << std::endl <<
"test: createTag2 (success)" << std::endl;
101 std::cout << std::endl <<
"test: createTag2 (failed)" << std::endl;
102 std::cout <<
e.what() << std::endl;
◆ testCreateTagF()
void testCreateTagF |
( |
const std::string & |
tagname | ) |
|
Definition at line 108 of file crest_example.cxx.
109 std::cout << std::endl <<
"test: createTagF" << std::endl;
112 std::string
path =
"/tmp/cresttest/crest_dump";
114 std::filesystem::create_directories(
path);
119 {
"description",
"none"},
120 {
"endOfValidity", 0},
121 {
"insertionTime",
"2018-12-06T11:18:35.641+0000"},
122 {
"lastValidatedTime", 0},
123 {
"modificationTime",
"2018-12-06T11:18:35.641+0000"},
125 {
"payloadSpec",
"stave: Int32, eta: Int32, mag: Float, base: Float, free: Float"},
126 {
"synchronization",
"none"},
132 std::cout << std::endl <<
"test: createTagF (success)" << std::endl;
135 std::cout << std::endl <<
"test: createTagF (failed)" << std::endl;
136 std::cout <<
e.what() << std::endl;
◆ testCreateTagFs()
void testCreateTagFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1331 of file crest_example.cxx.
1332 std::cout << std::endl <<
"test: createTagFs" << std::endl;
1334 bool rewrite =
true;
1339 {
"description",
"none"},
1340 {
"endOfValidity", 0},
1341 {
"insertionTime",
"2018-12-06T11:18:35.641+0000"},
1342 {
"lastValidatedTime", 0},
1343 {
"modificationTime",
"2018-12-06T11:18:35.641+0000"},
1345 {
"payloadSpec",
"stave: Int32, eta: Int32, mag: Float, base: Float, free: Float"},
1346 {
"synchronization",
"none"},
1347 {
"timeType",
"time"}
1352 std::cout << std::endl <<
"test: createTagFs (success)" << std::endl;
1355 std::cout << std::endl <<
"test: createTagFs (failed)" << std::endl;
1356 std::cout <<
e.what() << std::endl;
◆ testCreateTagMetaInfo()
void testCreateTagMetaInfo |
( |
const std::string & |
tagname | ) |
|
Definition at line 811 of file crest_example.cxx.
812 std::cout << std::endl <<
"test: createTagMetainfo" << std::endl;
818 {
"description",
"desc-01"},
819 {
"tagInfo",
"taginf-01"},
826 std::cout << std::endl <<
"test: createTagMetaInfo (success)" << std::endl;
829 std::cout << std::endl <<
"test: createTagMetaInfo (failed)" << std::endl;
830 std::cerr <<
e.what() << std::endl;
◆ testCreateTagMetaInfo2()
void testCreateTagMetaInfo2 |
( |
const std::string & |
tagname | ) |
|
Definition at line 871 of file crest_example.cxx.
872 std::cout << std::endl <<
"test: createTagMetainfo2" << std::endl;
880 "<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"},
881 {
"insertionTime",
"Fri Nov 13 16:31:10 2020"},
887 std::cout << std::endl <<
"test: createTagMetaInfo (success)" << std::endl;
890 std::cout << std::endl <<
"test: createTagMetaInfo (failed)" << std::endl;
891 std::cerr <<
e.what() << std::endl;
◆ testCreateTagMetaInfo2Args()
void testCreateTagMetaInfo2Args |
( |
const std::string & |
tagname | ) |
|
Definition at line 836 of file crest_example.cxx.
837 std::cout << std::endl <<
"test: createTagMetainfo" << std::endl;
843 {
"description",
"desc-01"},
844 {
"tagInfo",
"taginf-01"},
847 {
"insertionTime",
"2019-03-14T13:29:25.286Z"}
851 std::cout <<
"test A:" << std::endl;
853 std::cout <<
"test: createTagMetaInfo (success)" << std::endl;
856 std::cout << std::endl <<
"test: createTagMetaInfo (failed)" << std::endl;
857 std::cerr <<
e.what() << std::endl;
860 std::cout <<
"test B:" << std::endl;
862 std::cout <<
"test: createTagMetaInfo (success)" << std::endl;
865 std::cout << std::endl <<
"test: createTagMetaInfo (failed)" << std::endl;
866 std::cerr <<
e.what() << std::endl;
◆ testCreateTagMetaInfoDetailed()
void testCreateTagMetaInfoDetailed |
( |
const std::string & |
tagname | ) |
|
Definition at line 896 of file crest_example.cxx.
897 std::cout << std::endl <<
"test: createTagMetainfoDetailed" << std::endl;
902 std::cout << std::endl <<
"channel = " << std::endl
903 <<
channel.dump(4) << std::endl;
909 {
"channel_list", chanList},
910 {
"node_description",
"description of the node"},
911 {
"payload_spec",
"payload specification"}
914 std::cout << std::endl <<
"TagInfo = " << std::endl
915 << tagInfo.dump(4) << std::endl;
917 std::cout << std::endl <<
"TagInfo = " << std::endl
918 << tagInfo.dump() << std::endl;
923 {
"description",
"none"},
926 {
"tagInfo", tagInfo.dump()},
927 {
"insertionTime",
"2020-12-04"}
933 std::cout << std::endl <<
"test: createTagMetaInfoDetailed (success)" << std::endl;
936 std::cout << std::endl <<
"test: createTagMetaInfoDetailed (failed)" << std::endl;
937 std::cerr <<
e.what() << std::endl;
◆ testCreateTagMetaInfoDetailedFs()
void testCreateTagMetaInfoDetailedFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1204 of file crest_example.cxx.
1205 std::cout << std::endl <<
"test: createTagMetainfoDetailedFs" << std::endl;
1211 std::cout << std::endl <<
"channel = " << std::endl
1212 <<
channel.dump(4) << std::endl;
1218 {
"channel_list", chanList},
1219 {
"node_description",
"description of the node"},
1220 {
"payload_spec",
"payload specification"}
1223 std::cout << std::endl <<
"TagInfo = " << std::endl
1224 << tagInfo.dump(4) << std::endl;
1226 std::cout << std::endl <<
"TagInfo = " << std::endl
1227 << tagInfo.dump() << std::endl;
1232 {
"description",
"none"},
1235 {
"tagInfo", tagInfo.dump()},
1236 {
"insertionTime",
"2020-12-04"}
1242 std::cout << std::endl <<
"test: createTagMetaInfoDetailedFs (success)" << std::endl;
1245 std::cout << std::endl <<
"test: createTagMetaInfoDetailedFs (failed)" << std::endl;
1246 std::cerr <<
e.what() << std::endl;
◆ testCreateTagMetaInfoIOVDbSvc()
void testCreateTagMetaInfoIOVDbSvc |
( |
const std::string & |
tagname | ) |
|
Definition at line 980 of file crest_example.cxx.
981 std::cout << std::endl <<
"test: createTagMetainfoIOVDbSvc" << std::endl;
992 {
"channel_list", chanList},
993 {
"node_description",
"description of the node"},
995 "AlgorithmID:UInt32,LBAvInstLumi:Float,LBAvEvtsPerBX:Float,LumiType:UInt32,Valid:UInt32,BunchInstLumi:Blob64k"}
1000 std::cout << std::endl <<
"test: createTagMetaInfoIOVDbSvc (success)" << std::endl;
1003 std::cout << std::endl <<
"test: createTagMetaInfoIOVDbSvc (failed)" << std::endl;
1004 std::cerr <<
e.what() << std::endl;
◆ testFindAllIovs()
void testFindAllIovs |
( |
const std::string & |
tagname | ) |
|
Definition at line 650 of file crest_example.cxx.
651 std::cout << std::endl <<
"test: findAllIovs" << std::endl;
656 std::cout << std::endl <<
"test: findAllIovs (result) =" << std::endl;
657 std::cout << tag_info.dump(4) << std::endl;
660 std::cout << std::endl <<
"test: findAllIovs (failed)" << std::endl;
661 std::cerr <<
e.what() << std::endl;
◆ testFindAllIovsFS()
void testFindAllIovsFS |
( |
const std::string & |
tagname | ) |
|
Definition at line 685 of file crest_example.cxx.
686 std::cout << std::endl <<
"test: findAllIovsFS" << std::endl;
692 std::cout << std::endl <<
"test: findAllIovsFS (result) =" << std::endl;
693 std::cout << tag_info.dump(4) << std::endl;
696 std::cout << std::endl <<
"test: findAllIovsFS (failed)" << std::endl;
697 std::cerr <<
e.what() << std::endl;
◆ testFindAllIovsFSPlus()
void testFindAllIovsFSPlus |
( |
const std::string & |
tagname, |
|
|
int |
size, |
|
|
int |
page |
|
) |
| |
Definition at line 703 of file crest_example.cxx.
704 std::cout << std::endl <<
"test: findAllIovsFSPlus" << std::endl;
709 std::cout << std::endl <<
"test: findAllIovsFSPlus (result) =" << std::endl;
710 std::cout << tag_info.dump(4) << std::endl;
713 std::cout << std::endl <<
"test: findAllIovsFSPlus (failed)" << std::endl;
714 std::cerr <<
e.what() << std::endl;
◆ testFindAllIovsParams()
void testFindAllIovsParams |
( |
const std::string & |
tagname, |
|
|
int |
size, |
|
|
int |
page |
|
) |
| |
Definition at line 665 of file crest_example.cxx.
666 std::cout << std::endl <<
"test: findAllIovs with additional parameters" << std::endl;
673 std::cout << std::endl <<
"test: findAllIovs (result A) =" << std::endl;
674 std::cout << iov_list_1.dump(4) << std::endl;
676 std::cout << std::endl <<
"test: findAllIovs (result B) =" << std::endl;
677 std::cout << iov_list_2.dump(4) << std::endl;
680 std::cout << std::endl <<
"test: findAllIovs with additional parameters (failed)" << std::endl;
681 std::cerr <<
e.what() << std::endl;
◆ testFindGlobalTag()
void testFindGlobalTag |
( |
const std::string & |
tagname | ) |
|
Definition at line 295 of file crest_example.cxx.
296 std::cout << std::endl <<
"test: findGlobalTag" << std::endl;
301 std::cout << std::endl <<
"test: findGlobalTag (result) = " << std::endl
302 << tag_info.dump(4) << std::endl;
305 std::cout << std::endl <<
"test: findGlobalTag (failed)" << std::endl;
306 std::cout <<
e.what() << std::endl;
◆ testFindGlobalTagAsString()
void testFindGlobalTagAsString |
( |
const std::string & |
tagname | ) |
|
Definition at line 409 of file crest_example.cxx.
410 std::cout << std::endl <<
"test: findGlobalTagAsString" << std::endl;
415 std::cout << std::endl <<
"test: findGlobalTagAsString (result) = " << std::endl
416 << tag_info.dump(4) << std::endl;
419 std::cout << std::endl <<
"test: findGlobalTagAsString (failed)" << std::endl;
420 std::cout <<
e.what() << std::endl;
◆ testFindGlobalTagFs()
void testFindGlobalTagFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1415 of file crest_example.cxx.
1416 std::cout << std::endl <<
"test: findGlobalTagFs" << std::endl;
1417 bool rewrite =
true;
1422 std::cout << std::endl <<
"test: findGlobalTagFs (result) = " << std::endl
1423 << tag_info.dump(4) << std::endl;
1426 std::cout << std::endl <<
"test: findGlobalTagFs (failed)" << std::endl;
1427 std::cout <<
e.what() << std::endl;
◆ testFindGlobalTagMap()
void testFindGlobalTagMap |
( |
const std::string & |
mapname | ) |
|
Definition at line 523 of file crest_example.cxx.
524 std::cout << std::endl <<
"test: findGlobalTagMap" << std::endl;
529 std::cout << std::endl <<
"test: findGlobalTagMap (result) = "
530 << tag_info.dump(4) << std::endl;
533 std::cout << std::endl <<
"test: findGlobalTagMap (failed)" << std::endl;
534 std::cout <<
e.what() << std::endl;
◆ testFindGlobalTagMapFs()
void testFindGlobalTagMapFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1456 of file crest_example.cxx.
1457 std::cout << std::endl <<
"test: findGlobalTagMapFs" << std::endl;
1458 bool rewrite =
true;
1463 std::cout << std::endl <<
"test: findGlobalTagMapFs (result) = " << std::endl
1464 << tag_info.dump(4) << std::endl;
1467 std::cout << std::endl <<
"test: findGlobalTagMapFs (failed)" << std::endl;
1468 std::cout <<
e.what() << std::endl;
◆ testFindTag()
void testFindTag |
( |
const std::string & |
tagname | ) |
|
Definition at line 200 of file crest_example.cxx.
201 std::cout << std::endl <<
"test: findTag" << std::endl;
206 std::cout << std::endl <<
"test: findTag (result) =" << std::endl
207 << tag_info.dump(4) << std::endl;
210 std::cout << std::endl <<
"test: findTag (failed)" << std::endl;
211 std::cout <<
e.what() << std::endl;
◆ testFindTagFs()
void testFindTagFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1314 of file crest_example.cxx.
1315 std::cout << std::endl <<
"test: findTagFs" << std::endl;
1318 std::cout << std::endl <<
"test: findTagFs" << std::endl;
1322 std::cout << std::endl <<
"test: findTagFs (result) =" << std::endl
1323 << tag_info.dump(4) << std::endl;
1326 std::cout << std::endl <<
"test: findTagFs (failed)" << std::endl;
1327 std::cout <<
e.what() << std::endl;
◆ testGetBlob()
void testGetBlob |
( |
const std::string & |
hash | ) |
|
Definition at line 1117 of file crest_example.cxx.
1118 std::cout << std::endl <<
"test: getBlob" << std::endl;
1123 std::cout << std::endl <<
"test: getBlob (result) =" << std::endl;
1124 std::cout << tag_info7 << std::endl;
1125 std::cout << std::endl <<
"test: getBlob" << std::endl;
1128 std::cout << std::endl <<
"test: getBlob (failed)" << std::endl;
1129 std::cerr <<
e.what() << std::endl;
◆ testGetBlobFS()
void testGetBlobFS |
( |
const std::string & |
hash | ) |
|
Definition at line 1628 of file crest_example.cxx.
1629 std::cout << std::endl <<
"test: getBlobFs" << std::endl;
1634 std::cout << std::endl <<
"test: getBlobFs (result) =" << std::endl
1635 <<
info << std::endl;
1638 std::cout << std::endl <<
"test: getBlobFs (failed)" << std::endl;
1639 std::cout <<
e.what() << std::endl;
◆ testGetBlobInStream()
void testGetBlobInStream |
( |
const std::string & |
hash | ) |
|
Definition at line 1095 of file crest_example.cxx.
1096 std::cout << std::endl <<
"test: getBlobInStream" << std::endl;
1103 out8.open(
"data.txt");
1104 if (out8.is_open()) {
1106 std::cout << std::endl <<
"test: getBlobInStream test finished." << std::endl;
1107 std::cout << std::endl <<
"The blob for hash \"" <<
hash
1108 <<
"\" was written in the file \"data.txt\"." << std::endl;
1112 std::cout << std::endl <<
"test: getBlobInStream (failed)" << std::endl;
1113 std::cerr <<
e.what() << std::endl;
◆ testGetBlobInStreamFS()
void testGetBlobInStreamFS |
( |
const std::string & |
hash | ) |
|
Definition at line 1605 of file crest_example.cxx.
1606 std::cout << std::endl <<
"test: getBlobInStreamFs" << std::endl;
1613 out8.open(
"data.txt");
1614 if (out8.is_open()) {
1616 std::cout << std::endl <<
"test: getBlobInStreamFs (result) =" << std::endl;
1617 std::cout << tag_info8 << std::endl;
1618 std::cout <<
"blob is in the file data.txt" << std::endl;
1619 std::cout << std::endl <<
"test: getBlobInStreamFs" << std::endl;
1623 std::cout << std::endl <<
"test: getBlobInStreamFs (failed)" << std::endl;
1624 std::cerr <<
e.what() << std::endl;
◆ testGetClientVersion()
void testGetClientVersion |
( |
| ) |
|
Definition at line 2229 of file crest_example.cxx.
2230 std::cout << std::endl <<
"test: getClientVersion" << std::endl;
2235 std::cout << std::endl <<
"test: CrestApi version = "
2239 std::cout << std::endl <<
"test: getClientVersion (failed)" << std::endl;
2240 std::cout <<
e.what() << std::endl;
◆ testGetCrestVersion()
void testGetCrestVersion |
( |
| ) |
|
Definition at line 2214 of file crest_example.cxx.
2215 std::cout << std::endl <<
"test: getCrestVersion" << std::endl;
2220 std::cout << std::endl <<
"test: CREST server version = "
2224 std::cout << std::endl <<
"test: getCrestVersion (failed)" << std::endl;
2225 std::cout <<
e.what() << std::endl;
◆ testGetCrestVersion2()
void testGetCrestVersion2 |
( |
| ) |
|
Definition at line 2311 of file crest_example.cxx.
2312 std::cout << std::endl <<
"test: getCrestVersion2" << std::endl;
2317 std::cout << std::endl <<
"test: CREST server version = "
2321 std::cout << std::endl <<
"test: getCrestVersion2 (failed)" << std::endl;
2322 std::cout <<
e.what() << std::endl;
◆ testGetDateAndTime()
void testGetDateAndTime |
( |
| ) |
|
Definition at line 1529 of file crest_example.cxx.
1530 std::cout << std::endl <<
"test: getDateAndTime" << std::endl;
1535 std::cout << std::endl <<
"now = " <<
time << std::endl;
1538 std::cout << std::endl <<
"test: getDateAndTime (failed)" << std::endl;
1539 std::cerr <<
e.what() << std::endl;
◆ testGetFirstLetters()
void testGetFirstLetters |
( |
const std::string & |
str | ) |
|
Definition at line 1960 of file crest_example.cxx.
1961 std::cout << std::endl <<
"test: getFirstLetters" << std::endl;
1964 std::cout <<
"string to test = " <<
str << std::endl;
1968 std::cout << std::endl <<
"test: getFirstLetters (result) = " << str2 << std::endl;
1971 std::cout << std::endl <<
"test: getFirstLetters (failed)" << std::endl;
1972 std::cerr <<
e.what() << std::endl;
◆ testGetHash()
void testGetHash |
( |
const std::string & |
str | ) |
|
Definition at line 1474 of file crest_example.cxx.
1475 std::cout << std::endl <<
"test: getHash" << std::endl;
1478 std::cout << myCrestClient.
getHash(
str) << std::endl;
◆ testGetJson()
Definition at line 565 of file crest_example.cxx.
566 std::cout << std::endl <<
"test: getJson" << std::endl;
570 "{\"tagName\":\"IndetBeampos-nominal\",\"since\":0,\"insertionTime\":\"2019-02-21T13:52:06.222+0000\",\"payloadHash\":\"de9afd9a5bb526d175265d1e66520ac1e7a81816cc3081925625759583e9107f\"}";
571 std::string strb =
"test";
574 std::cout << myCrestClient.
getJson(stra).dump(4) << std::endl;
577 std::cout << std::endl <<
"test: getJson for string stra (failed)" << std::endl;
578 std::cout <<
e.what() << std::endl;
582 std::cout << myCrestClient.
getJson(strb).dump(4) << std::endl;
585 std::cout << std::endl <<
"test: getJson for string strb (failed)" << std::endl;
586 std::cout <<
e.what() << std::endl;
589 std::cout <<
"getJson test ended" << std::endl;
◆ testGetMajorVersion()
void testGetMajorVersion |
( |
| ) |
|
Definition at line 2244 of file crest_example.cxx.
2245 std::cout << std::endl <<
"test: getMajorVersion" << std::endl;
2248 std::string
A =
"4.1";
2249 std::string
B =
"abracadabra";
2250 std::string
C =
".2";
2251 std::string D =
"aaa.2";
2255 std::cout << std::endl <<
"test: major version (" <<
A <<
") = "
2256 << versionA << std::endl;
2259 std::cout << std::endl <<
"test: getMajorVersion (failed)" << std::endl;
2260 std::cout <<
e.what() << std::endl;
2265 std::cout << std::endl <<
"test: major version (" <<
B <<
") = "
2266 << versionB << std::endl;
2269 std::cout << std::endl <<
"test: getMajorVersion (failed)" << std::endl;
2270 std::cout <<
e.what() << std::endl;
2275 std::cout << std::endl <<
"test: major version (" <<
C <<
") = "
2276 << versionC << std::endl;
2279 std::cout << std::endl <<
"test: getMajorVersion (failed)" << std::endl;
2280 std::cout <<
e.what() << std::endl;
2285 std::cout << std::endl <<
"test: major version (" << D <<
") = "
2286 << versionD << std::endl;
2289 std::cout << std::endl <<
"test: getMajorVersion (failed)" << std::endl;
2290 std::cout <<
e.what() << std::endl;
◆ testGetMgmtInfo()
Definition at line 2199 of file crest_example.cxx.
2200 std::cout << std::endl <<
"test: getMgmtInfo" << std::endl;
2205 std::cout << std::endl <<
"test: getMgmtInfo (result) =" << std::endl
2206 << tag_info.dump(4) << std::endl;
2209 std::cout << std::endl <<
"test: getMgmtInfo (failed)" << std::endl;
2210 std::cout <<
e.what() << std::endl;
◆ testGetPayloadAsJson()
void testGetPayloadAsJson |
( |
const std::string & |
hash | ) |
|
Definition at line 1133 of file crest_example.cxx.
1134 std::cout << std::endl <<
"test: getPayloadAsJson" << std::endl;
1139 std::cout << std::endl <<
"test: getPayloadAsJson (result) =" << std::endl;
1140 std::cout << info26.dump(4) << std::endl;
1141 std::cout << std::endl <<
"test: getPayloadAsJson" << std::endl;
1144 std::cout << std::endl <<
"test: getPayloadAsJson (failed)" << std::endl;
1145 std::cerr <<
e.what() << std::endl;
◆ testGetPayloadAsJsonFS()
void testGetPayloadAsJsonFS |
( |
const std::string & |
hash | ) |
|
Definition at line 1560 of file crest_example.cxx.
1561 std::cout << std::endl <<
"test: getPayloadAsJsonFS" << std::endl;
1566 std::cout << std::endl <<
"test: getPayloadAsJsonFS (result) =" << std::endl
1567 <<
info.dump(4) << std::endl;
1570 std::cout << std::endl <<
"test: getPayloadAsJsonFS (failed)" << std::endl;
1571 std::cout <<
e.what() << std::endl;
◆ testGetPayloadAsString()
void testGetPayloadAsString |
( |
const std::string & |
hash | ) |
|
Definition at line 1149 of file crest_example.cxx.
1150 std::cout << std::endl <<
"test: getPayloadAsString" << std::endl;
1155 std::cout << std::endl <<
"test: getPayloadAsString (result) =" << std::endl;
1156 std::cout << info27 << std::endl;
1157 std::cout << std::endl <<
"test: getPayloadAsString" << std::endl;
1160 std::cout << std::endl <<
"test: getPayloadAsString (failed)" << std::endl;
1161 std::cerr <<
e.what() << std::endl;
◆ testGetPayloadAsStringFS()
void testGetPayloadAsStringFS |
( |
const std::string & |
hash | ) |
|
Definition at line 1545 of file crest_example.cxx.
1546 std::cout << std::endl <<
"test: getPayloadAsStringFS" << std::endl;
1551 std::cout << std::endl <<
"test: getPayloadAsStringFS (result) =" << std::endl
1552 <<
info << std::endl;
1555 std::cout << std::endl <<
"test: getPayloadAsStringFS (failed)" << std::endl;
1556 std::cout <<
e.what() << std::endl;
◆ testGetPayloadMetaInfo()
void testGetPayloadMetaInfo |
( |
const std::string & |
hash | ) |
|
Definition at line 1181 of file crest_example.cxx.
1182 std::cout << std::endl <<
"test: getPayloadMetaInfo" << std::endl;
1187 std::cout << std::endl <<
"test: getPayloadMetaInfo (result) =" << std::endl;
1188 std::cout << info14.dump(4) << std::endl;
1189 std::cout << std::endl <<
"test: getPayloadMetaInfo" << std::endl;
1192 std::cout << std::endl <<
"test: getPayloadMetaInfo (failed)" << std::endl;
1193 std::cerr <<
e.what() << std::endl;
◆ testGetPayloadMetaInfoAsJsonFS()
void testGetPayloadMetaInfoAsJsonFS |
( |
const std::string & |
hash | ) |
|
Definition at line 1590 of file crest_example.cxx.
1591 std::cout << std::endl <<
"test: getPayloadMetaInfoAsJsonFS" << std::endl;
1596 std::cout << std::endl <<
"test: getPayloadMetaInfoAsJsonFS (result) =" << std::endl
1597 <<
info.dump(4) << std::endl;
1600 std::cout << std::endl <<
"test: getPayloadMetaInfoAsJsonFS (failed)" << std::endl;
1601 std::cout <<
e.what() << std::endl;
◆ testGetPayloadMetaInfoAsString()
void testGetPayloadMetaInfoAsString |
( |
const std::string & |
hash | ) |
|
Definition at line 1165 of file crest_example.cxx.
1166 std::cout << std::endl <<
"test: getPayloadMetaInfoAsString" << std::endl;
1171 std::cout << std::endl <<
"test: getPayloadMetaInfoAsString (result) =" << std::endl;
1172 std::cout << info15 << std::endl;
1173 std::cout << std::endl <<
"test: getPayloadMetaInfoAsString" << std::endl;
1176 std::cout << std::endl <<
"test: getPayloadMetaInfoAsString (failed)" << std::endl;
1177 std::cerr <<
e.what() << std::endl;
◆ testGetPayloadMetaInfoAsStringFS()
void testGetPayloadMetaInfoAsStringFS |
( |
const std::string & |
hash | ) |
|
Definition at line 1575 of file crest_example.cxx.
1576 std::cout << std::endl <<
"test: getPayloadMetaInfoAsStringFS" << std::endl;
1581 std::cout << std::endl <<
"test: getPayloadMetaInfoAsStringFS (result) =" << std::endl
1582 <<
info << std::endl;
1585 std::cout << std::endl <<
"test: getPayloadMetaInfoAsStringFS (failed)" << std::endl;
1586 std::cout <<
e.what() << std::endl;
◆ testGetSize()
void testGetSize |
( |
const std::string & |
tagname | ) |
|
Definition at line 1875 of file crest_example.cxx.
1876 std::cout << std::endl <<
"test: getSize" << std::endl;
1881 std::cout << std::endl <<
"test: getSize (result) = "
1882 <<
info << std::endl;
1885 std::cout << std::endl <<
"test: getSize (failed)" << std::endl;
1886 std::cout <<
e.what() << std::endl;
◆ testGetSizeFS()
void testGetSizeFS |
( |
const std::string & |
tagname | ) |
|
Definition at line 1890 of file crest_example.cxx.
1891 std::cout << std::endl <<
"test: getSizeFS" << std::endl;
1893 bool rewrite =
true;
1898 std::cout << std::endl <<
"test: getSizeFS (result) = "
1899 <<
info << std::endl;
1902 std::cout << std::endl <<
"test: getSizeFS (failed)" << std::endl;
1903 std::cout <<
e.what() << std::endl;
◆ testGetTagDataInfo()
void testGetTagDataInfo |
( |
const std::string & |
tagname | ) |
|
Definition at line 1947 of file crest_example.cxx.
1948 bool rewrite =
true;
1955 std::cout << std::endl <<
"test: testGetTagDataInfo (failed)" << std::endl;
1956 std::cout <<
e.what() << std::endl;
◆ testGetTagMetaInfo()
void testGetTagMetaInfo |
( |
const std::string & |
tagname | ) |
|
Definition at line 941 of file crest_example.cxx.
942 std::cout << std::endl <<
"test: getTagMetaInfo" << std::endl;
947 std::cout << std::endl <<
"test: getTagMetaInfo (result) =" << std::endl
948 << js.dump(4) << std::endl;
951 std::cout << std::endl <<
"test: getTagMetaInfo (failed)" << std::endl;
952 std::cerr <<
e.what() << std::endl;
◆ testGetTagMetaInfoFs()
void testGetTagMetaInfoFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1250 of file crest_example.cxx.
1251 std::cout << std::endl <<
"test: getTagMetaInfoFs" << std::endl;
1257 std::cout << std::endl <<
"test: getTagMetaInfoFs (result) =" << std::endl
1258 << js.dump(4) << std::endl;
1261 std::cout << std::endl <<
"test: getTagMetaInfoFs (failed)" << std::endl;
1262 std::cerr <<
e.what() << std::endl;
◆ testGetTagMetaInfoIOVDbSvc()
void testGetTagMetaInfoIOVDbSvc |
( |
const std::string & |
tagname | ) |
|
Definition at line 1008 of file crest_example.cxx.
1009 std::cout << std::endl <<
"test: getTagMetaInfoIOVDbSvc" << std::endl;
1014 std::cout << std::endl <<
"test: getTagMetaInfoIOVDbSvc (result) = " << std::endl
1015 << js68.dump(4) << std::endl;
1018 std::cout << std::endl <<
"test: getTagMetaInfoIOVDbSvc (failed)" << std::endl;
1019 std::cerr <<
e.what() << std::endl;
◆ testListGlobalTags()
void testListGlobalTags |
( |
| ) |
|
Definition at line 310 of file crest_example.cxx.
311 std::cout << std::endl <<
"test: listGlobalTags" << std::endl;
316 std::cout << std::endl <<
"test: listGlobalTags (result) = "
317 << tag_info9.dump(4) << std::endl;
320 std::cout << std::endl <<
"test: listGlobalTags (failed)" << std::endl;
321 std::cout <<
e.what() << std::endl;
◆ testListGlobalTagsAsString()
void testListGlobalTagsAsString |
( |
| ) |
|
Definition at line 325 of file crest_example.cxx.
326 std::cout << std::endl <<
"test: listGlobalTagsAsString" << std::endl;
331 std::cout << std::endl <<
"test: listGlobalTagsAsString (result) = "
332 << tag_info9.dump(4) << std::endl;
335 std::cout << std::endl <<
"test: listGlobalTagsAsString (failed)" << std::endl;
336 std::cout <<
e.what() << std::endl;
◆ testListGlobalTagsParams()
void testListGlobalTagsParams |
( |
const std::string & |
name, |
|
|
int |
size, |
|
|
int |
page |
|
) |
| |
Definition at line 340 of file crest_example.cxx.
341 std::cout << std::endl <<
"test: listGlobalTagsParams with additional parameters" << std::endl;
350 std::cout << std::endl <<
"test: listGlobalTagsParams (result A) =" << std::endl;
351 std::cout << list_1.dump(4) << std::endl;
354 std::cout << std::endl <<
"test: listGlobalTagsParams (result B) =" << std::endl;
355 std::cout << list_2.dump(4) << std::endl;
358 std::cout << std::endl <<
"test: listGlobalTagsParams (result C) =" << std::endl;
359 std::cout << list_3.dump(4) << std::endl;
362 std::cout << std::endl <<
"test: listGlobalTagsParams with additional parameters (failed)" << std::endl;
363 std::cerr <<
e.what() << std::endl;
◆ testListPayloadTagInfo() [1/2]
void testListPayloadTagInfo |
( |
| ) |
|
Definition at line 1060 of file crest_example.cxx.
1061 std::cout << std::endl <<
"test: listPayloadTagInfo" << std::endl;
1066 std::cout << std::endl <<
"test: listPayloadTagInfo (result) =" << std::endl
1070 std::cout << std::endl <<
"test: listPayloadTagInfo (failed)" << std::endl;
1071 std::cerr <<
e.what() << std::endl;
◆ testListPayloadTagInfo() [2/2]
void testListPayloadTagInfo |
( |
const std::string & |
tagname | ) |
|
Definition at line 1075 of file crest_example.cxx.
1076 std::cout << std::endl <<
"test: listPayloadTagInfo with tag " <<
tagname << std::endl;
1081 std::cout << std::endl <<
"test: listPayloadTagInfo (result) =" << std::endl
1085 std::cout << std::endl <<
"test: listPayloadTagInfo (failed)" << std::endl;
1086 std::cerr <<
e.what() << std::endl;
◆ testListRunLumiInfo()
void testListRunLumiInfo |
( |
| ) |
|
Definition at line 504 of file crest_example.cxx.
505 std::cout << std::endl <<
"test: listRunLumiInfo" << std::endl;
510 std::cout << std::endl <<
"test: listRunLumiInfo (success) = " << std::endl;
511 std::cout << info16.dump(4) << std::endl;
514 std::cout << std::endl <<
"test: listRunLumiInfo (failed)" << std::endl;
515 std::cout <<
e.what() << std::endl;
◆ testListTags()
Definition at line 140 of file crest_example.cxx.
141 std::cout << std::endl <<
"test: listTag" << std::endl;
146 std::cout << std::endl <<
"test: listTags (result) =" << std::endl
150 std::cout << std::endl <<
"test: listTags (failed)" << std::endl;
151 std::cout <<
e.what() << std::endl;
◆ testListTagsParams() [1/2]
void testListTagsParams |
( |
| ) |
|
Definition at line 155 of file crest_example.cxx.
156 std::cout << std::endl <<
"test: listTagsParams" << std::endl;
166 std::cout << std::endl <<
"test: listTagsParams (result) ="
167 <<
"result = " <<
res.dump(4) << std::endl;
170 std::cout << std::endl <<
"test: listTagsParams (failed)" << std::endl;
171 std::cerr <<
e.what() << std::endl;
◆ testListTagsParams() [2/2]
void testListTagsParams |
( |
const std::string & |
name | ) |
|
Definition at line 175 of file crest_example.cxx.
176 std::cout << std::endl <<
"test: listTagsParams" << std::endl;
184 nlohmann::json res1 = myCrestClient.listTagsParams(_page = 3, _size = 5);
186 std::cout <<
"test: listTagsParams (A) = "
187 << std::endl << res1.dump(4) << std::endl;
189 nlohmann::json res2 = myCrestClient.listTagsParams(_name =
name, _page = 0, _size = 5);
191 std::cout <<
"test: listTagsParams (B) = "
192 << std::endl << res2.dump(4) << std::endl;
195 std::cout << std::endl <<
"test: listTagsParams (failed)" << std::endl;
196 std::cerr <<
e.what() << std::endl;
◆ testRemoveGlobalTag()
void testRemoveGlobalTag |
( |
const std::string & |
tagname | ) |
|
Definition at line 367 of file crest_example.cxx.
368 std::cout << std::endl <<
"test: removeGlobalTag" << std::endl;
373 std::cout << std::endl <<
"test: removeGlobalTag (success)" << std::endl;
375 catch (
const std::runtime_error&
e) {
376 std::cout << std::endl <<
"test: removeGlobalTag (failed)" << std::endl;
◆ testRemoveTag()
void testRemoveTag |
( |
const std::string & |
tagname | ) |
|
Definition at line 215 of file crest_example.cxx.
216 std::cout << std::endl <<
"test: removeTag" << std::endl;
221 std::cout << std::endl <<
"test: removeTag (success)" << std::endl;
224 std::cout << std::endl <<
"test: removeTag (failed)" << std::endl;
225 std::cout <<
e.what() << std::endl;
◆ testRemoveTagFromGlobalTagMap()
void testRemoveTagFromGlobalTagMap |
( |
const std::string & |
global_tag | ) |
|
Definition at line 2347 of file crest_example.cxx.
2348 std::cout << std::endl <<
"test: removeTagFromGlobalTagMap" << std::endl;
2353 std::cout << std::endl <<
"test: GlobalTagMap (initial) = "
2354 << tagMap.dump(4) << std::endl;
2356 int n = tagMap.size();
2357 std::cout <<
n <<
" tags will be deleted:\n";
2360 for (
int i = 0;
i <
n;
i++){
2363 std::string
tag =
"";
2364 std::string
label =
"";
2366 auto subjectIdIter1 = j.find(
"tagName");
2367 if (subjectIdIter1 != j.end()){
2368 std::string
tag = j[
"tagName"];
2369 std::cout <<
"tag name = " <<
tag << std::endl;
2372 auto subjectIdIter2 = j.find(
"label");
2373 if (subjectIdIter2 != j.end()){
2375 std::cout <<
"label = " <<
label << std::endl;
2380 std::cout <<
tag <<
" removed.\n";
2383 std::cout << std::endl <<
"Cannot remove tag " <<
tag << std::endl;
2384 std::cout <<
e.what() << std::endl;
2390 std::cout << std::endl <<
"test: findGlobalTagMap (failed)" << std::endl;
2391 std::cout <<
e.what() << std::endl;
2397 std::cout << std::endl <<
"test: GlobalTagMap (result) = "
2398 << tagMap.dump(4) << std::endl;
2401 std::cout << std::endl <<
"test: tRemoveTagFromGlobalTagMap (failed)" << std::endl;
2402 std::cout <<
e.what() << std::endl;
◆ testReturnJArray()
void testReturnJArray |
( |
| ) |
|
Definition at line 1643 of file crest_example.cxx.
1644 std::cout << std::endl <<
"test: returnJArray" << std::endl;
1653 std::cout << std::endl <<
"test: returnJArray (result) =" << std::endl
1654 <<
res.dump(4) << std::endl;
1657 std::cout << std::endl <<
"test: returnJArray (failed)" << std::endl;
1658 std::cout <<
e.what() << std::endl;
◆ testSelectGroups()
void testSelectGroups |
( |
const std::string & |
tagname | ) |
|
Definition at line 789 of file crest_example.cxx.
790 std::cout << std::endl <<
"test: selectGroups" << std::endl;
795 std::cout << std::endl <<
"test: selectGroups (result) =" << std::endl;
796 std::cout << tag_info.dump(4) << std::endl;
799 std::cout << std::endl <<
"test: selectGroups (failed)" << std::endl;
800 std::cerr <<
e.what() << std::endl;
◆ testSelectGroups2()
void testSelectGroups2 |
( |
const std::string & |
tagname, |
|
|
int |
groupsize |
|
) |
| |
Definition at line 2543 of file crest_example.cxx.
2544 std::cout << std::endl <<
"test: selectGroups2" << std::endl;
2549 std::cout << std::endl <<
"test: selectGroups2 (result) =" << std::endl;
2550 std::cout << tag_info.dump(4) << std::endl;
2553 std::cout << std::endl <<
"test: selectGroups2 (failed)" << std::endl;
2554 std::cerr <<
e.what() << std::endl;
◆ testSelectIovs() [1/2]
void testSelectIovs |
( |
const std::string & |
tagname | ) |
|
Definition at line 759 of file crest_example.cxx.
760 std::cout << std::endl <<
"test: selectIovs" << std::endl;
765 std::cout << std::endl <<
"test: selectIovs (result) =" << std::endl;
766 std::cout << tag_info.dump(4) << std::endl;
769 std::cout << std::endl <<
"test: selectIovs (failed)" << std::endl;
770 std::cerr <<
e.what() << std::endl;
◆ testSelectIovs() [2/2]
void testSelectIovs |
( |
const std::string & |
tagname, |
|
|
long |
since, |
|
|
long |
until, |
|
|
long |
snapshot |
|
) |
| |
Definition at line 774 of file crest_example.cxx.
775 std::cout << std::endl <<
"test: selectIovs, all paprams" << std::endl;
780 std::cout << std::endl <<
"test: selectIovs (result) =" << std::endl;
781 std::cout << tag_info.dump(4) << std::endl;
784 std::cout << std::endl <<
"test: selectIovs (failed)" << std::endl;
785 std::cerr <<
e.what() << std::endl;
◆ testSelectIovsFS()
void testSelectIovsFS |
( |
const std::string & |
tagname, |
|
|
long |
since, |
|
|
long |
until |
|
) |
| |
Definition at line 741 of file crest_example.cxx.
742 std::cout << std::endl <<
"test: selectIovsFS with additional parameters" << std::endl;
748 std::cout << std::endl <<
"test: selectIovs =" << std::endl;
749 std::cout << iov_list.dump(4) << std::endl;
751 std::cout <<
"result size = " << iov_list.size() << std::endl;
754 std::cout << std::endl <<
"test: selectIovsFS with additional parameters (failed)" << std::endl;
755 std::cerr <<
e.what() << std::endl;
◆ testSelectIovsParams()
void testSelectIovsParams |
( |
const std::string & |
tagname, |
|
|
long |
since, |
|
|
long |
until |
|
) |
| |
Definition at line 718 of file crest_example.cxx.
719 std::cout << std::endl <<
"test: selectIovs with additional parameters" << std::endl;
726 std::cout << std::endl <<
"test: selectIovs (result A) =" << std::endl;
727 std::cout << iov_list_1.dump(4) << std::endl;
729 std::cout << std::endl <<
"test: selectIovs (result B) =" << std::endl;
730 std::cout << iov_list_2.dump(4) << std::endl;
732 std::cout <<
"result A size = " << iov_list_1.size() << std::endl;
733 std::cout <<
"result B size = " << iov_list_2.size() << std::endl;
736 std::cout << std::endl <<
"test: selectIovs with additional parameters (failed)" << std::endl;
737 std::cerr <<
e.what() << std::endl;
◆ testStoreBatchIOVs()
void testStoreBatchIOVs |
( |
const std::string & |
tagname1, |
|
|
const std::string & |
tagname2 |
|
) |
| |
Definition at line 2086 of file crest_example.cxx.
2087 std::cout << std::endl <<
"test: storeBatchIOVs" << std::endl;
2092 {
"description",
"none"},
2093 {
"endOfValidity", 0},
2094 {
"insertionTime",
"2018-12-06T11:18:35.641+0000"},
2095 {
"lastValidatedTime", 0},
2096 {
"modificationTime",
"2018-12-06T11:18:35.641+0000"},
2098 {
"payloadSpec",
"stave: Int32, eta: Int32, mag: Float, base: Float, free: Float"},
2099 {
"synchronization",
"none"},
2100 {
"timeType",
"time"}
2103 std::cout <<
"tag 1 = " << std::endl << js.dump(4) << std::endl;
2107 std::cout << std::endl <<
"Tag " << tagname1 <<
" created" << std::endl;
2110 std::cout << std::endl <<
"ERROR: tag " << tagname1 <<
" creation failed" << std::endl;
2111 std::cout <<
e.what() << std::endl;
2115 js[
"name"] = tagname2;
2117 std::cout <<
"tag 2 = " << std::endl << js.dump(4) << std::endl;
2121 std::cout << std::endl <<
"Tag " << tagname2 <<
" created" << std::endl;
2124 std::cout << std::endl <<
"ERROR: tag " << tagname2 <<
" creation failed" << std::endl;
2125 std::cout <<
e.what() << std::endl;
2135 std::string
str =
"[{\"data\":" +
d1 +
",\"since\":100},{\"data\":" +
d2 +
",\"since\":150}]";
2140 std::cout << std::endl <<
"2 IOVs created in tag " << tagname1 << std::endl;
2143 std::cout << std::endl <<
"ERROR: payloads and IOVs were not created." << std::endl;
2144 std::cerr <<
e.what() << std::endl;
2152 std::cout << std::endl <<
"IOV list for tag " << tagname1 <<
" =" << std::endl;
2153 std::cout <<
iovList.dump(4) << std::endl;
2155 int listSize =
iovList.size();
2158 for (
int j = 0; j < listSize; j++) {
2163 newIov[
"tagName"] = tagname2;
2164 newIovList.push_back(newIov);
2173 std::cout <<
"ERROR: Cannot write the IOVs for the tag \"" << tagname2 <<
"\"" << std::endl;
2174 std::cerr <<
e.what() << std::endl;
2180 std::cout << std::endl <<
"ERROR: cannot get IOV list for tag " << tagname1 << std::endl;
2181 std::cerr <<
e.what() << std::endl;
2187 std::cout << std::endl <<
"IOV list for tag " << tagname2 <<
" =" << std::endl;
2188 std::cout <<
iovList.dump(4) << std::endl;
2191 std::cout << std::endl <<
"ERROR: cannot get IOV list for tag " << tagname2 << std::endl;
2192 std::cerr <<
e.what() << std::endl;
◆ testStoreBatchPayloads()
void testStoreBatchPayloads |
( |
const std::string & |
tagname | ) |
|
Definition at line 1670 of file crest_example.cxx.
1671 std::cout << std::endl <<
"test: storeBatchPayloads" << std::endl;
1675 std::string
str =
"[{\"data\":\"aaa\",\"since\":100},{\"data\":\"bbb\",\"since\":150}]";
1680 std::cout << std::endl <<
"test: storeBatchPayloads (success) " << std::endl;
1683 std::cout << std::endl <<
"test: storeBatchPayloads (failed)" << std::endl;
1684 std::cerr <<
e.what() << std::endl;
◆ testStoreBatchPayloadsB()
void testStoreBatchPayloadsB |
( |
const std::string & |
tagname | ) |
|
Definition at line 1690 of file crest_example.cxx.
1691 std::cout << std::endl <<
"test: storeBatchPayloads2" << std::endl;
1698 std::string
str =
"[{\"data\":" +
d1 +
",\"since\":100},{\"data\":" +
d2 +
",\"since\":150}]";
1703 std::cout << std::endl <<
"test: storeBatchPayloads2 (success) " << std::endl;
1706 std::cout << std::endl <<
"test: storeBatchPayloads2 (failed)" << std::endl;
1707 std::cerr <<
e.what() << std::endl;
◆ testStoreBatchPayloadsFiles()
void testStoreBatchPayloadsFiles |
( |
const std::string & |
tagname | ) |
|
Definition at line 2407 of file crest_example.cxx.
2408 std::cout << std::endl <<
"test: storeBatchPayloadsFiles" << std::endl;
2415 std::string file1 =
"/tmp/mvg01.txt";
2416 std::string file2 =
"/tmp/mvg02.txt";
2420 if (out1.is_open()){
2427 if (out2.is_open()){
2432 d1 =
"file://" + file1;
2433 d2 =
"file://" + file2;
2435 std::string
str =
"[{\"data\":\"" +
d1 +
"\",\"since\":100},{\"data\":\"" +
d2 +
"\",\"since\":150}]";
2438 std::cout <<
"json = " << js.dump(4) << std::endl;
2442 std::cout << std::endl <<
"test: storeBatchPayloadsFiles (success) " << std::endl;
2445 std::cout << std::endl <<
"test: storeBatchPayloadsFiles (failed)" << std::endl;
2446 std::cerr <<
e.what() << std::endl;
◆ testStoreBatchPayloadsFs()
void testStoreBatchPayloadsFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1362 of file crest_example.cxx.
1363 std::cout << std::endl <<
"test: storeBatchPayloads" << std::endl;
1365 bool rewrite =
true;
1369 std::string
str =
"[{\"data\":\"aaa\",\"since\":100},{\"data\":\"bbb\",\"since\":150}]";
1374 std::cout << std::endl <<
"test: storeBatchPayloads (success) " << std::endl;
1377 std::cout << std::endl <<
"test: storeBatchPayloads (failed)" << std::endl;
1378 std::cerr <<
e.what() << std::endl;
◆ testStoreData()
void testStoreData |
( |
const std::string & |
tagname | ) |
|
Definition at line 2451 of file crest_example.cxx.
2452 std::cout << std::endl <<
"test: storeData" << std::endl;
2459 std::string
file =
"/tmp/mvg01.txt";
2463 if (out1.is_open()){
2470 std::cout << std::endl <<
"test: storeData (success) " << std::endl;
2473 std::cout << std::endl <<
"test: storeData (failed)" << std::endl;
2474 std::cerr <<
e.what() << std::endl;
◆ testStoreDataArray()
void testStoreDataArray |
( |
const std::string & |
tagname | ) |
|
Definition at line 2478 of file crest_example.cxx.
2479 std::cout << std::endl <<
"test: storeDataArray" << std::endl;
2488 std::string file1 =
"/tmp/mvg01.txt";
2489 std::string file2 =
"/tmp/mvg02.txt";
2491 std::map<uint64_t, std::string>
data;
2495 if (out1.is_open()){
2502 if (out2.is_open()){
2507 data[since1] = file1;
2508 data[since2] = file2;
2512 std::cout << std::endl <<
"test: storeDataArray (success) " << std::endl;
2515 std::cout << std::endl <<
"test: storeDataArray (failed)" << std::endl;
2516 std::cerr <<
e.what() << std::endl;
◆ testStorePayload()
void testStorePayload |
( |
const std::string & |
tagname | ) |
|
Definition at line 597 of file crest_example.cxx.
598 std::cout << std::endl <<
"test: storePayload" << std::endl;
611 std::cout << std::endl <<
"test: storePayload (success)" << std::endl;
614 std::cout << std::endl <<
"test: storePayload (failed)" << std::endl;
615 std::cout <<
e.what() << std::endl;
◆ testStorePayloadDump()
void testStorePayloadDump |
( |
const std::string & |
tagname | ) |
|
Definition at line 621 of file crest_example.cxx.
622 std::cout << std::endl <<
"test: storePayloadDump" << std::endl;
624 std::string
path =
"/tmp/cresttest/crest_dump";
625 std::filesystem::create_directories(
path);
632 "{\"niovs\": 2,\"format\":\"PYLD_JSON\",\"iovsList\":[{\"since\":800,\"payload\":\"vv1\"},{\"since\":900,\"payload\":\"ww1\"}]}";
638 std::cout << std::endl <<
"test: storePayloadDump (success) " << std::endl;
641 std::cout << std::endl <<
"test: storePayloadDump (failed)" << std::endl;
642 std::cout <<
e.what() << std::endl;
◆ testTagAndStoreBatchFs()
void testTagAndStoreBatchFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1771 of file crest_example.cxx.
1772 std::cout << std::endl <<
"test: createTagFs" << std::endl;
1774 bool rewrite =
true;
1779 {
"description",
"none"},
1780 {
"endOfValidity", 0},
1781 {
"insertionTime",
"2018-12-06T11:18:35.641+0000"},
1782 {
"lastValidatedTime", 0},
1783 {
"modificationTime",
"2018-12-06T11:18:35.641+0000"},
1785 {
"payloadSpec",
"stave: Int32, eta: Int32, mag: Float, base: Float, free: Float"},
1786 {
"synchronization",
"none"},
1787 {
"timeType",
"time"}
1792 std::cout << std::endl <<
"test: createTagFs (success)" << std::endl;
1795 std::cout << std::endl <<
"test: createTagFs (failed)" << std::endl;
1796 std::cout <<
e.what() << std::endl;
1800 std::string
str =
"[{\"data\":\"aaa\",\"since\":100},{\"data\":\"bbb\",\"since\":150}]";
1805 std::cout << std::endl <<
"test: storeBatchPayloads (success) " << std::endl;
1808 std::cout << std::endl <<
"test: storeBatchPayloads (failed)" << std::endl;
1809 std::cerr <<
e.what() << std::endl;
◆ testTagAndStoreBatchFsB()
void testTagAndStoreBatchFsB |
( |
const std::string & |
tagname | ) |
|
Definition at line 1813 of file crest_example.cxx.
1814 std::cout << std::endl <<
"test: createTagFs" << std::endl;
1816 bool rewrite =
true;
1821 {
"description",
"none"},
1822 {
"endOfValidity", 0},
1823 {
"insertionTime",
"2018-12-06T11:18:35.641+0000"},
1824 {
"lastValidatedTime", 0},
1825 {
"modificationTime",
"2018-12-06T11:18:35.641+0000"},
1827 {
"payloadSpec",
"stave: Int32, eta: Int32, mag: Float, base: Float, free: Float"},
1828 {
"synchronization",
"none"},
1829 {
"timeType",
"time"}
1834 std::cout << std::endl <<
"test: createTagFs (success)" << std::endl;
1837 std::cout << std::endl <<
"test: createTagFs (failed)" << std::endl;
1838 std::cout <<
e.what() << std::endl;
1845 std::string
str =
"[{\"payloadHash\":" +
d1 +
",\"since\":100},{\"payloadHash\":" +
d2 +
",\"since\":150}]";
1850 std::cout << std::endl <<
"test: storeBatchPayloads A (success) " << std::endl;
1853 std::cout << std::endl <<
"test: storeBatchPayloads A (failed)" << std::endl;
1854 std::cerr <<
e.what() << std::endl;
1860 str =
"[{\"data\":" +
d1 +
",\"since\":200},{\"data\":" +
d2 +
",\"since\":250}]";
1865 std::cout << std::endl <<
"test: storeBatchPayloads B (success) " << std::endl;
1868 std::cout << std::endl <<
"test: storeBatchPayloads B (failed)" << std::endl;
1869 std::cerr <<
e.what() << std::endl;
◆ testTagAndStoreBatchFsNItems()
void testTagAndStoreBatchFsNItems |
( |
const std::string & |
tagname, |
|
|
int |
n |
|
) |
| |
Definition at line 1713 of file crest_example.cxx.
1714 std::cout << std::endl <<
"test: createTagFs" << std::endl;
1716 bool rewrite =
true;
1721 {
"description",
"none"},
1722 {
"endOfValidity", 0},
1723 {
"insertionTime",
"2018-12-06T11:18:35.641+0000"},
1724 {
"lastValidatedTime", 0},
1725 {
"modificationTime",
"2018-12-06T11:18:35.641+0000"},
1727 {
"payloadSpec",
"stave: Int32, eta: Int32, mag: Float, base: Float, free: Float"},
1728 {
"synchronization",
"none"},
1729 {
"timeType",
"time"}
1734 std::cout << std::endl <<
"test: storeBatchPayloads for N items (a tag created)" << std::endl;
1737 std::cout << std::endl <<
"test: storeBatchPayloads for N items (tag creation failed)" << std::endl;
1738 std::cout <<
e.what() << std::endl;
1746 for (
int i = 1;
i <=
n;
i++) {
1756 data.push_back(itemD);
1761 std::cout << std::endl <<
"test: storeBatchPayloads for N items (success) " << std::endl;
1764 std::cout << std::endl <<
"test: storeBatchPayloads for N items (failed)" << std::endl;
1765 std::cerr <<
e.what() << std::endl;
◆ testUpdateGlobalTag()
void testUpdateGlobalTag |
( |
const std::string & |
tagname | ) |
|
Definition at line 380 of file crest_example.cxx.
381 std::cout << std::endl <<
"test: updateGlobalTag" << std::endl;
388 {
"description",
"test"},
390 {
"insertionTime",
"2018-12-18T11:32:58.081+0000"},
391 {
"snapshotTime",
"2018-12-18T11:32:57.952+0000"},
392 {
"scenario",
"test2"},
395 {
"snapshotTimeMilli",
"null"},
396 {
"insertionTimeMilli",
"null"}
401 std::cout << std::endl <<
"test: updateGlobalTag (success) " << std::endl;
404 std::cout << std::endl <<
"test: updateGlobalTag (failed)" << std::endl;
405 std::cout <<
e.what() << std::endl;
◆ testUpdateTag()
void testUpdateTag |
( |
const std::string & |
tagname | ) |
|
Definition at line 229 of file crest_example.cxx.
230 std::cout << std::endl <<
"test: updateTag" << std::endl;
234 {
"description",
"test"}};
238 std::cout << std::endl <<
"test: updateTag (success)" << std::endl;
241 std::cout << std::endl <<
"test: updateTag (failed)" << std::endl;
242 std::cout <<
e.what() << std::endl;
◆ testUpdateTagMetainfo()
void testUpdateTagMetainfo |
( |
const std::string & |
tagname | ) |
|
Definition at line 956 of file crest_example.cxx.
957 std::cout << std::endl <<
"test: updateTagMetainfo" << std::endl;
963 {
"description",
"desc-02"}
968 std::cout << std::endl <<
"test: updateTagMetaInfo (success)" << std::endl;
971 std::cout << std::endl <<
"test: updateTagMetainfo (failed)" << std::endl;
972 std::cerr <<
e.what() << std::endl;
◆ testUpdateTagMetaInfoFs()
void testUpdateTagMetaInfoFs |
( |
const std::string & |
tagname | ) |
|
Definition at line 1266 of file crest_example.cxx.
1267 std::cout << std::endl <<
"test: updateTagMetainfoFs" << std::endl;
1272 std::cout << std::endl <<
"channel = " << std::endl
1273 <<
channel.dump(4) << std::endl;
1279 {
"channel_list", chanList},
1280 {
"node_description",
"description of the node"},
1281 {
"payload_spec",
"payload specification"}
1284 std::cout << std::endl <<
"TagInfo = " << std::endl
1285 << tagInfo.dump(4) << std::endl;
1287 std::cout << std::endl <<
"TagInfo = " << std::endl
1288 << tagInfo.dump() << std::endl;
1293 {
"description",
"none"},
1296 {
"tagInfo", tagInfo.dump()},
1297 {
"insertionTime",
"2020-12-04"}
1304 std::cout << std::endl <<
"test: updateTagMetaInfoFs (success)" << std::endl;
1307 std::cout << std::endl <<
"test: updateTagMetaInfoFs (failed)" << std::endl;
1308 std::cerr <<
e.what() << std::endl;
◆ testUpdateTagSpecification()
void testUpdateTagSpecification |
( |
const std::string & |
tagname | ) |
|
Definition at line 246 of file crest_example.cxx.
247 std::cout << std::endl <<
"test: updateTagSpecification" << std::endl;
250 std::string newObjectType =
"json4";
254 std::cout << std::endl <<
"test: updateTagSpecification (success)" << std::endl;
257 std::cout << std::endl <<
"test: updateTagSpecification (failed)" << std::endl;
258 std::cout <<
e.what() << std::endl;
◆ ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY |
◆ SURL
std::string SURL = "http://crest-01.cern.ch:8090" |
JetConstituentVector::iterator iterator
nlohmann::json getPayloadAsJsonFS(const std::string &hash)
This auxillary method finds a payload resource associated to the hash in the local file storage.
std::string getBlob(const std::string &hash)
This method finds payload data by hash; the payload object contains the real BLOB.
std::string getBlobInStreamFs(const std::string &hash, std::ofstream &out)
This method finds payload data by hash; the payload object contains the real BLOB.
char data[hepevt_bytes_allocation_ATLAS]
nlohmann::json selectIovs(const std::string &tagname)
Select iovs for a given tagname.
void testCreateTag(const std::string &tagname)
nlohmann::json findGlobalTagMapFs(const std::string &name)
The auxillary method to find a global tag by name for the file storage.
nlohmann::json findAllIovs(const std::string &tagname)
This method finds all iovs for a given tag name.
void getTagDataInfo(const std::string &tagname)
This is an auxillary method for checking how many unique IOVs(hashcodes) are in an IOV list.
path
python interpreter configuration --------------------------------------—
std::string getDateAndTime()
The auxillary method to get a current data and time.
void createTagMetaInfoIOVDbSvc(const std::string &tagname, nlohmann::json &js)
This method creates a tag meta info in the CREST database.
nlohmann::json getPayloadMetaInfoAsJsonFS(const std::string &hash)
This auxillary method finds a payload resource associated to the hash in the local file storage.
nlohmann::json getJson(const std::string &str)
Auxillary method to convert string in to JSON object.
void createTag(nlohmann::json &js)
This method creates a tag in the CREST database.
std::string getBlobInStream(const std::string &hash, std::ofstream &out)
This method finds payload data by hash; the payload object contains the real BLOB.
nlohmann::json getTagMetaInfo(const std::string &tagname)
This method gets a tag meta info from the CREST database.
nlohmann::json findGlobalTagMap(const std::string &name)
This method search for mappings using the global tag name.
void createGlobalTag(nlohmann::json &js)
Create a global tag in the database.
void hash256_hex_string(InIter first, InIter last, std::string &hex_str)
nlohmann::json selectIovsFS(const std::string &tagname, long since, long until)
This method selects all iovs for a given tag name and for the selected time interval (since-until).
void storeData(const std::string &tag, uint64_t endtime, uint64_t since, const std::string &file)
This method stores a payload from a file in the database, associated to a given IOV since and tag nam...
int getSize(const std::string &tagname)
This metghod gets the number of iovs for the given tag.
nlohmann::json findGlobalTag(const std::string &name)
Finds a global tag by name.
std::string getHash(std::string_view str)
The auxillary method to calculate a hash code for a given string.
nlohmann::json listGlobalTags()
This method finds a global tag lists.
void updateGlobalTag(const std::string &name, nlohmann::json body)
This method allows to update a GlobalTag.Arguments: the name has to uniquely identify a global tag.
void testFindTag(const std::string &tagname)
void checkCrestVersion2()
This method is a CREST version test.
nlohmann::json getPayloadMetaInfo(const std::string &hash)
This method finds a payload resource associated to the hash.
void storeDataArray(const std::string &tag, uint64_t endtime, std::map< uint64_t, std::string > m)
This method stores several payloads from files in batch mode.
void updateTagMetaInfoFs(const std::string &tagname, nlohmann::json &js)
This auxillary method updates a tag meta info in local file storage.
std::string getPayloadAsStringFS(const std::string &hash)
This auxillary method finds a payload resource associated to the hash in the local file storage.
void removeTagFromGlobalTagMap(const std::string &global_tag, const std::string &tag, const std::string &label)
This method removes a tag with the name tag and the label from the global tag map with name global_ta...
std::string getBlobFs(const std::string &hash)
This method finds payload data by hash in the file storage; the payload object contains the real BLOB...
nlohmann::json convertTagMetaInfo2CREST(nlohmann::json &js)
Auxillary method to convert a Tag Meta Info from the JSON IOVDbSvc format in CREST Server format.
void storeBatchPayloadsFiles(const std::string &tag_name, uint64_t endtime, nlohmann::json &js)
This method stores several payloads from files in batch mode.
nlohmann::json listTags(void)
This method returns the tag list.
void updateTag(const std::string &tagname, nlohmann::json body)
This method allows to update tag record in the CREST DB.
void storeBatchPayloads(const std::string &tag_name, uint64_t endtime, const std::string &iovsetupload)
This method stores several payloads in batch mode.
std::string getPayloadAsString(const std::string &hash)
This method finds a payload resource associated to the hash.
std::string getCrestVersion()
This method returns the full CREST Server version.
void createGlobalTagMapFs(nlohmann::json &js)
The auxillary method to create a global tag map in file storage.
nlohmann::json returnJArray(nlohmann::json js)
This auxillary method creates a JSON array from a JSON object.
std::pair< std::vector< unsigned int >, bool > res
int getSizeFS(const std::string &tagname)
This metghod gets the number of iovs for the given tag.
nlohmann::json findTag(const std::string &name)
This method finds a tag by the name.
void createGlobalTagMap(nlohmann::json >)
Method to create a global tag map.
std::string getPayloadMetaInfoAsStringFS(const std::string &hash)
This auxillary method finds a payload resource associated to the hash in the local file storage.
std::string getCrestVersion2()
This method returns the full CREST Server version.
void storePayloadDump(const std::string &tag, uint64_t since, const std::string &js)
Method to store a payload in the local file system.
nlohmann::json listPayloadTagInfo()
This method retrieves monitoring information on all payloads as a list of payload tag information.
std::string getFirstLetters(const std::string &str)
This is an auxillary method extract first letters from the string (hash).
std::string getClientVersion()
This method returns the full CrestApi version.
void updateTagMetaInfo(nlohmann::json &js)
This method updates a tag meta info in the CREST database.
void storePayload(const std::string &tag, uint64_t since, const std::string &js)
Create a payload in the database, associated to a given iov since and tag name.
std::string to_string(const DetectorType &type)
void updateTagSpecification(const std::string &tagname, const std::string &objectType)
This method cahnges object type specification.
void checkCrestVersion()
This method is a CREST version test.
nlohmann::json getMgmtInfo()
This is an auxillary method to read the CREST Server properties.
std::string findGlobalTagAsString(const std::string &name)
Finds a global tag by name.
void storeBatchIOVs(nlohmann::json &js)
This method stores an IOV set on the CREST server.
void testRemoveTag(const std::string &tagname)
void createIov(nlohmann::json &iov)
This method creates an iov for a given tag in the CREST DB for the created payload.
nlohmann::json selectGroups(const std::string &tagname)
Select groups for a given tagname.
def time(flags, cells_name, *args, **kw)
void createTagMetaInfo(nlohmann::json &js)
This method creates a tag meta info in the CREST database.
int getMajorVersion(std::string &str)
This is an auxillary method to extract a major version number from full version string.
void removeTag(const std::string &tagName)
This method allows to remove a Tag.
nlohmann::json listRunLumiInfo()
This method gets full list of run/lumi information data.
nlohmann::json getPayloadAsJson(const std::string &hash)
This method finds a payload resource associated to the hash.
nlohmann::json getTagMetaInfoIOVDbSvc(const std::string &tagname)
This method gets a tag meta info from the CREST database in IOVDbSvc format.
std::string getPayloadMetaInfoAsString(const std::string &hash)
This method finds a payload resource associated to the hash.
void createRunLumiInfo(nlohmann::json &body)
This method creates an entry for run information.
nlohmann::json findGlobalTagFs(const std::string &name)
The auxillary method to find a global tag by name stored in file storage.
void createGlobalTagFs(nlohmann::json &js)
The auxillary method to create a global tag in file storage.
void removeGlobalTag(const std::string &name)
This method allows to remove a Global Tag form CREST DB.
nlohmann::json findAllIovsFs(const std::string &tagname)
This method finds all iovs by the tag name in the file storage.
std::string listGlobalTagsAsString()
This method finds a global tag lists.
std::string description
glabal timer - how long have I taken so far?