#include <DiskWriter.h>
Public Member Functions | |
DiskWriter (xdaq::Application *, SharedResourcesPtr sr) | |
void | startWorkLoop (std::string workloopName) |
bool | writeAction (toolbox::task::WorkLoop *) |
~DiskWriter () | |
Private Types | |
typedef boost::shared_ptr < StreamHandler > | StreamHandlerPtr |
typedef std::vector < StreamHandlerPtr > | StreamHandlers |
Private Member Functions | |
void | checkForFileTimeOuts (const bool doItNow=false) |
void | checkStreamChangeRequest () |
void | closeTimedOutFiles (const utils::TimePoint_t) |
void | configureErrorStreams (ErrStrConfigListPtr) |
void | configureEventStreams (EvtStrConfigListPtr) |
void | destroyStreams () |
DiskWriter (DiskWriter const &) | |
void | makeErrorStream (ErrorStreamConfigurationInfo &) |
void | makeEventStream (EventStreamConfigurationInfo &) |
void | makeFaultyEventStream () |
DiskWriter & | operator= (DiskWriter const &) |
void | processEndOfLumiSection (const I2OChain &) |
void | reportRemainingLumiSections () |
void | writeEndOfRunMarker () |
void | writeEventToStreams (const I2OChain &) |
void | writeNextEvent () |
Private Attributes | |
bool | actionIsActive_ |
xdaq::Application * | app_ |
const DbFileHandlerPtr | dbFileHandler_ |
DiskWritingParams | dwParams_ |
StreamsMonitorCollection::EndOfRunReportPtr | endOfRunReport_ |
utils::TimePoint_t | lastFileTimeoutCheckTime_ |
unsigned int | runNumber_ |
SharedResourcesPtr | sharedResources_ |
StreamHandlers | streamHandlers_ |
boost::posix_time::time_duration | timeout_ |
toolbox::task::WorkLoop * | writingWL_ |
Writes events to disk
It gets the next event from the StreamQueue and writes it to the appropriate stream file(s) on disk.
Definition at line 42 of file DiskWriter.h.
|
private |
Definition at line 153 of file DiskWriter.h.
|
private |
Definition at line 154 of file DiskWriter.h.
stor::DiskWriter::DiskWriter | ( | xdaq::Application * | app, |
SharedResourcesPtr | sr | ||
) |
Definition at line 25 of file DiskWriter.cc.
References stor::WorkerThreadParams::DWdeqWaitTime_, sharedResources_, and timeout_.
stor::DiskWriter::~DiskWriter | ( | ) |
Definition at line 40 of file DiskWriter.cc.
References actionIsActive_, destroyStreams(), and writingWL_.
|
private |
|
private |
Close old files if fileClosingTestInterval has passed or do it now if argument is true
Definition at line 202 of file DiskWriter.cc.
References closeTimedOutFiles(), dwParams_, stor::DiskWritingParams::fileClosingTestInterval_, stor::utils::getCurrentTime(), lastFileTimeoutCheckTime_, and cmsPerfSuiteHarvest::now.
Referenced by writeNextEvent().
|
private |
Reconfigure streams if a request is pending
Definition at line 174 of file DiskWriter.cc.
References configureErrorStreams(), configureEventStreams(), dbFileHandler_, destroyStreams(), dwParams_, makeFaultyEventStream(), runNumber_, sharedResources_, and timeout_.
Referenced by writeNextEvent().
|
private |
Close all timed-out files
Definition at line 214 of file DiskWriter.cc.
References stor::StreamHandler::closeTimedOutFiles(), and streamHandlers_.
Referenced by checkForFileTimeOuts().
|
private |
Configures the error streams to be written to disk
Definition at line 236 of file DiskWriter.cc.
References makeErrorStream().
Referenced by checkStreamChangeRequest().
|
private |
Configures the event streams to be written to disk
Definition at line 221 of file DiskWriter.cc.
References makeEventStream().
Referenced by checkStreamChangeRequest().
|
private |
Gracefully close all streams
Definition at line 281 of file DiskWriter.cc.
References stor::StreamHandler::closeAllFiles(), reportRemainingLumiSections(), streamHandlers_, and writeEndOfRunMarker().
Referenced by checkStreamChangeRequest(), and ~DiskWriter().
|
private |
Creates the handler for the given error event stream
Definition at line 271 of file DiskWriter.cc.
References dbFileHandler_, stor::ErrorStreamConfigurationInfo::setStreamId(), sharedResources_, and streamHandlers_.
Referenced by configureErrorStreams().
|
private |
Creates the handler for the given event stream
Definition at line 261 of file DiskWriter.cc.
References dbFileHandler_, stor::EventStreamConfigurationInfo::setStreamId(), sharedResources_, and streamHandlers_.
Referenced by configureEventStreams().
|
private |
Creates the handler for faulty events detected by the SM
Definition at line 250 of file DiskWriter.cc.
References dbFileHandler_, dwParams_, stor::DiskWritingParams::faultyEventsStream_, sharedResources_, and streamHandlers_.
Referenced by checkStreamChangeRequest().
|
private |
|
private |
Close files at the end of a luminosity section and release message memory:
Definition at line 315 of file DiskWriter.cc.
References dbFileHandler_, endOfRunReport_, stor::I2OChain::faulty(), stor::I2OChain::lumiSection(), stor::I2OChain::runNumber(), runNumber_, and streamHandlers_.
Referenced by writeNextEvent().
|
private |
Log file statistics for so far unreported lumi sections
Definition at line 294 of file DiskWriter.cc.
References dbFileHandler_, endOfRunReport_, stor::StreamsMonitorCollection::reportAllLumiSectionInfos(), and sharedResources_.
Referenced by destroyStreams().
void stor::DiskWriter::startWorkLoop | ( | std::string | workloopName | ) |
Creates and starts the disk writing workloop
Definition at line 53 of file DiskWriter.cc.
References app_, alignCSCRings::e, edm::hlt::Exception, stor::utils::getIdentifier(), lumiQueryAPI::msg, writeAction(), and writingWL_.
bool stor::DiskWriter::writeAction | ( | toolbox::task::WorkLoop * | ) |
The workloop action taking the next event from the StreamQueue and writing it to disk
Definition at line 80 of file DiskWriter.cc.
References actionIsActive_, alignCSCRings::e, cppFunctionSkipper::exception, edm::hlt::Exception, sharedResources_, and writeNextEvent().
Referenced by startWorkLoop().
|
private |
Log end-of-run marker
Definition at line 303 of file DiskWriter.cc.
References dbFileHandler_, and endOfRunReport_.
Referenced by destroyStreams().
|
private |
Writes the event to the appropriate streams
Definition at line 149 of file DiskWriter.cc.
References alignCSCRings::e, lumiQueryAPI::msg, streamHandlers_, and hcal_dqm_sourceclient-file_cfg::streams.
Referenced by writeNextEvent().
|
private |
Takes the event from the stream queue
Definition at line 113 of file DiskWriter.cc.
References checkForFileTimeOuts(), checkStreamChangeRequest(), event(), stor::utils::getCurrentTime(), stor::I2OChain::isEndOfLumiSectionMessage(), stor::I2OChain::memoryUsed(), processEndOfLumiSection(), sharedResources_, timeout_, and writeEventToStreams().
Referenced by writeAction().
|
private |
Definition at line 159 of file DiskWriter.h.
Referenced by writeAction(), and ~DiskWriter().
|
private |
Definition at line 144 of file DiskWriter.h.
Referenced by startWorkLoop().
|
private |
Definition at line 147 of file DiskWriter.h.
Referenced by checkStreamChangeRequest(), makeErrorStream(), makeEventStream(), makeFaultyEventStream(), processEndOfLumiSection(), reportRemainingLumiSections(), and writeEndOfRunMarker().
|
private |
Definition at line 146 of file DiskWriter.h.
Referenced by checkForFileTimeOuts(), checkStreamChangeRequest(), and makeFaultyEventStream().
|
private |
Definition at line 157 of file DiskWriter.h.
Referenced by processEndOfLumiSection(), reportRemainingLumiSections(), and writeEndOfRunMarker().
|
private |
Definition at line 151 of file DiskWriter.h.
Referenced by checkForFileTimeOuts().
|
private |
Definition at line 149 of file DiskWriter.h.
Referenced by checkStreamChangeRequest(), and processEndOfLumiSection().
|
private |
Definition at line 145 of file DiskWriter.h.
Referenced by checkStreamChangeRequest(), DiskWriter(), makeErrorStream(), makeEventStream(), makeFaultyEventStream(), reportRemainingLumiSections(), writeAction(), and writeNextEvent().
|
private |
Definition at line 155 of file DiskWriter.h.
Referenced by closeTimedOutFiles(), destroyStreams(), makeErrorStream(), makeEventStream(), makeFaultyEventStream(), processEndOfLumiSection(), and writeEventToStreams().
|
private |
Definition at line 150 of file DiskWriter.h.
Referenced by checkStreamChangeRequest(), DiskWriter(), and writeNextEvent().
|
private |
Definition at line 160 of file DiskWriter.h.
Referenced by startWorkLoop(), and ~DiskWriter().