MySQL 9.1.0
Source Code Documentation
|
It is a environment for tests of redo log. More...
#include <log0test.h>
Classes | |
struct | Page |
class | Sync_point |
Public Types | |
enum class | Options { VALIDATE_RECENT_CLOSED = 1 , VALIDATE_RECENT_WRITTEN = 2 } |
typedef page_no_t | Key |
typedef int64_t | Value |
typedef std::map< Key, Page > | Pages |
typedef std::map< std::string, std::unique_ptr< Sync_point > > | Sync_points |
Public Member Functions | |
lsn_t | oldest_modification_approx () const |
Calculates oldest_modification of the earliest added dirty page during the test in log0log-t. More... | |
void | add_dirty_page (const Page &page) |
void | fsync_written_pages () |
void | purge (lsn_t max_dirty_page_age) |
const byte * | parse_mlog_rec (const byte *begin, const byte *end) |
const Pages & | flushed () const |
const Pages & | recovered () const |
void | sync_point (const std::string &sync_point_name) |
void | register_sync_point_handler (const std::string &sync_point_name, std::unique_ptr< Sync_point > &&sync_point_handler) |
bool | enabled (Options option) const |
void | set_enabled (Options option, bool enabled) |
int | flush_every () const |
void | set_flush_every (int flush_every) |
int | verbosity () const |
void | set_verbosity (int level) |
Static Public Member Functions | |
static byte * | create_mlog_rec (byte *rec, Key key, Value value, size_t payload) |
static byte * | create_mlog_rec (byte *rec, Key key, Value value) |
static const byte * | parse_mlog_rec (const byte *begin, const byte *end, Key &key, Value &value, lsn_t &start_lsn, lsn_t &end_lsn) |
Private Member Functions | |
void | recovered_reset (Key key, lsn_t oldest_modification, lsn_t newest_modification) |
void | recovered_add (Key key, Value value, lsn_t oldest_modification, lsn_t newest_modification) |
Private Attributes | |
std::mutex | m_mutex |
std::mutex | m_purge_mutex |
std::map< lsn_t, Page > | m_buf |
Pages | m_written |
Pages | m_flushed |
Pages | m_recovered |
Sync_points | m_sync_points |
uint64_t | m_options_enabled = 0 |
int | m_verbosity = 0 |
int | m_flush_every = 10 |
It is a environment for tests of redo log.
It contains a mock, which replaces real buffer pool during the test.
typedef page_no_t Log_test::Key |
typedef std::map<Key, Page> Log_test::Pages |
typedef std::map<std::string, std::unique_ptr<Sync_point> > Log_test::Sync_points |
typedef int64_t Log_test::Value |
|
strong |
void Log_test::add_dirty_page | ( | const Page & | page | ) |
bool Log_test::enabled | ( | Options | option | ) | const |
int Log_test::flush_every | ( | ) | const |
const Log_test::Pages & Log_test::flushed | ( | ) | const |
void Log_test::fsync_written_pages | ( | ) |
lsn_t Log_test::oldest_modification_approx | ( | ) | const |
Calculates oldest_modification of the earliest added dirty page during the test in log0log-t.
It is basically a replacement for the log_buf_get_oldest_modification_approx() during the test.
|
static |
void Log_test::purge | ( | lsn_t | max_dirty_page_age | ) |
const Log_test::Pages & Log_test::recovered | ( | ) | const |
|
private |
|
private |
void Log_test::register_sync_point_handler | ( | const std::string & | sync_point_name, |
std::unique_ptr< Sync_point > && | sync_point_handler | ||
) |
void Log_test::set_enabled | ( | Options | option, |
bool | enabled | ||
) |
void Log_test::set_flush_every | ( | int | flush_every | ) |
void Log_test::set_verbosity | ( | int | level | ) |
void Log_test::sync_point | ( | const std::string & | sync_point_name | ) |
int Log_test::verbosity | ( | ) | const |
|
private |
|
private |
|
mutableprivate |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |