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

314 {
315  // default to the serial implementation if no output name given
316  if( outputName.empty() ) return prepareOutput();
317  ATH_MSG_DEBUG( "prepareOutput('" << outputName << "')" );
318 
319  StatusCode rc = StatusCode::SUCCESS;
320  for (auto it = m_metaDataTools.begin(); it != m_metaDataTools.end(); ++it) {
321  ATH_MSG_DEBUG(" calling metaDataStop for " << (*it)->name());
322  // planning to replace the call below with (*it)->prepareOutput(outputName)
323  if ( (*it)->metaDataStop().isFailure() ) {
324  ATH_MSG_ERROR("Unable to call metaDataStop for " << (*it)->name());
325  rc = StatusCode::FAILURE;
326  }
327  }
328  // MN: not releasing tools here - revisit when clear what happens on new file open
329  return rc;
330 }

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

334 {
336  if (!m_inputDataStore->clearStore(true).isSuccess()) {
337  ATH_MSG_ERROR("Unable to clear input MetaData Proxies");
338  return StatusCode::FAILURE;
339  }
341  }
343  if (!m_outputDataStore->clearStore(true).isSuccess()) {
344  ATH_MSG_ERROR("Unable to clear output MetaData Proxies");
345  return StatusCode::FAILURE;
346  }
348  }
349  if (!addProxyToInputMetaDataStore(filename).isSuccess()) {
350  ATH_MSG_ERROR("Unable to add proxy to InputMetaDataStore");
351  return StatusCode::FAILURE;
352  }
353  return StatusCode::SUCCESS;
354 }
MetaDataSvc::m_metaDataTools
ToolHandleArray< IMetaDataTool > m_metaDataTools
MetaDataTools, vector with the MetaData tools.
Definition: MetaDataSvc.h:338
MetaDataSvc::m_clearedInputDataStore
bool m_clearedInputDataStore
Definition: MetaDataSvc.h:321
MetaDataSvc::m_clearedOutputDataStore
bool m_clearedOutputDataStore
Definition: MetaDataSvc.h:322
skel.it
it
Definition: skel.GENtoEVGEN.py:423
MetaDataSvc::m_inputDataStore
ServiceHandle< StoreGateSvc > m_inputDataStore
Definition: MetaDataSvc.h:312
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:313
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MetaDataSvc::addProxyToInputMetaDataStore
StatusCode addProxyToInputMetaDataStore(const std::string &tokenStr)
Definition: MetaDataSvc.cxx:453
MetaDataSvc::prepareOutput
virtual StatusCode prepareOutput()
Makes the metadata store ready for output.
Definition: MetaDataSvc.cxx:292
lumiFormat.outputName
string outputName
Definition: lumiFormat.py:71
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:350