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

293 {
294  // default to the serial implementation if no output name given
295  if( outputName.empty() ) return prepareOutput();
296  ATH_MSG_DEBUG( "prepareOutput('" << outputName << "')" );
297 
298  StatusCode rc = StatusCode::SUCCESS;
299  for (auto it = m_metaDataTools.begin(); it != m_metaDataTools.end(); ++it) {
300  ATH_MSG_DEBUG(" calling metaDataStop for " << (*it)->name());
301  // planning to replace the call below with (*it)->prepareOutput(outputName)
302  if ( (*it)->metaDataStop().isFailure() ) {
303  ATH_MSG_ERROR("Unable to call metaDataStop for " << (*it)->name());
304  rc = StatusCode::FAILURE;
305  }
306  }
307  // MN: not releasing tools here - revisit when clear what happens on new file open
308  return rc;
309 }

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

313 {
315  if (!m_inputDataStore->clearStore(true).isSuccess()) {
316  ATH_MSG_ERROR("Unable to clear input MetaData Proxies");
317  return StatusCode::FAILURE;
318  }
320  }
322  if (!m_outputDataStore->clearStore(true).isSuccess()) {
323  ATH_MSG_ERROR("Unable to clear output MetaData Proxies");
324  return StatusCode::FAILURE;
325  }
327  }
328  if (!addProxyToInputMetaDataStore(filename).isSuccess()) {
329  ATH_MSG_ERROR("Unable to add proxy to InputMetaDataStore");
330  return StatusCode::FAILURE;
331  }
332  return StatusCode::SUCCESS;
333 }
MetaDataSvc::m_metaDataTools
ToolHandleArray< IMetaDataTool > m_metaDataTools
MetaDataTools, vector with the MetaData tools.
Definition: MetaDataSvc.h:323
MetaDataSvc::m_clearedInputDataStore
bool m_clearedInputDataStore
Definition: MetaDataSvc.h:307
MetaDataSvc::m_clearedOutputDataStore
bool m_clearedOutputDataStore
Definition: MetaDataSvc.h:308
skel.it
it
Definition: skel.GENtoEVGEN.py:396
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:432
MetaDataSvc::prepareOutput
virtual StatusCode prepareOutput()
Makes the metadata store ready for output.
Definition: MetaDataSvc.cxx:271
lumiFormat.outputName
string outputName
Definition: lumiFormat.py:65
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:349