#include <EventStreamHandler.h>
Public Member Functions | |
EventStreamHandler (const EventStreamConfigurationInfo &, const SharedResourcesPtr, const DbFileHandlerPtr) | |
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_ |
Handle one event stream written to disk.
Definition at line 29 of file EventStreamHandler.h.
stor::EventStreamHandler::EventStreamHandler | ( | const EventStreamConfigurationInfo & | streamConfig, |
const SharedResourcesPtr | sharedResources, | ||
const DbFileHandlerPtr | dbFileHandler | ||
) |
Definition at line 13 of file EventStreamHandler.cc.
References StorageManager_cfg::streamLabel.
: StreamHandler(sharedResources, dbFileHandler), streamConfig_(streamConfig), initMsgCollection_(sharedResources->initMsgCollection_) { streamRecord_->streamName = streamLabel(); streamRecord_->outputModuleLabel = streamConfig_.outputModuleLabel(); streamRecord_->fractionToDisk = fractionToDisk(); }
virtual double stor::EventStreamHandler::fractionToDisk | ( | ) | const [inline, private, virtual] |
Return the fraction-to-disk parameter
Implements stor::StreamHandler.
Definition at line 52 of file EventStreamHandler.h.
References stor::EventStreamConfigurationInfo::fractionToDisk(), and streamConfig_.
{ return streamConfig_.fractionToDisk(); }
virtual int stor::EventStreamHandler::getStreamMaxFileSize | ( | ) | const [inline, private, virtual] |
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_.
{ return streamConfig_.maxFileSizeMB(); }
StreamHandler::FileHandlerPtr stor::EventStreamHandler::newFileHandler | ( | const I2OChain & | event | ) | [private, virtual] |
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().
{ // the INIT message is not available when the EventStreamHandler is // constructed, so we need to fetch it when we first need a new file // handler (when the first event is received, which is after the // INIT messages have been received) if (initMsgView_.get() == 0) { initMsgView_ = initMsgCollection_->getElementForOutputModuleId( event.outputModuleId() ); } FilesMonitorCollection::FileRecordPtr fileRecord = getNewFileRecord(event); FileHandlerPtr newFileHandler( new EventFileHandler(initMsgView_, fileRecord, dbFileHandler_, getMaxFileSize()) ); fileHandlers_.push_back(newFileHandler); return newFileHandler; }
virtual std::string stor::EventStreamHandler::streamLabel | ( | ) | const [inline, private, virtual] |
Return the stream label
Implements stor::StreamHandler.
Definition at line 46 of file EventStreamHandler.h.
References streamConfig_, and stor::EventStreamConfigurationInfo::streamLabel().
{ return streamConfig_.streamLabel(); }
Definition at line 68 of file EventStreamHandler.h.
Referenced by newFileHandler().
Definition at line 69 of file EventStreamHandler.h.
Referenced by newFileHandler().
Definition at line 67 of file EventStreamHandler.h.
Referenced by fractionToDisk(), getStreamMaxFileSize(), and streamLabel().