Classes | Public Member Functions | Private Attributes | List of all members
art::ClosingCriteria Class Reference

#include <ClosingCriteria.h>

Classes

struct  Config
 
struct  Defaults
 

Public Member Functions

 ~ClosingCriteria ()
 
 ClosingCriteria ()
 
 ClosingCriteria (Config const &fp)
 
 ClosingCriteria (FileProperties const &fp, std::string const &granularity)
 
FileProperties const & fileProperties () const
 
Granularity granularity () const
 
bool should_close (FileProperties const &) const
 

Private Attributes

FileProperties closingCriteria_
 
Granularity granularity_
 

Detailed Description

Definition at line 69 of file ClosingCriteria.h.

Constructor & Destructor Documentation

art::ClosingCriteria::~ClosingCriteria ( )
default
art::ClosingCriteria::ClosingCriteria ( )

Definition at line 232 of file ClosingCriteria.cc.

233  : closingCriteria_{}
235  {}
static BT value(std::string const &spec)
FileProperties closingCriteria_
static constexpr char const * granularity_default()
art::ClosingCriteria::ClosingCriteria ( Config const &  fp)

Definition at line 242 of file ClosingCriteria.cc.

243  : ClosingCriteria{FileProperties{c.maxEvents(),
244  c.maxSubRuns(),
245  c.maxRuns(),
246  c.maxInputFiles(),
247  c.maxSize(),
248  chrono::seconds{c.maxAge()}},
249  c.granularity()}
250  {
251  auto const& cc = closingCriteria_;
252  config_require(cc.nEvents() > 0, "maxEvents must be greater than 0.");
253  config_require(cc.nSubRuns() > 0, "maxSubRuns must be greater than 0.");
254  config_require(cc.nRuns() > 0, "maxRuns must be greater than 0.");
255  config_require(cc.nInputFiles() > 0,
256  "maxInputFiles must be greater than 0.");
257  config_require(cc.size() > 0, "maxSize must be greater than 0 KiB.");
258  config_require(cc.age() > decltype(cc.age())::zero(),
259  "maxAge must be greater than 0 seconds.");
260  }
second seconds
Alias for common language habits.
Definition: spacetime.h:88
FileProperties closingCriteria_
art::ClosingCriteria::ClosingCriteria ( FileProperties const &  fp,
std::string const &  granularity 
)

Definition at line 237 of file ClosingCriteria.cc.

Member Function Documentation

FileProperties const & art::ClosingCriteria::fileProperties ( ) const

Definition at line 263 of file ClosingCriteria.cc.

264  {
265  return closingCriteria_;
266  }
FileProperties closingCriteria_
Granularity art::ClosingCriteria::granularity ( ) const

Definition at line 269 of file ClosingCriteria.cc.

270  {
271  return granularity_;
272  }
bool art::ClosingCriteria::should_close ( FileProperties const &  fp) const

Definition at line 275 of file ClosingCriteria.cc.

276  {
277  return (fp.size() >= closingCriteria_.size()) ||
278  (fp.nEvents() >= closingCriteria_.nEvents()) ||
279  (fp.nSubRuns() >= closingCriteria_.nSubRuns()) ||
280  (fp.nRuns() >= closingCriteria_.nRuns()) ||
281  (fp.nInputFiles() >= closingCriteria_.nInputFiles()) ||
282  (fp.age() >= closingCriteria_.age());
283  }
unsigned nEvents() const
unsigned nSubRuns() const
unsigned nInputFiles() const
unsigned nRuns() const
std::chrono::seconds age() const
FileProperties closingCriteria_
unsigned size() const

Member Data Documentation

FileProperties art::ClosingCriteria::closingCriteria_
private

Definition at line 144 of file ClosingCriteria.h.

Granularity art::ClosingCriteria::granularity_
private

The documentation for this class was generated from the following files: