Belle II Software development
|
Fallback provider if no providers are given: Will raise an error if used but allows processing if no payloads are requested or all are taken locally from testing payload storage. More...
#include <MetadataProvider.h>
Public Types | |
using | PayloadMap = std::unordered_map< std::string, PayloadMetadata > |
Type for the internal list of payloads. | |
Public Member Functions | |
bool | setTags (const std::vector< std::string > &tags) |
Set the list of globaltag names to be considered for payloads. | |
bool | getPayloads (int exp, int run, std::vector< PayloadMetadata > &info) |
Update the information in the vector of metadata instances with the actual values. | |
std::set< std::string > | getUsableTagStates () |
Get the valid tag states when checking globaltag status. | |
void | setUsableTagStates (const std::set< std::string > &states) |
Set the valid tag states for this provider when checking globaltag status. | |
Protected Member Functions | |
void | addPayload (PayloadMetadata &&payload, const std::string &messagePrefix="") |
Add a payload information to the internal list. | |
void | printInfoMessage (const std::string &provider) |
Print an INFO message about the used metadata provider. | |
Protected Attributes | |
std::vector< std::string > | m_tags |
List of globaltags to consider. | |
std::unordered_map< std::string, PayloadMetadataCache > | m_cache |
Map of globaltag->known metadata. | |
PayloadMap * | m_payloads {nullptr} |
Map of known payloads for current conditions. | |
std::set< std::string > | m_usableTagStates {"TESTING", "VALIDATED", "RUNNING", "PUBLISHED"} |
Set of global tag states to consider valid (except for 'INVALID' which is always considered invalid) | |
Private Member Functions | |
bool | updatePayloads (const std::string &globaltag, int exp, int run) override |
Nope, no update. | |
std::string | getGlobaltagStatus (const std::string &name) override |
When we get asked to check a global tag we raise an error ... but only once. | |
Private Attributes | |
bool | m_errorShown {false} |
Have we already shown the error? | |
Fallback provider if no providers are given: Will raise an error if used but allows processing if no payloads are requested or all are taken locally from testing payload storage.
Definition at line 182 of file MetadataProvider.h.
|
inherited |
Type for the internal list of payloads.
Definition at line 30 of file MetadataProvider.h.
|
protectedinherited |
Add a payload information to the internal list.
This should be called by implementations during updatePayloads() for each payload found.
payload | payload information filled from the globaltag |
messagePrefix | a message prefix to be shown for possible log messages to indicate the correct metadata provider |
Definition at line 91 of file MetadataProvider.cc.
|
overrideprivatevirtual |
When we get asked to check a global tag we raise an error ... but only once.
Implements MetadataProvider.
Definition at line 120 of file MetadataProvider.cc.
|
inherited |
Update the information in the vector of metadata instances with the actual values.
The input is a list of metadata instances and the metadata provider will try to modify them in place and add all the missing information it can find.
This function will call updatePayloads() if necessary to update the list of known payloads for a given run but it will try to cache these results so incrementally asking for new payloads as they get requested is perfectly fine.
updatePayloads() will only called for globaltags if we still need to find payload information. If all payloads are found no further queries will be made so adding additional globaltags that are not used at the end is not expensive.
exp | the experiment number | |
run | the run number | |
[in,out] | info | a list of metadata instances which we try to find the missing metadata for. |
Definition at line 36 of file MetadataProvider.cc.
|
inlineinherited |
Get the valid tag states when checking globaltag status.
Definition at line 122 of file MetadataProvider.h.
|
protectedinherited |
Print an INFO message about the used metadata provider.
provider | the actual metadata provider used for the job |
Definition at line 114 of file MetadataProvider.cc.
|
inherited |
Set the list of globaltag names to be considered for payloads.
This should be called before requesting any payloads but after calling setValidTagStates().
Definition at line 15 of file MetadataProvider.cc.
|
inlineinherited |
Set the valid tag states for this provider when checking globaltag status.
Should be called before setTags() if necessary.
Definition at line 128 of file MetadataProvider.h.
|
inlineoverrideprivatevirtual |
Nope, no update.
Implements MetadataProvider.
Definition at line 184 of file MetadataProvider.h.
|
protectedinherited |
Map of globaltag->known metadata.
Definition at line 172 of file MetadataProvider.h.
|
private |
Have we already shown the error?
Definition at line 192 of file MetadataProvider.h.
|
protectedinherited |
Map of known payloads for current conditions.
Definition at line 174 of file MetadataProvider.h.
|
protectedinherited |
List of globaltags to consider.
Definition at line 170 of file MetadataProvider.h.
|
protectedinherited |
Set of global tag states to consider valid (except for 'INVALID' which is always considered invalid)
Definition at line 176 of file MetadataProvider.h.