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
 
virtual ~TimeoutPoolOutputModule ()
 
- 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
 
OutputItemListArray const & selectedOutputItemList () const
 
int const & splitLevel () const
 
int const & treeMaxVirtualSize () const
 
int const & whyNotFastClonable () const
 
virtual ~PoolOutputModule ()
 
- Public Member Functions inherited from edm::one::OutputModule< WatchInputFiles >
 OutputModule (edm::ParameterSet const &iPSet)
 
- 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 (ParameterSet const &pset)
 
 OutputModuleBase (OutputModuleBase const &)=delete
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &)
 
SubProcessParentageHelper const * subProcessParentageHelper () const
 
ThinnedAssociationsHelper const * thinnedAssociationsHelper () const
 
bool wantAllEvents () const
 
virtual ~OutputModuleBase ()
 
- 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

virtual bool shouldWeCloseFile () const override
 allow inheriting classes to override but still be able to call this method in the overridden version More...
 
virtual 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, EventSetup const &c, ModuleCallingContext const *)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, 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

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

Definition at line 13 of file TimeoutPoolOutputModule.cc.

Referenced by ~TimeoutPoolOutputModule().

13  :
15  PoolOutputModule(ps),
18  m_timeout(-1) // we want the first event right away
19  { }
#define NULL
Definition: scimark2.h:8
PoolOutputModule(ParameterSet const &ps)
OutputModuleBase(ParameterSet const &pset)
virtual edm::TimeoutPoolOutputModule::~TimeoutPoolOutputModule ( )
inlinevirtual
edm::TimeoutPoolOutputModule::TimeoutPoolOutputModule ( TimeoutPoolOutputModule const &  )
delete

Member Function Documentation

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

Definition at line 22 of file TimeoutPoolOutputModule.cc.

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

Referenced by ~TimeoutPoolOutputModule().

22  {
25  descriptions.add("TimeoutPoolOutputModule", desc);
26  }
static void fillDescription(ParameterSetDescription &desc)
TimeoutPoolOutputModule& edm::TimeoutPoolOutputModule::operator= ( TimeoutPoolOutputModule const &  )
delete
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 28 of file TimeoutPoolOutputModule.cc.

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

Referenced by ~TimeoutPoolOutputModule().

28  {
29  time_t now(time(NULL));
31  edm::LogVerbatim("TimeoutPoolOutputModule") <<" 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;
37  if (eventsWrittenInCurrentFile==0) return false;
38  if ( now - m_lastEvent < m_timeout ) return false;
39  // next files are needed in 15, 30 and 60 sec
40  m_lastEvent = now;
41  if (m_timeout == 30) m_timeout = 60;
42  if (m_timeout == 15) m_timeout = 30;
43  if (m_timeout == -1) m_timeout = 15;
44 
45  edm::LogVerbatim("TimeoutPoolOutputModule") <<" Closing file "<< currentFileName()<< " with "<< eventsWrittenInCurrentFile <<" events.";
47  return true;
48  }
virtual bool shouldWeCloseFile() const override
allow inheriting classes to override but still be able to call this method in the overridden version ...
#define NULL
Definition: scimark2.h:8
std::string const & currentFileName() const
void edm::TimeoutPoolOutputModule::write ( EventForOutput const &  e)
overrideprotectedvirtual

Member Data Documentation

unsigned int edm::TimeoutPoolOutputModule::eventsWrittenInCurrentFile
mutableprivate

Definition at line 38 of file TimeoutPoolOutputModule.h.

Referenced by shouldWeCloseFile(), and write().

time_t edm::TimeoutPoolOutputModule::m_lastEvent
mutableprivate

Definition at line 37 of file TimeoutPoolOutputModule.h.

Referenced by shouldWeCloseFile().

int edm::TimeoutPoolOutputModule::m_timeout
mutableprivate

Definition at line 39 of file TimeoutPoolOutputModule.h.

Referenced by shouldWeCloseFile().