ATLAS Offline Software
|
Manages the content of the metadata stores. More...
#include <MetaDataSvc.h>
Classes | |
class | ToolLockGuard |
Public Member Functions | |
MetaDataSvc (const std::string &name, ISvcLocator *pSvcLocator) | |
Standard Service Constructor. More... | |
virtual | ~MetaDataSvc () |
Destructor. More... | |
virtual StatusCode | prepareOutput () |
Makes the metadata store ready for output. More... | |
virtual void | handle (const Incident &incident) override |
react to file incidents. More... | |
StatusCode | transitionMetaDataFile (const std::string &outputConn, bool disconnect) |
Transition output metadata file - fire MeteDataStop incident to transition OutputStream and disconnect now if requested. More... | |
virtual StatusCode | io_reinit () override |
Implements IIoComponent interface sets m_outputPrepared to false and prints some information. More... | |
StatusCode | rootOpenAction (FILEMGR_CALLBACK_ARGS) |
virtual StoreGateSvc * | outputDataStore () const override final |
virtual const std::string | currentRangeID () const override final |
CLID | remapMetaContCLID (const CLID &item_id) const |
void | lockTools () const |
void | unlockTools () const |
void | recordHook (const std::type_info &) override |
void | removeHook (const std::type_info &) override |
std::string | removeStreamFromKey (std::string &key) |
check if the metadata object key contains Stream name (added by SharedWriter in MetaDataSvc) remove stream part from the key (i.e. More... | |
virtual std::set< std::string > | getPerStreamKeysFor (const std::string &key) const override final |
Get all per-stream Key variants created for in-file metadata object with original key If no stream-specific keys are found, it returns the original key. More... | |
virtual StatusCode | initialize () override |
initialize the metadata service at the beginning of the job More... | |
virtual StatusCode | stop () override |
stop the metadata service More... | |
virtual StatusCode | finalize () override |
finalize the metadata service at the end of the job More... | |
virtual StatusCode | newMetadataSource (const Incident &) |
Fills the input metadata store with the content of the new input file. More... | |
virtual StatusCode | retireMetadataSource (const Incident &) |
Allows metadata tools to act before an input file is closed. More... | |
virtual StatusCode | prepareOutput (const std::string &outputName) |
Makes the metadata store ready for output with SharedWriter Calls the metaDataStop method of all MetaDataTool interfaces in m_metaDataTool. More... | |
virtual StatusCode | shmProxy (const std::string &filename) override |
Loads file metadata from memory shared between streams in SharedWriter This function clears the input and output metadata stores. More... | |
StatusCode | preLoadAddresses (StoreID::type, IAddressProvider::tadList &) override |
does nothing. More... | |
StatusCode | loadAddresses (StoreID::type storeID, IAddressProvider::tadList &tads) override |
loads addresses of versioned metadata object. More... | |
StatusCode | updateAddress (StoreID::type, SG::TransientAddress *, const EventContext &) override |
always fails More... | |
Private Member Functions | |
StatusCode | addProxyToInputMetaDataStore (const std::string &tokenStr) |
StatusCode | initInputMetaDataStore (const std::string &fileName) |
Initialize input metadata store - can be called directly or via BeginInputFile incident. More... | |
Private Attributes | |
ServiceHandle< StoreGateSvc > | m_inputDataStore |
ServiceHandle< StoreGateSvc > | m_outputDataStore |
ServiceHandle< IAddressCreator > | m_addrCrtr |
ServiceHandle< IFileMgr > | m_fileMgr |
ServiceHandle< IIncidentSvc > | m_incSvc |
ServiceHandle< OutputStreamSequencerSvc > | m_outSeqSvc |
ServiceHandle< IClassIDSvc > | m_classIDSvc {"ClassIDSvc", name()} |
long | m_storageType |
bool | m_clearedInputDataStore |
bool | m_clearedOutputDataStore |
bool | m_allowMetaDataStop |
bool | m_outputPrepared |
std::map< std::string, CLID > | m_persToClid |
std::set< CLID > | m_handledClasses |
const std::string | m_streamInKeyMark = "__STREAM[" |
marker string for embedding stream name in MetaData object keys for SharedWriter server More... | |
std::map< std::string, std::set< std::string > > | m_streamKeys |
StringProperty | m_metaDataCont |
MetaDataContainer, POOL container name for MetaData. More... | |
ToolHandleArray< IMetaDataTool > | m_metaDataTools |
MetaDataTools, vector with the MetaData tools. More... | |
Manages the content of the metadata stores.
This service orchestrates the reading of metadata from input files and its propagation to the output with the help of the IMetaDataTool interfaces in m_metaDataTools
. The MetaDataSvc reacts to BeginInputFile and EndInputFile incidents. It relies on the AthenaPoolCnvSvc (or whatever persistency service) to call the the appropriate prepareOutput method when committing the MetaDataStore content to the output file.
On BeginInputFile it clears the InputMetaDataStore and populates it with content from the new input file. The beginInputFile
methods of all tools are called to allow required actions on the metadata objects.
On EndInputFile the MetaDataSvc calls the endInputFile
methods of all the interfaces in m_metaDataTools
.
In jobs with multiple parallel output streams (SharedWriter) the metadata content from multiple streams is put into the output MetaDataStore. To do this the The MetaDataSvc accesses the memory shared with the output streams, and adds the content of their MetaDataStore to the shared InputMetaDataStore. This is done by the client calling shmProxy
for each object to be added to the MetaDataStore. Afterwards the client must also fire BeginInputFile and EndInputFile incidents to allow the MetaDataTools to move their objects from the InputMetaDataStore to the MetaDataStore taking care of possible merges.
Example configuration:
Definition at line 84 of file MetaDataSvc.h.
MetaDataSvc::MetaDataSvc | ( | const std::string & | name, |
ISvcLocator * | pSvcLocator | ||
) |
Standard Service Constructor.
Definition at line 52 of file MetaDataSvc.cxx.
|
virtual |
|
private |
Definition at line 432 of file MetaDataSvc.cxx.
|
finaloverridevirtual |
Definition at line 586 of file MetaDataSvc.cxx.
|
overridevirtual |
|
finaloverridevirtual |
Get all per-stream Key variants created for in-file metadata object with original key If no stream-specific keys are found, it returns the original key.
Definition at line 424 of file MetaDataSvc.cxx.
|
overridevirtual |
react to file incidents.
calls newMetadataSource
on BeginInputFile and retireMetadataSource
on EndInputFile. Does
incident | is expected to be BeginInputFile or EndInputFile |
Definition at line 336 of file MetaDataSvc.cxx.
|
overridevirtual |
initialize the metadata service at the beginning of the job
Definition at line 99 of file MetaDataSvc.cxx.
|
private |
Initialize input metadata store - can be called directly or via BeginInputFile incident.
Definition at line 519 of file MetaDataSvc.cxx.
|
overridevirtual |
Implements IIoComponent interface sets m_outputPrepared to false and prints some information.
Definition at line 395 of file MetaDataSvc.cxx.
|
override |
loads addresses of versioned metadata object.
loops over all versions of the DataHeader
and adds addresses of objects from DataHeaderElements
to the tads
with a version corresponding to version number of the DataHeader that contained them.
storeID | [IN] the identity of the store |
tads | [OUT] list of addresses to objects from versions keys |
Definition at line 185 of file MetaDataSvc.cxx.
void MetaDataSvc::lockTools | ( | ) | const |
Definition at line 639 of file MetaDataSvc.cxx.
|
virtual |
Fills the input metadata store with the content of the new input file.
Once the GUID and name of the input file are determined from the incident this function blocks stopping the MetaDataSvc by setting m_allowMetaDataStop
to false. Then attempts first to clear the input metadata store and prepare it for the metadata tools by calling initInputMetaDataStore
. The loops over all MetaDataTool interfaces in m_metaDataTools
and calls their beginInputFile implementations.
inc | The BeginInputFile incident fired on opening a new file |
inc
is not a file incident, the input metadata store cannot be set up, or a MetaDataTool fails. Otherwise SUCCESS. Definition at line 217 of file MetaDataSvc.cxx.
|
inlinefinaloverridevirtual |
Definition at line 235 of file MetaDataSvc.h.
|
inlineoverride |
does nothing.
storeID | [IN] store ID, this function only preloads detector store addresses. |
tads | [OUT] list of the transient addresses which were preloaded. |
Definition at line 184 of file MetaDataSvc.h.
|
virtual |
Makes the metadata store ready for output.
Calls the metaDataStop method of all MetaDataTool interfaces in m_metaDataTool. Then release the metadata tools. This implementation assumes SharedWriter is not being used.
Definition at line 271 of file MetaDataSvc.cxx.
|
override |
Definition at line 613 of file MetaDataSvc.cxx.
Definition at line 592 of file MetaDataSvc.cxx.
|
override |
Definition at line 626 of file MetaDataSvc.cxx.
std::string MetaDataSvc::removeStreamFromKey | ( | std::string & | key | ) |
check if the metadata object key contains Stream name (added by SharedWriter in MetaDataSvc) remove stream part from the key (i.e.
modify the parameter) and return it
Definition at line 413 of file MetaDataSvc.cxx.
|
virtual |
Allows metadata tools to act before an input file is closed.
Grabs the file GUID then calls the the endInputFile method of all metadata tools in m_metaDataTools
providing the GUID as argument.
inc | is a file incident fired before closing an input file |
Definition at line 251 of file MetaDataSvc.cxx.
StatusCode MetaDataSvc::rootOpenAction | ( | FILEMGR_CALLBACK_ARGS | ) |
Definition at line 407 of file MetaDataSvc.cxx.
|
overridevirtual |
StatusCode MetaDataSvc::transitionMetaDataFile | ( | const std::string & | outputConn, |
bool | disconnect | ||
) |
Transition output metadata file - fire MeteDataStop incident to transition OutputStream and disconnect now if requested.
Definition at line 368 of file MetaDataSvc.cxx.
void MetaDataSvc::unlockTools | ( | ) | const |
Definition at line 649 of file MetaDataSvc.cxx.
|
inlineoverride |
always fails
storeID | [IN] the identity of the store |
tad | [IN] transient address to be updated |
ctx | [IN] current event's context information |
Definition at line 208 of file MetaDataSvc.h.
|
private |
Definition at line 300 of file MetaDataSvc.h.
|
private |
Definition at line 309 of file MetaDataSvc.h.
|
private |
Definition at line 304 of file MetaDataSvc.h.
|
private |
Definition at line 307 of file MetaDataSvc.h.
|
private |
Definition at line 308 of file MetaDataSvc.h.
|
private |
Definition at line 301 of file MetaDataSvc.h.
|
private |
Definition at line 313 of file MetaDataSvc.h.
|
private |
Definition at line 302 of file MetaDataSvc.h.
|
private |
Definition at line 298 of file MetaDataSvc.h.
|
private |
MetaDataContainer, POOL container name for MetaData.
Definition at line 321 of file MetaDataSvc.h.
|
private |
MetaDataTools, vector with the MetaData tools.
Definition at line 323 of file MetaDataSvc.h.
|
private |
Definition at line 299 of file MetaDataSvc.h.
|
private |
Definition at line 310 of file MetaDataSvc.h.
|
private |
Definition at line 303 of file MetaDataSvc.h.
|
private |
Definition at line 311 of file MetaDataSvc.h.
|
private |
Definition at line 306 of file MetaDataSvc.h.
|
private |
marker string for embedding stream name in MetaData object keys for SharedWriter server
Definition at line 315 of file MetaDataSvc.h.
|
private |
Definition at line 317 of file MetaDataSvc.h.