CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
edm::TimeoutPoolOutputModule Class Reference

#include <TimeoutPoolOutputModule.h>

Inheritance diagram for edm::TimeoutPoolOutputModule:
edm::PoolOutputModule edm::one::OutputModule< WatchInputFiles > edm::one::OutputModuleBase edm::EDConsumerBase dqmservices::JsonWritingTimeoutPoolOutputModule

Public Member Functions

TimeoutPoolOutputModuleoperator= (TimeoutPoolOutputModule const &)=delete
 
 TimeoutPoolOutputModule (ParameterSet const &ps)
 
 TimeoutPoolOutputModule (TimeoutPoolOutputModule const &)=delete
 
 ~TimeoutPoolOutputModule () override
 
- Public Member Functions inherited from edm::PoolOutputModule
AuxItemArray const & auxItems () const
 
std::string const & basketOrder () const
 
int const & basketSize () const
 
BranchChildren const & branchChildren () const
 
std::string const & catalog () const
 
std::string const & compressionAlgorithm () const
 
int const & compressionLevel () const
 
std::string const & currentFileName () const
 
DropMetaData const & dropMetaData () const
 
int eventAutoFlushSize () const
 
std::string const & fileName () const
 
int const & inputFileCount () const
 
std::string const & logicalFileName () const
 
unsigned int const & maxFileSize () const
 
std::string const & moduleLabel () const
 
PoolOutputModuleoperator= (PoolOutputModule const &)=delete
 
bool const & overrideInputFileSplitLevels () const
 
 PoolOutputModule (ParameterSet const &ps)
 
 PoolOutputModule (PoolOutputModule const &)=delete
 
OutputItemListArrayselectedOutputItemList ()
 
OutputItemListArray const & selectedOutputItemList () const
 
int const & splitLevel () const
 
int const & treeMaxVirtualSize () const
 
int const & whyNotFastClonable () const
 
 ~PoolOutputModule () override
 
- Public Member Functions inherited from edm::one::OutputModule< WatchInputFiles >
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
 OutputModule (edm::ParameterSet const &iPSet)
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::OutputModuleBase
BranchIDLists const * branchIDLists ()
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType const & keptProducts () const
 
int maxEvents () const
 
const ModuleDescriptionmoduleDescription () const
 
OutputModuleBaseoperator= (OutputModuleBase const &)=delete
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
 OutputModuleBase (ParameterSet const &pset)
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &)
 
SharedResourcesAcquirersharedResourcesAcquirer ()
 
SubProcessParentageHelper const * subProcessParentageHelper () const
 
ThinnedAssociationsHelper const * thinnedAssociationsHelper () const
 
bool wantAllEvents () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~OutputModuleBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::PoolOutputModule
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::OutputModuleBase
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

bool shouldWeCloseFile () const override
 allow inheriting classes to override but still be able to call this method in the overridden version More...
 
void write (EventForOutput const &e) override
 
- Protected Member Functions inherited from edm::PoolOutputModule
virtual void doExtrasAfterCloseFile ()
 
virtual std::pair< std::string, std::string > physicalAndLogicalNameForNewFile ()
 
- Protected Member Functions inherited from edm::one::OutputModuleBase
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
 
