ATLAS Offline Software
Loading...
Searching...
No Matches
SupportSharedWriter

Adds a proxy for a metadata object to the input metadata store. More...

virtual StatusCode MetaDataSvc::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.
virtual StatusCode MetaDataSvc::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.

Detailed Description

Adds a proxy for a metadata object to the input metadata store.

The file, class, container, key, and stream number of the metadata object are parsed from the provided string token. An opaque address for the object is generated from the parsed information and recorded in the input metadata store under the key name. If the key contains 'Aux.' it is linked to a IConstAuxStore.

Note that the MetaDataTool corresponding to the object is looked up via classID and created if not found in m_metaDataTools. Some special handling for the EventFormat, EventStreamInfo, and FileMetaData tools should ensure proper propagation —this part seems fragile.

This function may be called directly or when a BeginInputFile incident is fired.

Parameters
tokenStris the string representation of a Token of a metadata object
Returns
SUCCESS unless the proxy could not be generated or added or the tool could not be found or set up

Function Documentation

◆ prepareOutput()

StatusCode MetaDataSvc::prepareOutput ( const std::string & outputName)
virtual

Makes the metadata store ready for output with SharedWriter Calls the metaDataStop method of all MetaDataTool interfaces in m_metaDataTool.

Then release the metadata tools.

Parameters
outputNameis the name of the output file being written
Returns
SUCCESS unless a MetaDataTool fails, then FAILURE

Definition at line 283 of file MetaDataSvc.cxx.

284{
285 // default to the serial implementation if no output name given
286 if( outputName.empty() ) {
287 return prepareOutput();
288 }
289 ATH_MSG_DEBUG( "prepareOutput('" << outputName << "')" );
290
291 StatusCode rc{StatusCode::SUCCESS};
292 for (auto& tool : m_metaDataTools) {
293 ATH_MSG_DEBUG(" calling metaDataStop for " << tool->name());
294 // planning to replace the call below with (*it)->prepareOutput(outputName)
295 if (tool->metaDataStop().isFailure()) {
296 ATH_MSG_ERROR("Unable to call metaDataStop for " << tool->name());
297 rc = StatusCode::FAILURE;
298 }
299 }
300 // MN: not releasing tools here - revisit when clear what happens on new file open
301 return rc;
302}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static Double_t rc
virtual StatusCode prepareOutput()
Makes the metadata store ready for output.
PublicToolHandleArray< IMetaDataTool > m_metaDataTools
MetaDataTools, vector with the MetaData tools.
::StatusCode StatusCode
StatusCode definition for legacy code.
str outputName
Definition lumiFormat.py:65

◆ shmProxy()

StatusCode MetaDataSvc::shmProxy ( const std::string & filename)
overridevirtual

Loads file metadata from memory shared between streams in SharedWriter This function clears the input and output metadata stores.

Then calls addProxyToInputMetaDataStore using filename as argument.

See also
addProxyToInputMetaDataStore()
Parameters
filenamestream token with "[NUM=n]" appended, n is the stream number
Returns
FAILURE if any step isn't successful, else SUCCESS

Definition at line 305 of file MetaDataSvc.cxx.

306{
308 ATH_CHECK(m_inputDataStore->clearStore(true));
310 }
312 ATH_CHECK(m_outputDataStore->clearStore(true));
314 }
316 return StatusCode::SUCCESS;
317}
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< StoreGateSvc > m_outputDataStore
ServiceHandle< StoreGateSvc > m_inputDataStore
StatusCode addProxyToInputMetaDataStore(const std::string &tokenStr)
bool m_clearedOutputDataStore
bool m_clearedInputDataStore