CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
stor::EventStreamHandler Class Reference

#include <EventStreamHandler.h>

Inheritance diagram for stor::EventStreamHandler:
stor::StreamHandler

Public Member Functions

 EventStreamHandler (const EventStreamConfigurationInfo &, const SharedResourcesPtr, const DbFileHandlerPtr)
 
- Public Member Functions inherited from stor::StreamHandler
void closeAllFiles ()
 
bool closeFilesForLumiSection (const uint32_t &lumiSection, std::string &)
 
void closeTimedOutFiles (utils::TimePoint_t currentTime=utils::getCurrentTime())
 
 StreamHandler (const SharedResourcesPtr, const DbFileHandlerPtr)
 
void writeEvent (const I2OChain &event)
 
virtual ~StreamHandler ()
 

Private Member Functions

virtual double fractionToDisk () const
 
virtual int getStreamMaxFileSize () const
 
virtual FileHandlerPtr newFileHandler (const I2OChain &event)
 
virtual std::string streamLabel () const
 

Private Attributes

InitMsgCollectionPtr initMsgCollection_
 
InitMsgSharedPtr initMsgView_
 
EventStreamConfigurationInfo streamConfig_
 

Additional Inherited Members

- Protected Types inherited from stor::StreamHandler
typedef std::map< std::string,
unsigned int > 
CoreFileNamesMap
 
typedef boost::shared_ptr
< FileHandler
FileHandlerPtr
 
typedef std::vector
< FileHandlerPtr
FileHandlers
 
- Protected Member Functions inherited from stor::StreamHandler
virtual FileHandlerPtr getFileHandler (const I2OChain &event)
 
unsigned long long getMaxFileSize () const
 
FilesMonitorCollection::FileRecordPtr getNewFileRecord (const I2OChain &event)
 
- Protected Attributes inherited from stor::StreamHandler
const DbFileHandlerPtr dbFileHandler_
 
const DiskWritingParamsdiskWritingParams_
 
FileHandlers fileHandlers_
 
const SharedResourcesPtr sharedResources_
 
const StatisticsReporterPtr statReporter_
 
const
StreamsMonitorCollection::StreamRecordPtr 
streamRecord_
 
CoreFileNamesMap usedCoreFileNames_
 

Detailed Description

Handle one event stream written to disk.

Author:
mommsen
Revision:
1.7
Date:
2011/03/07 15:31:31

Definition at line 29 of file EventStreamHandler.h.

Constructor & Destructor Documentation

stor::EventStreamHandler::EventStreamHandler ( const EventStreamConfigurationInfo streamConfig,
const SharedResourcesPtr  sharedResources,
const DbFileHandlerPtr  dbFileHandler 
)

Definition at line 13 of file EventStreamHandler.cc.

References StorageManager_cfg::streamLabel.

17  :
18  StreamHandler(sharedResources, dbFileHandler),
19  streamConfig_(streamConfig),
20  initMsgCollection_(sharedResources->initMsgCollection_)
21  {
22  streamRecord_->streamName = streamLabel();
23  streamRecord_->outputModuleLabel = streamConfig_.outputModuleLabel();
24  streamRecord_->fractionToDisk = fractionToDisk();
25  }
InitMsgCollectionPtr initMsgCollection_
virtual double fractionToDisk() const
StreamHandler(const SharedResourcesPtr, const DbFileHandlerPtr)
const StreamsMonitorCollection::StreamRecordPtr streamRecord_
virtual std::string streamLabel() const
const std::string & outputModuleLabel() const
EventStreamConfigurationInfo streamConfig_

Member Function Documentation

virtual double stor::EventStreamHandler::fractionToDisk ( ) const
inlineprivatevirtual

Return the fraction-to-disk parameter

Implements stor::StreamHandler.

Definition at line 52 of file EventStreamHandler.h.

References stor::EventStreamConfigurationInfo::fractionToDisk(), and streamConfig_.

53  { return streamConfig_.fractionToDisk(); }
EventStreamConfigurationInfo streamConfig_
virtual int stor::EventStreamHandler::getStreamMaxFileSize ( ) const
inlineprivatevirtual

Return the maximum file size for the stream in MB

Implements stor::StreamHandler.

Definition at line 63 of file EventStreamHandler.h.

References stor::EventStreamConfigurationInfo::maxFileSizeMB(), and streamConfig_.

64  { return streamConfig_.maxFileSizeMB(); }
EventStreamConfigurationInfo streamConfig_
StreamHandler::FileHandlerPtr stor::EventStreamHandler::newFileHandler ( const I2OChain event)
privatevirtual

Return a new file handler for the provided event

Implements stor::StreamHandler.

Definition at line 29 of file EventStreamHandler.cc.

References stor::StreamHandler::dbFileHandler_, stor::StreamHandler::fileHandlers_, stor::StreamHandler::getMaxFileSize(), stor::StreamHandler::getNewFileRecord(), initMsgCollection_, initMsgView_, and stor::I2OChain::outputModuleId().

30  {
31  // the INIT message is not available when the EventStreamHandler is
32  // constructed, so we need to fetch it when we first need a new file
33  // handler (when the first event is received, which is after the
34  // INIT messages have been received)
35  if (initMsgView_.get() == 0)
36  {
37  initMsgView_ = initMsgCollection_->getElementForOutputModuleId( event.outputModuleId() );
38  }
39 
41 
43  new EventFileHandler(initMsgView_, fileRecord, dbFileHandler_, getMaxFileSize())
44  );
45  fileHandlers_.push_back(newFileHandler);
46 
47  return newFileHandler;
48  }
InitMsgCollectionPtr initMsgCollection_
const DbFileHandlerPtr dbFileHandler_
boost::shared_ptr< FileRecord > FileRecordPtr
virtual FileHandlerPtr newFileHandler(const I2OChain &event)
unsigned long long getMaxFileSize() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
FilesMonitorCollection::FileRecordPtr getNewFileRecord(const I2OChain &event)
FileHandlers fileHandlers_
boost::shared_ptr< FileHandler > FileHandlerPtr
Definition: StreamHandler.h:67
InitMsgSharedPtr initMsgView_
virtual std::string stor::EventStreamHandler::streamLabel ( ) const
inlineprivatevirtual

Return the stream label

Implements stor::StreamHandler.

Definition at line 46 of file EventStreamHandler.h.

References streamConfig_, and stor::EventStreamConfigurationInfo::streamLabel().

47  { return streamConfig_.streamLabel(); }
EventStreamConfigurationInfo streamConfig_

Member Data Documentation

InitMsgCollectionPtr stor::EventStreamHandler::initMsgCollection_
private

Definition at line 68 of file EventStreamHandler.h.

Referenced by newFileHandler().

InitMsgSharedPtr stor::EventStreamHandler::initMsgView_
private

Definition at line 69 of file EventStreamHandler.h.

Referenced by newFileHandler().

EventStreamConfigurationInfo stor::EventStreamHandler::streamConfig_
private

Definition at line 67 of file EventStreamHandler.h.

Referenced by fractionToDisk(), getStreamMaxFileSize(), and streamLabel().