![]() |
RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
#include <rotating_output.h>
Public Member Functions | |
void | open (const std::string &periodPattern) |
virtual void | performRotation () |
virtual void | close () |
Protected Types | |
typedef boost::recursive_mutex | Lock |
typedef boost::unique_lock< Lock > | Guard |
Protected Member Functions | |
virtual void | openSubordinate (Date newDate)=0 |
virtual void | rotateSubordinate (Date newDate)=0 |
virtual void | closeSubordinate ()=0 |
Protected Attributes | |
Lock | lock |
TimeGranularity | granularity |
int | number |
Date | currentPeriodStart |
Start of current logging period. | |
double | interval |
How many seconds from period start until we rotate. |
An output sink that rotates what it's writing to periodically.
Definition at line 26 of file rotating_output.h.
void Datacratic::RotatingOutput::close | ( | ) | [virtual] |
Should close whatever resources are being used by the output and join any threads that it's created.
Implements Datacratic::LogOutput.
Reimplemented in Datacratic::RotatingOutputAdaptor.
Definition at line 58 of file rotating_output.cc.
virtual void Datacratic::RotatingOutput::closeSubordinate | ( | ) | [protected, pure virtual] |
Subclass must override to close the current sink.
virtual void Datacratic::RotatingOutput::openSubordinate | ( | Date | newDate | ) | [protected, pure virtual] |
Subclass must override this to open a sink for the given date and make it so that any record() calls write to that new sink.
virtual void Datacratic::RotatingOutput::rotateSubordinate | ( | Date | newDate | ) | [protected, pure virtual] |
Subclass must override this to atomically open a sink for the given date and replace the current sink so that any record() calls write to the new sink. When the function returns the old sink must not be written to anymore.
Note that due to the atomic requirement, this is NOT the same as just calling close on the old one and open on the new one.