STLdb

PrevUpHomeNext

Class template Logger

stldb::Logger

Synopsis

// In header: </Users/bobw/workspace/stldb_lib/stldb/logger.h>

template<typename void_alloc_t, typename mutex_type> 
class Logger {
public:
  // construct/copy/destruct
  Logger();
  ~Logger();

  // public member functions
  void set_shared_info(SharedLogInfo< void_alloc_t, mutex_type > *) ;
  void record_diskless_commit() ;
  log_stats get_stats(bool = false) ;
  transaction_id_t queue_for_commit(stldb::commit_buffer_t< void_alloc_t > *) ;
  void log(transaction_id_t) ;

  // private member functions
  void ensure_open_logfile() ;
};

Description

The logger is invoked when transactions are committing.

Logger public construct/copy/destruct

  1. Logger();
  2. ~Logger();

    Destructor closes this processes file handle to any open log file.

Logger public member functions

  1. void set_shared_info(SharedLogInfo< void_alloc_t, mutex_type > * log_info) ;

    Set the shared log info.

  2. void record_diskless_commit() ;
  3. log_stats get_stats(bool reset = false) ;
  4. transaction_id_t 
    queue_for_commit(stldb::commit_buffer_t< void_alloc_t > * buff) ;

    If there is no txn currently waiting for a shot at the log, then immediately grant the process access to the log. Otherwise, it joins the waiting list.

  5. void log(transaction_id_t my_commit_seq) ;

    Acquire the right to write to the log file, and then write data from the commit queue as necessary until out buffer has been written. Once the data has been written, optionally call sync() to wait for that data to make it out of OS memory and to the disk.

Logger private member functions

  1. void ensure_open_logfile() ;

    ensure that _logfd is referring to the correct (current) logfile, and that the logfile in question has not exceeded its maximum size. Caller holds _shm_info->file_mutex.


PrevUpHomeNext