bool doBeginRun (RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
 
bool doEndRun (RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
 
bool doEvent (EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
virtual void preallocLumis (unsigned int)
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int >>> const &outputModulePathPositions, bool anyProductProduced)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Attributes

unsigned int eventsWrittenInCurrentFile
 
time_t m_lastEvent
 
int m_timeout
 

Additional Inherited Members

- Public Types inherited from edm::PoolOutputModule
typedef std::array< AuxItem, NumBranchTypesAuxItemArray
 
enum  DropMetaData { DropNone, DropDroppedPrior, DropPrior, DropAll }
 
typedef std::vector< OutputItemOutputItemList
 
typedef std::array< OutputItemList, NumBranchTypesOutputItemListArray
 
- Public Types inherited from edm::one::OutputModuleBase
typedef OutputModuleBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 23 of file TimeoutPoolOutputModule.h.

Constructor & Destructor Documentation

◆ TimeoutPoolOutputModule() [1/2]

edm::TimeoutPoolOutputModule::TimeoutPoolOutputModule ( ParameterSet const &  ps)
explicit

Definition at line 13 of file TimeoutPoolOutputModule.cc.

15  PoolOutputModule(ps),
16  m_lastEvent(time(nullptr)),
18  m_timeout(-1) // we want the first event right away
19  {}

◆ ~TimeoutPoolOutputModule()

edm::TimeoutPoolOutputModule::~TimeoutPoolOutputModule ( )
inlineoverride

Definition at line 26 of file TimeoutPoolOutputModule.h.

26 {};

◆ TimeoutPoolOutputModule() [2/2]

edm::TimeoutPoolOutputModule::TimeoutPoolOutputModule ( TimeoutPoolOutputModule const &  )
delete

Member Function Documentation

◆ fillDescriptions()

void edm::TimeoutPoolOutputModule::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 21 of file TimeoutPoolOutputModule.cc.

21  {
24  descriptions.add("TimeoutPoolOutputModule", desc);
25  }

References edm::ConfigurationDescriptions::add(), and edm::PoolOutputModule::fillDescription().

◆ operator=()

TimeoutPoolOutputModule& edm::TimeoutPoolOutputModule::operator= ( TimeoutPoolOutputModule const &  )
delete

◆ shouldWeCloseFile()

bool edm::TimeoutPoolOutputModule::shouldWeCloseFile ( ) const
overrideprotectedvirtual

allow inheriting classes to override but still be able to call this method in the overridden version

Reimplemented from edm::PoolOutputModule.

Definition at line 27 of file TimeoutPoolOutputModule.cc.

27  {
28  time_t now(time(nullptr));
30  edm::LogVerbatim("TimeoutPoolOutputModule")
31  << " Closing file " << currentFileName() << " with " << eventsWrittenInCurrentFile << " events.";
33  m_lastEvent = now;
34  return true;
35  }
36  // std::cout <<" Events "<< eventsWrittenInCurrentFile<<" time "<< now - m_lastEvent<<std::endl;
38  return false;
39  if (now - m_lastEvent < m_timeout)
40  return false;
41  // next files are needed in 15, 30 and 60 sec
42  m_lastEvent = now;
43  if (m_timeout == 30)
44  m_timeout = 60;
45  if (m_timeout == 15)
46  m_timeout = 30;
47  if (m_timeout == -1)
48  m_timeout = 15;
49 
50  edm::LogVerbatim("TimeoutPoolOutputModule")
51  << " Closing file " << currentFileName() << " with " << eventsWrittenInCurrentFile << " events.";
53  return true;
54  }

References edm::PoolOutputModule::currentFileName(), eventsWrittenInCurrentFile, m_lastEvent, m_timeout, fileCollector::now, edm::PoolOutputModule::shouldWeCloseFile(), and ntuplemaker::time.

◆ write()

void edm::TimeoutPoolOutputModule::write ( EventForOutput const &  e)
overrideprotectedvirtual

Member Data Documentation

◆ eventsWrittenInCurrentFile

unsigned int edm::TimeoutPoolOutputModule::eventsWrittenInCurrentFile
mutableprivate

Definition at line 38 of file TimeoutPoolOutputModule.h.

Referenced by shouldWeCloseFile(), and write().

◆ m_lastEvent

time_t edm::TimeoutPoolOutputModule::m_lastEvent
mutableprivate

Definition at line 37 of file TimeoutPoolOutputModule.h.

Referenced by shouldWeCloseFile().

◆ m_timeout

int edm::TimeoutPoolOutputModule::m_timeout
mutableprivate

Definition at line 39 of file TimeoutPoolOutputModule.h.

Referenced by shouldWeCloseFile().

edm::TimeoutPoolOutputModule::m_timeout
int m_timeout
Definition: TimeoutPoolOutputModule.h:39
edm::PoolOutputModule::currentFileName
std::string const & currentFileName() const
Definition: PoolOutputModule.cc:118
edm::one::OutputModuleBase::OutputModuleBase
OutputModuleBase(ParameterSet const &pset)
Definition: OutputModuleBase.cc:45
edm::PoolOutputModule::PoolOutputModule
PoolOutputModule(ParameterSet const &ps)
Definition: PoolOutputModule.cc:36
fileCollector.now
now
Definition: fileCollector.py:207
edm::TimeoutPoolOutputModule::eventsWrittenInCurrentFile
unsigned int eventsWrittenInCurrentFile
Definition: TimeoutPoolOutputModule.h:38
edm::LogVerbatim
Definition: MessageLogger.h:297
edm::TimeoutPoolOutputModule::m_lastEvent
time_t m_lastEvent
Definition: TimeoutPoolOutputModule.h:37
edm::PoolOutputModule::shouldWeCloseFile
bool shouldWeCloseFile() const override
allow inheriting classes to override but still be able to call this method in the overridden version
Definition: PoolOutputModule.cc:330
ParameterSetDescription
ntuplemaker.time
time
Definition: ntuplemaker.py:310
edm::PoolOutputModule::write
void write(EventForOutput const &e) override
Definition: PoolOutputModule.cc:271
edm::PoolOutputModule::fillDescription
static void fillDescription(ParameterSetDescription &desc)
Definition: PoolOutputModule.cc:428
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37