#include <log_core.h>
|
| | log_core (const sm_options &) |
| |
| virtual | ~log_core () |
| |
| rc_t | init () |
| |
| rc_t | insert (logrec_t &r, lsn_t *l=nullptr) |
| |
| rc_t | flush (const lsn_t &lsn, bool block=true, bool signal=true, bool *ret_flushed=nullptr) |
| |
| rc_t | flush_all (bool block=true) |
| |
| rc_t | compensate (const lsn_t &orig_lsn, const lsn_t &undo_lsn) |
| |
| rc_t | fetch (lsn_t &lsn, void *buf, lsn_t *nxt, const bool forward) |
| |
| bool | fetch_direct (lsn_t lsn, logrec_t *&lr, lsn_t &prev_lsn) |
| |
| void | shutdown () |
| |
| rc_t | truncate () |
| |
| lsn_t | curr_lsn () const |
| |
| lsn_t | durable_lsn () const |
| |
| void | start_flush_daemon () |
| |
| long | segsize () const |
| |
| void | flush_daemon () |
| | Log-flush daemon driver. More...
|
| |
| lsn_t | flush_daemon_work (lsn_t old_mark) |
| | Flush unflushed-portion of log buffer. More...
|
| |
| rc_t | load_fetch_buffers () |
| |
| void | discard_fetch_buffers (partition_number_t recycled=std::numeric_limits< partition_number_t >::max()) |
| |
| string | make_log_name (uint32_t p) |
| |
| log_storage * | get_storage () |
| |
| PoorMansOldestLsnTracker * | get_oldest_lsn_tracker () |
| |
| lsn_t | get_oldest_active_lsn () |
| |
| unsigned | get_page_img_compression () |
| |
|
| char * | _buf |
| |
| vector< char * > | _fetch_buffers |
| |
| uint32_t | _fetch_buf_first |
| |
| uint32_t | _fetch_buf_last |
| |
| lsn_t | _fetch_buf_begin |
| |
| lsn_t | _fetch_buf_end |
| |
| shared_ptr< fetch_buffer_loader_t > | _fetch_buf_loader |
| |
| ticker_thread_t * | _ticker |
| |
| lsn_t | _curr_lsn |
| |
| lsn_t | _durable_lsn |
| |
| log_storage * | _storage |
| |
| PoorMansOldestLsnTracker * | _oldest_lsn_tracker |
| |
| long | _start |
| |
| long | _end |
| |
| long | _segsize |
| |
| lsn_t | _flush_lsn |
| |
| tatas_lock | _flush_lock |
| |
| tatas_lock | _comp_lock |
| |
| mcs_lock | _insert_lock |
| |
| pthread_mutex_t | _wait_flush_lock |
| |
| pthread_cond_t | _wait_cond |
| |
| pthread_cond_t | _flush_cond |
| |
| bool | _waiting_for_flush |
| |
| flush_daemon_thread_t * | _flush_daemon |
| |
| lintel::Atomic< bool > | _shutting_down |
| |
| lintel::Atomic< bool > | _flush_daemon_running |
| |
| ConsolidationArray * | _carray |
| |
| size_t | _group_commit_size |
| |
| stopwatch_t | _group_commit_timer |
| | Timer object to keep track of group commit timeout. More...
|
| |
| long | _group_commit_timeout |
| |
| unsigned | _page_img_compression |
| |
| bool | directIO |
| |
| epoch | _buf_epoch |
| |
| epoch | _cur_epoch |
| |
| epoch | _old_epoch |
| |
| void | _acquire_buffer_space (CArraySlot *info, long size) |
| |
| lsn_t | _copy_to_buffer (logrec_t &rec, long pos, long size, CArraySlot *info) |
| |
| bool | _update_epochs (CArraySlot *info) |
| |
| rc_t | _join_carray (CArraySlot *&info, long &pos, int32_t size) |
| |
| rc_t | _leave_carray (CArraySlot *info, int32_t size) |
| |
| void | _copy_raw (CArraySlot *info, long &pos, const char *data, size_t size) |
| |
§ anonymous enum
§ anonymous enum
§ log_core()
§ ~log_core()
§ _should_group_commit()
| bool log_core::_should_group_commit |
( |
unsigned long |
write_size | ) |
|
|
protected |
Returns true iff the given log write size, under the current group commit policy, qualifies for a log flush. If false, flush daemon will not flush its buffer but wait for the next invocation.
§ compensate()
| rc_t log_core::compensate |
( |
const lsn_t & |
orig_lsn, |
|
|
const lsn_t & |
undo_lsn |
|
) |
| |
§ curr_lsn()
| lsn_t log_core::curr_lsn |
( |
| ) |
const |
|
inline |
§ discard_fetch_buffers()
§ durable_lsn()
| lsn_t log_core::durable_lsn |
( |
| ) |
const |
|
inline |
§ end_byte()
| long log_core::end_byte |
( |
| ) |
const |
|
inlineprotected |
§ fetch()
| rc_t log_core::fetch |
( |
lsn_t & |
lsn, |
|
|
void * |
buf, |
|
|
lsn_t * |
nxt, |
|
|
const bool |
forward |
|
) |
| |
§ fetch_direct()
§ first_lsn()
| static lsn_t log_core::first_lsn |
( |
uint32_t |
pnum | ) |
|
|
inlinestatic |
§ flush()
| rc_t log_core::flush |
( |
const lsn_t & |
lsn, |
|
|
bool |
block = true, |
|
|
bool |
signal = true, |
|
|
bool * |
ret_flushed = nullptr |
|
) |
| |
§ flush_all()
| rc_t log_core::flush_all |
( |
bool |
block = true | ) |
|
|
inline |
§ flush_daemon()
| void log_core::flush_daemon |
( |
| ) |
|
Log-flush daemon driver.
This method handles the wait/block of the daemon thread, and when awake, calls its main-work method, flush_daemon_work.
§ flush_daemon_work()
| lsn_t log_core::flush_daemon_work |
( |
lsn_t |
old_mark | ) |
|
Flush unflushed-portion of log buffer.
- Parameters
-
| [in] | old_mark | Durable lsn from last flush. Flush records later than this. |
This is the guts of the log daemon.
Flush the log buffer of any log records later than old_mark. The argument indicates what is already durable and these log records must not be duplicated on the disk.
Called by the log flush daemon. Protection from duplicate flushing is handled by the fact that we have only one log flush daemon.
- Returns
- Latest durable lsn resulting from this flush
§ get_oldest_active_lsn()
| lsn_t log_core::get_oldest_active_lsn |
( |
| ) |
|
§ get_oldest_lsn_tracker()
§ get_page_img_compression()
| unsigned log_core::get_page_img_compression |
( |
| ) |
|
|
inline |
§ get_storage()
§ init()
§ insert()
§ load_fetch_buffers()
| rc_t log_core::load_fetch_buffers |
( |
| ) |
|
§ make_log_name()
| string log_core::make_log_name |
( |
uint32_t |
p | ) |
|
|
inline |
§ segsize()
| long log_core::segsize |
( |
| ) |
const |
|
inline |
§ shutdown()
| void log_core::shutdown |
( |
| ) |
|
§ start_byte()
| long log_core::start_byte |
( |
| ) |
const |
|
inlineprotected |
§ start_flush_daemon()
| void log_core::start_flush_daemon |
( |
| ) |
|
§ truncate()
| rc_t log_core::truncate |
( |
| ) |
|
Finish current log partition and start writing to a new one.
§ _buf
§ _comp_lock
§ _curr_lsn
| lsn_t log_core::_curr_lsn |
|
protected |
§ _durable_lsn
| lsn_t log_core::_durable_lsn |
|
protected |
§ _end
§ _fetch_buf_begin
| lsn_t log_core::_fetch_buf_begin |
|
protected |
§ _fetch_buf_end
| lsn_t log_core::_fetch_buf_end |
|
protected |
§ _fetch_buf_first
| uint32_t log_core::_fetch_buf_first |
|
protected |
§ _fetch_buf_last
| uint32_t log_core::_fetch_buf_last |
|
protected |
§ _fetch_buf_loader
§ _fetch_buffers
| vector<char*> log_core::_fetch_buffers |
|
protected |
Buffers for fetch operation – used during log analysis and single-page redo. One buffer is used for each partition. The number of partitions is specified by sm_log_fetch_buf_partitions
§ _flush_cond
| pthread_cond_t log_core::_flush_cond |
|
protected |
§ _flush_daemon
§ _flush_daemon_running
§ _flush_lsn
| lsn_t log_core::_flush_lsn |
|
protected |
§ _group_commit_size
| size_t log_core::_group_commit_size |
|
protected |
Group commit: only flush log if the given amount of unflushed bytes is available in the log buffer. This makes sure that all log writes are of at least this size, unless the group commit timeout expires (see below).
§ _group_commit_timeout
| long log_core::_group_commit_timeout |
|
protected |
Group commit timeout in miliseconds. The flush daemon will wait until the size above is reached before flushing. However, if it waits this long, it will flush whatever is in the log buffer, regardless of the write size.
§ _group_commit_timer
Timer object to keep track of group commit timeout.
§ _insert_lock
Lock to protect threads acquiring their log buffer.
§ _oldest_lsn_tracker
§ _page_img_compression
| unsigned log_core::_page_img_compression |
|
protected |
Enables page-image compression in the log. For every N bytes of log generated for a page, a page_img_format log record is generated rather than a log record describing that individual update. This makes recovery of that page more efficient by pruning the chain of log records that must be applied during redo. If set to zero, page-image compression is turned off.
§ _segsize
§ _shutting_down
- Todo:
- both of the below should become std::atomic_flag's at some time
§ _start
§ _storage
§ _ticker
§ _wait_cond
| pthread_cond_t log_core::_wait_cond |
|
protected |
§ _wait_flush_lock
| pthread_mutex_t log_core::_wait_flush_lock |
|
protected |
§ _waiting_for_flush
| bool log_core::_waiting_for_flush |
|
protected |
§ directIO
§ IMPL_NAME
| const std::string log_core::IMPL_NAME |
|
static |
The documentation for this class was generated from the following files: