ATLAS Offline Software
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. More...
 
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. More...
 

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

282 {
283  // default to the serial implementation if no output name given
284  if( outputName.empty() ) {
285  return prepareOutput();
286  }
287  ATH_MSG_DEBUG( "prepareOutput('" << outputName << "')" );
288 
289  StatusCode rc{StatusCode::SUCCESS};
290  for (auto& tool : m_metaDataTools) {
291  ATH_MSG_DEBUG(" calling metaDataStop for " << tool->name());
292  // planning to replace the call below with (*it)->prepareOutput(outputName)
293  if (tool->metaDataStop().isFailure()) {
294  ATH_MSG_ERROR("Unable to call metaDataStop for " << tool->name());
295  rc = StatusCode::FAILURE;
296  }
297  }
298  // MN: not releasing tools here - revisit when clear what happens on new file open
299  return rc;
300 }

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

304 {
306  ATH_CHECK(m_inputDataStore->clearStore(true));
308  }
310  ATH_CHECK(m_outputDataStore->clearStore(true));
312  }
314  return StatusCode::SUCCESS;
315 }
MetaDataSvc::m_clearedInputDataStore
bool m_clearedInputDataStore
Definition: MetaDataSvc.h:307
MetaDataSvc::m_clearedOutputDataStore
bool m_clearedOutputDataStore
Definition: MetaDataSvc.h:308
MetaDataSvc::m_inputDataStore
ServiceHandle< StoreGateSvc > m_inputDataStore
Definition: MetaDataSvc.h:298
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MetaDataSvc::m_outputDataStore
ServiceHandle< StoreGateSvc > m_outputDataStore
Definition: MetaDataSvc.h:299
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MetaDataSvc::addProxyToInputMetaDataStore
StatusCode addProxyToInputMetaDataStore(const std::string &tokenStr)
Definition: MetaDataSvc.cxx:414
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MetaDataSvc::m_metaDataTools
PublicToolHandleArray< IMetaDataTool > m_metaDataTools
MetaDataTools, vector with the MetaData tools.
Definition: MetaDataSvc.h:323
MetaDataSvc::prepareOutput
virtual StatusCode prepareOutput()
Makes the metadata store ready for output.
Definition: MetaDataSvc.cxx:258
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:452
lumiFormat.outputName
string outputName
Definition: lumiFormat.py:65
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:375