#include <omniEventsLog.h>
Collaboration diagram for OmniEvents::omniEventsLog:
Public Methods | |
omniEventsLog (const char *logdir=NULL) | |
virtual | ~omniEventsLog () |
bool | fileExists (const char *filename) const |
const char * | activeFilename () const |
const char * | backupFilename () const |
PersistNode * | bootstrap (int port, const char *endPointNoListen) |
Creates an initialState from its arguments. More... | |
virtual PersistNode * | parse () |
Creates an initialState from the logfile. More... | |
void | incarnateFactory (PersistNode *initialState) |
Constructs the EventChannelFactory from the information in the initialState parameter. More... | |
virtual void | runWorker () |
Kicks off the worker thread that periodically checkpoints the persistency logfile. More... | |
EventChannelFactory_i * | factory () |
accessor method. More... | |
void | checkpoint (void) |
Entry point used by the omniEventsLogWorker to perform checkpointing. More... | |
virtual void | output (ostream &os) |
Protected Methods | |
virtual void | initializeFileNames (const char *logdir) |
Sets the values of 'active', 'backup' and 'checkpoint' file names. More... | |
void | setFilename (char *&filename, const char *logdir, const char *sep, const char *logname, const char *hostname, const char *ext) |
Helper function that sets the value of the first parameter to the concatenation of all the subsequent parameters. More... | |
virtual void | openOfstream (ofstream &s, const char *filename, int flags=0, int *fd=NULL) |
Helper method that opens an output file stream using whatever method is available. More... | |
Private Attributes | |
ofstream | _logstream |
char * | _activeFilename |
char * | _backupFilename |
char * | _checkpointFilename |
omni_thread * | _workerThread |
In charge of checkpoints. More... | |
EventChannelFactory_i * | _factory |
bool | _checkpointNeeded |
omni_mutex | _lock |
Static Private Attributes | |
omniEventsLog * | theLog = NULL |
Friends | |
class | WriteLock |
|
Definition at line 277 of file omniEventsLog.cc. References initializeFileNames(). |
|
Definition at line 292 of file omniEventsLog.cc. |
|
Definition at line 135 of file omniEventsLog.h. References _activeFilename. |
|
Definition at line 136 of file omniEventsLog.h. References _backupFilename. |
|
Creates an initialState from its arguments. Used when the server is cold started with no saved state. Aborts with an error if there are any logfiles in the log directory. Definition at line 305 of file omniEventsLog.cc. References OmniEvents::PersistNode::addattr(), and OmniEvents::PersistNode::addnode(). |
|
Entry point used by the omniEventsLogWorker to perform checkpointing. The active logfile is moved to backup, and a new active logfile is created. Definition at line 413 of file omniEventsLog.cc. References _activeFilename, _backupFilename, _checkpointFilename, _checkpointNeeded, _lock, _logstream, DB, OMNIEVENTS_LOG_CHECKPOINT_PERIOD, openOfstream(), output(), and OmniEvents::timestamp::t(). |
|
accessor method.
Definition at line 161 of file omniEventsLog.h. References _factory. |
|
Definition at line 298 of file omniEventsLog.cc. References STRUCT_STAT. Referenced by incarnateFactory(), and parse(). |
|
Constructs the EventChannelFactory from the information in the initialState parameter.
Definition at line 360 of file omniEventsLog.cc. References _activeFilename, _factory, _logstream, OmniEvents::PersistNode::child(), fileExists(), and openOfstream(). |
|
Sets the values of 'active', 'backup' and 'checkpoint' file names. The files are placed in the log file directory, that is specified by:
Definition at line 591 of file omniEventsLog.cc. References _activeFilename, _backupFilename, _checkpointFilename, gethostname(), MAXHOSTNAMELEN, OMNIEVENTS_LOG_DEFAULT_LOCATION, setFilename(), and VMS_SEMICOLON. Referenced by omniEventsLog(). |
|
Helper method that opens an output file stream using whatever method is available. Available flags are:
Definition at line 665 of file omniEventsLog.cc. Referenced by checkpoint(), and incarnateFactory(). |
|
Definition at line 406 of file omniEventsLog.cc. References _factory, and OmniEvents::EventChannelFactory_i::output(). Referenced by checkpoint(). |
|
Creates an initialState from the logfile. Used when the server is warm started. Aborts with an error if there is no logfile in the log directory. Definition at line 318 of file omniEventsLog.cc. References _activeFilename, _backupFilename, OmniEvents::PersistNode::attrLong(), OmniEvents::PersistNode::child(), and fileExists(). |
|
Kicks off the worker thread that periodically checkpoints the persistency logfile.
Definition at line 394 of file omniEventsLog.cc. References _factory, and _workerThread. |
|
Helper function that sets the value of the first parameter to the concatenation of all the subsequent parameters.
Definition at line 641 of file omniEventsLog.cc. Referenced by initializeFileNames(). |
|
Definition at line 203 of file omniEventsLog.h. |
|
Definition at line 195 of file omniEventsLog.h. Referenced by activeFilename(), checkpoint(), incarnateFactory(), initializeFileNames(), and parse(). |
|
Definition at line 196 of file omniEventsLog.h. Referenced by backupFilename(), checkpoint(), initializeFileNames(), and parse(). |
|
Definition at line 197 of file omniEventsLog.h. Referenced by checkpoint(), and initializeFileNames(). |
|
Definition at line 200 of file omniEventsLog.h. Referenced by checkpoint(). |
|
Definition at line 199 of file omniEventsLog.h. Referenced by factory(), incarnateFactory(), output(), and runWorker(). |
|
Definition at line 201 of file omniEventsLog.h. Referenced by checkpoint(). |
|
Definition at line 194 of file omniEventsLog.h. Referenced by checkpoint(), and incarnateFactory(). |
|
In charge of checkpoints.
Definition at line 198 of file omniEventsLog.h. Referenced by runWorker(). |
|
Definition at line 275 of file omniEventsLog.cc. |