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
 
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 (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 &)
 
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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)
 
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
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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().

15  PoolOutputModule(ps),
16  m_lastEvent(time(nullptr)),
18  m_timeout(-1) // we want the first event right away
19  {}
PoolOutputModule(ParameterSet const &ps)
OutputModuleBase(ParameterSet const &pset)
edm::TimeoutPoolOutputModule::~TimeoutPoolOutputModule ( )
inlineoverride
edm::TimeoutPoolOutputModule::TimeoutPoolOutputModule ( TimeoutPoolOutputModule const &  )
delete

Member Function Documentation

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

Definition at line 21 of file TimeoutPoolOutputModule.cc.

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

Referenced by ~TimeoutPoolOutputModule().

21  {
24  descriptions.add("TimeoutPoolOutputModule", desc);
25  }
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 27 of file TimeoutPoolOutputModule.cc.

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

Referenced by ~TimeoutPoolOutputModule().

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  }
bool shouldWeCloseFile() const override
allow inheriting classes to override but still be able to call this method in the overridden version ...
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().