stldb::log_reader
// In header: </Users/bobw/workspace/stldb_lib/stldb/log_reader.h> class log_reader { public: // construct/copy/destruct log_reader(const char *); ~log_reader(); // public member functions void close() ; transaction_id_t seek_transaction(transaction_id_t) ; transaction_id_t next_transaction() ; std::pair< log_header *, std::vector< char > * > get_transaction() ; // private member functions transaction_id_t read_next_txn() ; };
log_reader
public member functionsvoid close() ;Closes any open log file.
transaction_id_t seek_transaction(transaction_id_t lsn) ;
Reads the log file until finding the first LSN which is equal to or greater than the LSN passed. Returns the transaction_id which if found. Returns no_transaction if the EOF is reached prior to finding an eligible transaction. throws if an error is encountered with the content of the log file.
transaction_id_t next_transaction() ;
Reads the next transaction from the log file. Returns the transaction_id which is found. Returns no_transaction if the EOF is reached. throws if an error is encountered with the content of the log file.
std::pair< log_header *, std::vector< char > * > get_transaction() ;
Returns the header and data buffer of the last transacton read from disk via a call to seekTransacton() or nextTransaction(). The returned pointers are only valid until the next call to either of those methods.