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 287 of file MetaDataSvc.cxx.

288{
289 // default to the serial implementation if no output name given
290 if( outputName.empty() ) {
291 return prepareOutput();
292 }
293 ATH_MSG_DEBUG( "prepareOutput('" << outputName << "')" );
294
295 StatusCode rc{StatusCode::SUCCESS};
296 for (auto& tool : m_metaDataTools) {
297 ATH_MSG_DEBUG(" calling metaDataStop for " << tool->name());
298 // planning to replace the call below with (*it)->prepareOutput(outputName)
299 if (tool->metaDataStop().isFailure()) {
300 ATH_MSG_ERROR("Unable to call metaDataStop for " << tool->name());
301 rc = StatusCode::FAILURE;
302 }
303 }
304 // MN: not releasing tools here - revisit when clear what happens on new file open
305 return rc;
306}
#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 309 of file MetaDataSvc.cxx.

310{
312 ATH_CHECK(m_inputDataStore->clearStore(true));
314 }
316 ATH_CHECK(m_outputDataStore->clearStore(true));
318 }
320 return StatusCode::SUCCESS;
321}
#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