11 #include "boost/bind.hpp"
20 sharedResources_(sharedResources),
21 statReporter_(sharedResources->statisticsReporter_),
22 streamRecord_(statReporter_->getStreamsMonitorCollection().getNewStreamRecord()),
23 diskWritingParams_(dbFileHandler->getDiskWritingParams()),
24 dbFileHandler_(dbFileHandler)
41 XCEPT_DECLARE_NESTED( stor::exception::DiskWriting,
42 sentinelException, errorMsg, e );
49 XCEPT_DECLARE( stor::exception::DiskWriting,
50 sentinelException, errorMsg );
56 errorMsg +=
"Unknown exception";
57 XCEPT_DECLARE( stor::exception::DiskWriting,
58 sentinelException, errorMsg );
80 const uint32_t& lumiSection,
85 std::remove_if(fileHandlers_.begin(),
91 return streamRecord_->reportLumiSectionInfo(lumiSection, str);
98 handler->writeEvent(event);
113 if ( (*it)->lumiSection() ==
event.lumiSection() )
134 statReporter_->getFilesMonitorCollection().getNewFileRecord();
138 fileRecord->runNumber =
event.runNumber();
139 fileRecord->lumiSection =
event.lumiSection();
141 catch(stor::exception::IncompleteEventMessage &
e)
144 fileRecord->lumiSection = 0;
147 fileRecord->baseFilePath =
149 fileRecord->coreFileName =
151 fileRecord->fileCounter =
getFileCounter(fileRecord->coreFileName);
153 fileRecord->isOpen =
true;
165 return diskWritingParams_.filePath_ + getFileSystem(runNumber, fileCount);
171 const uint32_t& runNumber,
177 if (diskWritingParams_.nLogicalDisk_ <= 0) {
return "";}
179 unsigned int fileSystemNumber =
181 + atoi(diskWritingParams_.smInstanceString_.c_str())
183 % diskWritingParams_.nLogicalDisk_;
185 std::ostringstream fileSystem;
186 fileSystem <<
"/" << std::setfill(
'0') << std::setw(2) << fileSystemNumber;
188 return fileSystem.str();
194 const uint32_t& runNumber,
195 const uint32_t& lumiSection
198 std::ostringstream coreFileName;
199 coreFileName << diskWritingParams_.setupLabel_
200 <<
"." << std::setfill(
'0') << std::setw(8) << runNumber
201 <<
"." << std::setfill(
'0') << std::setw(4) << lumiSection
203 <<
"." << diskWritingParams_.fileName_
204 <<
"." << std::setfill(
'0') << std::setw(2) << diskWritingParams_.smInstanceString_;
206 return coreFileName.str();
228 const unsigned long long maxFileSizeMB =
232 return ( maxFileSizeMB * 1024 * 1024 );
CoreFileNamesMap usedCoreFileNames_
std::string getCoreFileName(const uint32_t &runNumber, const uint32_t &lumiSection) const
virtual int getStreamMaxFileSize() const =0
const StatisticsReporterPtr statReporter_
boost::shared_ptr< SharedResources > SharedResourcesPtr
StreamHandler(const SharedResourcesPtr, const DbFileHandlerPtr)
boost::shared_ptr< FileRecord > FileRecordPtr
unsigned long long getMaxFileSize() const
virtual std::string streamLabel() const =0
unsigned int getFileCounter(const std::string &coreFileName)
virtual FileHandlerPtr newFileHandler(const I2OChain &event)=0
boost::shared_ptr< DbFileHandler > DbFileHandlerPtr
std::string getBaseFilePath(const uint32_t &runNumber, uint32_t fileCount) const
boost::posix_time::ptime TimePoint_t
void closeTimedOutFiles(utils::TimePoint_t currentTime=utils::getCurrentTime())
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
void writeEvent(const I2OChain &event)
virtual FileHandlerPtr getFileHandler(const I2OChain &event)
FilesMonitorCollection::FileRecordPtr getNewFileRecord(const I2OChain &event)
bool tooOld(const utils::TimePoint_t currentTime=utils::getCurrentTime())
const StreamsMonitorCollection::StreamRecordPtr streamRecord_
unsigned long totalDataSize() const
FileHandlers fileHandlers_
const DiskWritingParams & diskWritingParams_
boost::shared_ptr< FileHandler > FileHandlerPtr
const SharedResourcesPtr sharedResources_
bool closeFilesForLumiSection(const uint32_t &lumiSection, std::string &)
bool isFromLumiSection(const uint32_t lumiSection)
std::string getFileSystem(const uint32_t &runNumber, uint32_t fileCount) const