|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #ifndef CRESTAPI_CRESFSAPI_H
15 #define CRESTAPI_CRESFSAPI_H
22 #include "nlohmann/json.hpp"
23 #include <curl/curl.h>
36 std::map<std::string, nlohmann::json>
m_data{};
96 CrestFsClient(
bool rewriteIfExists,
const std::string &root_folder);
374 const std::string &payloadFormat=
"JSON",
376 const std::string &compressionType=
"none",
377 const std::string &
version=
"1.0",
433 bool isMatch(
const std::string& word,
long unsigned int n,
const std::string&
pattern,
long unsigned int m);
434 bool isMatch(
const std::string& word,
const std::string&
pattern);
476 const std::string &js,
477 const std::string &payloadFormat,
479 const std::string &compressionType,
481 const std::string &streamerInfo);
486 #endif // CRESTAPI_CRESTCLIENT_H
static const std::string s_FS_GLOBALTAG_PATH
static const std::string s_FS_TAG_PATH
char data[hepevt_bytes_allocation_ATLAS]
~CrestFsClient()
CrestClient destructor.
void updateTagMeta(TagMetaDto &tag) override
This method updates a tag meta info on the file storage.
path
python interpreter configuration --------------------------------------—
Header file for CREST C++ Client Library.
static const std::string s_FS_DATA_PATH
void createTagMeta(TagMetaDto &tag) override
This method creates a tag meta info on the file storage.
GlobalTagSetDto listGlobalTags(const std::string &name, int size, int page, const std::string &sort) override
This method finds the global tags on the file storage.
std::string m_data_folder
TagSetDto listTags(const std::string &name, int size, int page, const std::string &sort) override
This method returns the tag list as TagSetDto.
std::string getFirstLetters(const std::string &str)
This is an auxillary method extract first letters from the string (hash).
nlohmann::json sortIOVJson(nlohmann::json js, bool order)
void getFileList(const std::string &path)
Auxiliary method to get a file list in the given directory.
int getSize(const std::string &tagname) override
This method gets the number of IOVs for the given tag.
static const std::string s_FS_IOV_FILE
IovSetDto selectIovs(const std::string &name, uint64_t since, uint64_t until, long snapshot, int size, int page, const std::string &sort) override
This method selects IOVs for a given tagname from the file storage.
TagMetaDto findTagMeta(const std::string &name) override
This method gets a tag meta info by the tag name from the file storage.
void flush()
Auxiliary method flush the data to the file system.
GlobalTagMapSetDto findGlobalTagMap(const std::string &name, const std::string &xCrestMapMode) override
This method searches for tag mappings using the global tag name or tag name on the file storage.
void createTag(TagDto &tag) override
This method creates a tag on the file storage.
static const std::string s_FS_PATH
static const std::string s_FS_META_FILE
static const std::string s_FS_MAP_FILE
bool isMatch(const std::string &word, long unsigned int n, const std::string &pattern, long unsigned int m)
std::vector< std::string > nameList(std::string &folder, bool ascending=true)
std::string getFileString(const std::string &path)
Auxiliary method to get a file as a string.
std::string m_root_folder
static const std::string s_FS_TAG_FILE
std::string getDateAndTime()
The TagDto class It contains all fields of the TagDto class from the CREST API.
CrestFsClient(bool rewriteIfExists, const std::string &root_folder)
CrestFsClient constructor.
static const std::string s_FS_PALOAD_FILE
static const int s_FS_PREFIX_LENGTH
void createGlobalTagMap(GlobalTagMapDto &globalTagMap) override
This method creates a global tag map on the file storage.
void checkFsException(const char *method_name)
Auxiliary method to check if the CrestApi library initialized to work with the file system.
nlohmann::json sortJson(nlohmann::json js, const std::string &par, bool order)
std::string getCrestVersion() override
This method returns the full CREST Server version.
GlobalTagDto findGlobalTag(const std::string &name) override
This method finds a global tag by name on the file storage.
TagDto findTag(const std::string &name) override
This method finds a tag by the name on the file storage.
void createGlobalTag(GlobalTagDto &globalTag) override
This method creates a global tag on the file storage.
static const std::string s_FS_TAGMETAINFO_FILE
std::vector< std::string > getVectorPage(const std::vector< std::string > &data, int size, int page)
void removeGlobalTagMap(const std::string &name, const std::string &record, const std::string &label, const std::string &tagname) override
This method removes a global tag map from the file storage.
static const std::string s_FS_GLOBALTAG_FILE
IovSetDto selectGroups(const std::string &name, long snapshot, int size, int page, const std::string &sort) override
This method returns IOV groups for a given tagname.
nlohmann::json getPage(nlohmann::json data, int size, int page)
std::map< std::string, nlohmann::json > m_data
void removeGlobalTag(const std::string &name) override
This method removes a global tag.
std::string buildPath(const std::string &path, const std::string &file)
void storePayloadDump(const std::string &tag, uint64_t since, const std::string &js, const std::string &payloadFormat, const std::string &objectType, const std::string &compressionType, const std::string &version, const std::string &streamerInfo)
This auxiliary method stores a single payload (with since time) on the file system.
PayloadDto getPayloadMeta(const std::string &hash) override
This method finds a payload meta info for the hash on the file storage.
std::string getPayload(const std::string &hash) override
This method finds a payload resource associated to the hash on the file storage.
void storeData(const std::string &tag, const StoreSetDto &storeSetJson, const std::string &payloadFormat="JSON", const std::string &objectType="none", const std::string &compressionType="none", const std::string &version="1.0", uint64_t endTime=-1) override
This method stores several payloads in batch mode on the file storage.
void removeTag(const std::string &name) override
This method removes a tag from the file storage.
nlohmann::json findAllIovs(const std::string &tagname)
This auxiliary method finds all iovs for a given tag name.