InnoDB Plugin
1.0
|
Data Structures | |
struct | buf_chunk_t |
Functions | |
UNIV_INLINE ulint | buf_pool_get_curr_size (void) |
UNIV_INLINE ulint | buf_pool_index (const buf_pool_t *buf_pool) |
UNIV_INLINE buf_pool_t * | buf_pool_from_bpage (const buf_page_t *bpage) |
UNIV_INLINE buf_pool_t * | buf_pool_from_block (const buf_block_t *block) |
UNIV_INLINE ulint | buf_pool_get_n_pages (void) |
UNIV_INLINE ulint | buf_page_get_freed_page_clock (const buf_page_t *bpage) |
UNIV_INLINE ulint | buf_block_get_freed_page_clock (const buf_block_t *block) |
UNIV_INLINE ibool | buf_page_peek_if_young (const buf_page_t *bpage) |
UNIV_INLINE ibool | buf_page_peek_if_too_old (const buf_page_t *bpage) |
UNIV_INLINE enum buf_page_state | buf_page_get_state (const buf_page_t *bpage) |
UNIV_INLINE enum buf_page_state | buf_block_get_state (const buf_block_t *block) |
UNIV_INLINE void | buf_page_set_state (buf_page_t *bpage, enum buf_page_state state) |
UNIV_INLINE void | buf_block_set_state (buf_block_t *block, enum buf_page_state state) |
UNIV_INLINE ibool | buf_page_in_file (const buf_page_t *bpage) |
UNIV_INLINE ibool | buf_page_belongs_to_unzip_LRU (const buf_page_t *bpage) |
UNIV_INLINE ib_mutex_t * | buf_page_get_mutex (const buf_page_t *bpage) |
UNIV_INLINE buf_flush_t | buf_page_get_flush_type (const buf_page_t *bpage) |
UNIV_INLINE void | buf_page_set_flush_type (buf_page_t *bpage, buf_flush_t flush_type) |
UNIV_INLINE void | buf_block_set_file_page (buf_block_t *block, ulint space, ulint page_no) |
UNIV_INLINE enum buf_io_fix | buf_page_get_io_fix (const buf_page_t *bpage) |
UNIV_INLINE enum buf_io_fix | buf_block_get_io_fix (const buf_block_t *block) |
UNIV_INLINE void | buf_page_set_io_fix (buf_page_t *bpage, enum buf_io_fix io_fix) |
UNIV_INLINE void | buf_block_set_io_fix (buf_block_t *block, enum buf_io_fix io_fix) |
UNIV_INLINE void | buf_page_set_sticky (buf_page_t *bpage) |
UNIV_INLINE void | buf_page_unset_sticky (buf_page_t *bpage) |
UNIV_INLINE ibool | buf_page_can_relocate (const buf_page_t *bpage) |
UNIV_INLINE ibool | buf_page_is_old (const buf_page_t *bpage) |
UNIV_INLINE void | buf_page_set_old (buf_page_t *bpage, ibool old) |
UNIV_INLINE unsigned | buf_page_is_accessed (const buf_page_t *bpage) |
UNIV_INLINE void | buf_page_set_accessed (buf_page_t *bpage) |
UNIV_INLINE buf_block_t * | buf_page_get_block (buf_page_t *bpage) |
UNIV_INLINE buf_frame_t * | buf_block_get_frame (const buf_block_t *block) |
UNIV_INLINE ulint | buf_page_get_space (const buf_page_t *bpage) |
UNIV_INLINE ulint | buf_block_get_space (const buf_block_t *block) |
UNIV_INLINE ulint | buf_page_get_page_no (const buf_page_t *bpage) |
UNIV_INLINE buf_frame_t * | buf_frame_align (byte *ptr) |
UNIV_INLINE ulint | buf_block_get_page_no (const buf_block_t *block) |
UNIV_INLINE ulint | buf_page_get_zip_size (const buf_page_t *bpage) |
UNIV_INLINE ulint | buf_block_get_zip_size (const buf_block_t *block) |
UNIV_INLINE const page_zip_des_t * | buf_frame_get_page_zip (const byte *ptr) |
UNIV_INLINE void | buf_ptr_get_fsp_addr (const void *ptr, ulint *space, fil_addr_t *addr) |
UNIV_INLINE ulint | buf_block_get_lock_hash_val (const buf_block_t *block) |
UNIV_INLINE buf_page_t * | buf_page_alloc_descriptor (void) |
UNIV_INLINE void | buf_page_free_descriptor (buf_page_t *bpage) |
UNIV_INLINE void | buf_block_free (buf_block_t *block) |
UNIV_INLINE byte * | buf_frame_copy (byte *buf, const buf_frame_t *frame) |
UNIV_INLINE ulint | buf_page_address_fold (ulint space, ulint offset) |
UNIV_INLINE lsn_t | buf_page_get_newest_modification (const buf_page_t *bpage) |
UNIV_INLINE void | buf_block_modify_clock_inc (buf_block_t *block) |
UNIV_INLINE ib_uint64_t | buf_block_get_modify_clock (buf_block_t *block) |
UNIV_INLINE void | buf_block_fix (buf_block_t *block) |
UNIV_INLINE void | buf_block_buf_fix_inc_func (const char *file, ulint line, buf_block_t *block) |
UNIV_INLINE void | buf_block_unfix (buf_block_t *block) |
UNIV_INLINE void | buf_block_buf_fix_dec (buf_block_t *block) |
UNIV_INLINE buf_pool_t * | buf_pool_get (ulint space, ulint offset) |
UNIV_INLINE buf_pool_t * | buf_pool_from_array (ulint index) |
UNIV_INLINE buf_page_t * | buf_page_hash_get_low (buf_pool_t *buf_pool, ulint space, ulint offset, ulint fold) |
UNIV_INLINE buf_page_t * | buf_page_hash_get_locked (buf_pool_t *buf_pool, ulint space, ulint offset, rw_lock_t **lock, ulint lock_mode, bool watch) |
UNIV_INLINE buf_block_t * | buf_block_hash_get_locked (buf_pool_t *buf_pool, ulint space, ulint offset, rw_lock_t **lock, ulint lock_mode) |
UNIV_INLINE ibool | buf_page_peek (ulint space, ulint offset) |
UNIV_INLINE void | buf_page_release_zip (buf_page_t *bpage) |
UNIV_INLINE void | buf_page_release (buf_block_t *block, ulint rw_latch) |
UNIV_INLINE void | buf_block_dbg_add_level (buf_block_t *block, ulint level) |
UNIV_INLINE void | buf_pool_mutex_enter_all (void) |
UNIV_INLINE void | buf_pool_mutex_exit_all (void) |
UNIV_INLINE buf_block_t * | buf_get_nth_chunk_block (const buf_pool_t *buf_pool, ulint n, ulint *chunk_size) |
The database buffer buf_pool
Created 11/5/1995 Heikki Tuuri
UNIV_INLINE void buf_block_buf_fix_dec | ( | buf_block_t * | block | ) |
Decrements the bufferfix count.
block | in/out: block to bufferunfix |
UNIV_INLINE void buf_block_buf_fix_inc_func | ( | const char * | file, |
ulint | line, | ||
buf_block_t * | block | ||
) |
Increments the bufferfix count.
file | in: file name |
line | in: line |
block | in/out: block to bufferfix |
UNIV_INLINE void buf_block_dbg_add_level | ( | buf_block_t * | block, |
ulint | level | ||
) |
Adds latch level info for the rw-lock protecting the buffer frame. This should be called in the debug version after a successful latching of a page if we know the latching order level of the acquired latch.
block | in: buffer page where we have acquired latch |
level | in: latching order level |
UNIV_INLINE void buf_block_fix | ( | buf_block_t * | block | ) |
Increments the bufferfix count.
block | in/out: block to bufferfix |
UNIV_INLINE void buf_block_free | ( | buf_block_t * | block | ) |
Frees a buffer block which does not contain a file page.
block | in, own: block to be freed |
UNIV_INLINE buf_frame_t* buf_block_get_frame | ( | const buf_block_t * | block | ) |
Gets a pointer to the memory frame of a block.
block | in: pointer to the control block |
UNIV_INLINE ulint buf_block_get_freed_page_clock | ( | const buf_block_t * | block | ) |
Reads the freed_page_clock of a buffer block.
block | in: block |
UNIV_INLINE enum buf_io_fix buf_block_get_io_fix | ( | const buf_block_t * | block | ) |
Gets the io_fix state of a block.
block | in: pointer to the control block |
UNIV_INLINE ulint buf_block_get_lock_hash_val | ( | const buf_block_t * | block | ) |
Gets the hash value of the page the pointer is pointing to. This can be used in searches in the lock hash table.
block | in: block |
UNIV_INLINE ib_uint64_t buf_block_get_modify_clock | ( | buf_block_t * | block | ) |
Returns the value of the modify clock. The caller must have an s-lock or x-lock on the block.
block | in: block |
UNIV_INLINE ulint buf_block_get_page_no | ( | const buf_block_t * | block | ) |
Gets the page number of a block.
block | in: pointer to the control block |
UNIV_INLINE ulint buf_block_get_space | ( | const buf_block_t * | block | ) |
Gets the space id of a block.
block | in: pointer to the control block |
UNIV_INLINE enum buf_page_state buf_block_get_state | ( | const buf_block_t * | block | ) |
Gets the state of a block.
block | in: pointer to the control block |
UNIV_INLINE ulint buf_block_get_zip_size | ( | const buf_block_t * | block | ) |
Gets the compressed page size of a block.
block | in: pointer to the control block |
UNIV_INLINE buf_block_t* buf_block_hash_get_locked | ( | buf_pool_t * | buf_pool, |
ulint | space, | ||
ulint | offset, | ||
rw_lock_t ** | lock, | ||
ulint | lock_mode | ||
) |
Returns the control block of a file page, NULL if not found. If the block is found and lock is not NULL then the appropriate page_hash lock is acquired in the specified lock mode. Otherwise, mode value is ignored. It is up to the caller to release the lock. If the block is found and the lock is NULL then the page_hash lock is released by this function.
buf_pool | out: pointer to the bpage, or NULL; if NULL, hash_lock is also NULL. buffer pool instance |
space | in: space id |
offset | in: page number |
lock | in/out: lock of the page hash acquired if bpage is found. NULL otherwise. If NULL is passed then the hash_lock is released by this function |
lock_mode | in: RW_LOCK_EX or RW_LOCK_SHARED. Ignored if lock == NULL |
UNIV_INLINE void buf_block_modify_clock_inc | ( | buf_block_t * | block | ) |
Increments the modify clock of a frame by 1. The caller must (1) own the buf_pool mutex and block bufferfix count has to be zero, (2) or own an x-lock on the block.
block | in: block |
UNIV_INLINE void buf_block_set_file_page | ( | buf_block_t * | block, |
ulint | space, | ||
ulint | page_no | ||
) |
Map a block to a file page.
block | in/out: pointer to control block |
space | in: tablespace id |
page_no | in: page number |
UNIV_INLINE void buf_block_set_io_fix | ( | buf_block_t * | block, |
enum buf_io_fix | io_fix | ||
) |
Sets the io_fix state of a block.
block | in/out: control block |
io_fix | in: io_fix state |
UNIV_INLINE void buf_block_set_state | ( | buf_block_t * | block, |
enum buf_page_state | state | ||
) |
Sets the state of a block.
block | in/out: pointer to control block |
state | in: state |
UNIV_INLINE void buf_block_unfix | ( | buf_block_t * | block | ) |
Decrements the bufferfix count.
block | in/out: block to bufferunfix |
UNIV_INLINE byte* buf_frame_copy | ( | byte * | buf, |
const buf_frame_t * | frame | ||
) |
Copies contents of a buffer frame to a given buffer.
buf | in: buffer to copy to |
frame | in: buffer frame |
UNIV_INLINE const page_zip_des_t* buf_frame_get_page_zip | ( | const byte * | ptr | ) |
Gets the compressed page descriptor corresponding to an uncompressed page if applicable.
ptr | in: pointer to the page |
UNIV_INLINE buf_block_t* buf_get_nth_chunk_block | ( | const buf_pool_t * | buf_pool, |
ulint | n, | ||
ulint * | chunk_size | ||
) |
Get the nth chunk's buffer block in the specified buffer pool.
buf_pool | in: buffer pool instance |
n | in: nth chunk in the buffer pool |
chunk_size | in: chunk size |
UNIV_INLINE ulint buf_page_address_fold | ( | ulint | space, |
ulint | offset | ||
) |
Calculates a folded value of a file page address to use in the page hash table.
space | in: space id |
offset | in: offset of the page within space |
UNIV_INLINE buf_page_t* buf_page_alloc_descriptor | ( | void | ) |
Allocates a buf_page_t descriptor. This function must succeed. In case of failure we assert in this function.
UNIV_INLINE ibool buf_page_belongs_to_unzip_LRU | ( | const buf_page_t * | bpage | ) |
Determines if a block should be on unzip_LRU list.
bpage | in: pointer to control block |
UNIV_INLINE ibool buf_page_can_relocate | ( | const buf_page_t * | bpage | ) |
Determine if a buffer block can be relocated in memory. The block can be dirty, but it must not be I/O-fixed or bufferfixed.
bpage | control block being relocated |
UNIV_INLINE void buf_page_free_descriptor | ( | buf_page_t * | bpage | ) |
Free a buf_page_t descriptor.
bpage | in: bpage descriptor to free. |
UNIV_INLINE buf_block_t* buf_page_get_block | ( | buf_page_t * | bpage | ) |
Gets the buf_block_t handle of a buffered file block if an uncompressed page frame exists, or NULL.
bpage | in: control block, or NULL |
UNIV_INLINE buf_flush_t buf_page_get_flush_type | ( | const buf_page_t * | bpage | ) |
Get the flush type of a page.
bpage | in: buffer page |
UNIV_INLINE ulint buf_page_get_freed_page_clock | ( | const buf_page_t * | bpage | ) |
Reads the freed_page_clock of a buffer block.
bpage | in: block |
UNIV_INLINE enum buf_io_fix buf_page_get_io_fix | ( | const buf_page_t * | bpage | ) |
Gets the io_fix state of a block.
bpage | in: pointer to the control block |
UNIV_INLINE ib_mutex_t* buf_page_get_mutex | ( | const buf_page_t * | bpage | ) |
Gets the mutex of a block.
bpage | in: pointer to control block |
UNIV_INLINE lsn_t buf_page_get_newest_modification | ( | const buf_page_t * | bpage | ) |
Gets the youngest modification log sequence number for a frame. Returns zero if not file page or no modification occurred yet.
bpage | in: block containing the page frame |
UNIV_INLINE ulint buf_page_get_page_no | ( | const buf_page_t * | bpage | ) |
Gets the page number of a block.
bpage | in: pointer to the control block |
UNIV_INLINE ulint buf_page_get_space | ( | const buf_page_t * | bpage | ) |
Gets the space id of a block.
bpage | in: pointer to the control block |
UNIV_INLINE enum buf_page_state buf_page_get_state | ( | const buf_page_t * | bpage | ) |
Gets the state of a block.
bpage | in: pointer to the control block |
UNIV_INLINE ulint buf_page_get_zip_size | ( | const buf_page_t * | bpage | ) |
Gets the compressed page size of a block.
bpage | in: pointer to the control block |
UNIV_INLINE buf_page_t* buf_page_hash_get_locked | ( | buf_pool_t * | buf_pool, |
ulint | space, | ||
ulint | offset, | ||
rw_lock_t ** | lock, | ||
ulint | lock_mode, | ||
bool | watch | ||
) |
Returns the control block of a file page, NULL if not found. If the block is found and lock is not NULL then the appropriate page_hash lock is acquired in the specified lock mode. Otherwise, mode value is ignored. It is up to the caller to release the lock. If the block is found and the lock is NULL then the page_hash lock is released by this function.
buf_pool | out: pointer to the bpage, or NULL; if NULL, hash_lock is also NULL. buffer pool instance |
space | in: space id |
offset | in: page number |
lock | in/out: lock of the page hash acquired if bpage is found. NULL otherwise. If NULL is passed then the hash_lock is released by this function |
lock_mode | in: RW_LOCK_EX or RW_LOCK_SHARED. Ignored if lock == NULL |
watch | in: if true, return watch sentinel also. |
UNIV_INLINE buf_page_t* buf_page_hash_get_low | ( | buf_pool_t * | buf_pool, |
ulint | space, | ||
ulint | offset, | ||
ulint | fold | ||
) |
Returns the control block of a file page, NULL if not found.
buf_pool | buffer pool instance |
space | in: space id |
offset | in: offset of the page within space |
fold | in: buf_page_address_fold(space, offset) |
UNIV_INLINE ibool buf_page_in_file | ( | const buf_page_t * | bpage | ) |
Determines if a block is mapped to a tablespace.
bpage | in: pointer to control block |
UNIV_INLINE unsigned buf_page_is_accessed | ( | const buf_page_t * | bpage | ) |
Determine the time of first access of a block in the buffer pool.
bpage | in: control block |
UNIV_INLINE ibool buf_page_is_old | ( | const buf_page_t * | bpage | ) |
Determine if a block has been flagged old.
bpage | in: control block |
UNIV_INLINE ibool buf_page_peek | ( | ulint | space, |
ulint | offset | ||
) |
Returns TRUE if the page can be found in the buffer pool hash table.
NOTE that it is possible that the page is not yet read from disk, though.
space | in: space id |
offset | in: page number |
UNIV_INLINE ibool buf_page_peek_if_too_old | ( | const buf_page_t * | bpage | ) |
Recommends a move of a block to the start of the LRU list if there is danger of dropping from the buffer pool. NOTE: does not reserve the buffer pool mutex.
bpage | in: block to make younger |
UNIV_INLINE ibool buf_page_peek_if_young | ( | const buf_page_t * | bpage | ) |
Tells if a block is still close enough to the MRU end of the LRU list meaning that it is not in danger of getting evicted and also implying that it has been accessed recently. Note that this is for heuristics only and does not reserve buffer pool mutex.
bpage | in: block |
UNIV_INLINE void buf_page_release | ( | buf_block_t * | block, |
ulint | rw_latch | ||
) |
Decrements the bufferfix count of a buffer control block and releases a latch, if specified.
block | in: buffer block |
rw_latch | in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH |
UNIV_INLINE void buf_page_release_zip | ( | buf_page_t * | bpage | ) |
Releases a compressed-only page acquired with buf_page_get_zip().
bpage | in: buffer block |
UNIV_INLINE void buf_page_set_accessed | ( | buf_page_t * | bpage | ) |
Flag a block accessed.
bpage | in/out: control block |
UNIV_INLINE void buf_page_set_flush_type | ( | buf_page_t * | bpage, |
buf_flush_t | flush_type | ||
) |
Set the flush type of a page.
bpage | in: buffer page |
flush_type | in: flush type |
UNIV_INLINE void buf_page_set_io_fix | ( | buf_page_t * | bpage, |
enum buf_io_fix | io_fix | ||
) |
Sets the io_fix state of a block.
bpage | in/out: control block |
io_fix | in: io_fix state |
UNIV_INLINE void buf_page_set_old | ( | buf_page_t * | bpage, |
ibool | old | ||
) |
Flag a block old.
bpage | in/out: control block |
old | in: old |
UNIV_INLINE void buf_page_set_state | ( | buf_page_t * | bpage, |
enum buf_page_state | state | ||
) |
Sets the state of a block.
bpage | in/out: pointer to control block |
state | in: state |
UNIV_INLINE void buf_page_set_sticky | ( | buf_page_t * | bpage | ) |
Makes a block sticky. A sticky block implies that even after we release the buf_pool->mutex and the block->mutex: it cannot be removed from the flush_list the block descriptor cannot be relocated it cannot be removed from the LRU list Note that: the block can still change its position in the LRU list the next and previous pointers can change.
bpage | in/out: control block |
UNIV_INLINE void buf_page_unset_sticky | ( | buf_page_t * | bpage | ) |
Removes stickiness of a block.
bpage | in/out: control block |
UNIV_INLINE buf_pool_t* buf_pool_from_array | ( | ulint | index | ) |
Returns the buffer pool instance given its array index
index | in: array index to get buffer pool instance from |
UNIV_INLINE buf_pool_t* buf_pool_from_block | ( | const buf_block_t * | block | ) |
Returns the buffer pool instance given a block instance
block | in: block |
UNIV_INLINE buf_pool_t* buf_pool_from_bpage | ( | const buf_page_t * | bpage | ) |
Returns the buffer pool instance given a page instance
bpage | in: buffer pool page |
UNIV_INLINE buf_pool_t* buf_pool_get | ( | ulint | space, |
ulint | offset | ||
) |
Returns the buffer pool instance given space and offset of page
space | in: space id |
offset | in: offset of the page within space |
UNIV_INLINE ulint buf_pool_get_curr_size | ( | void | ) |
Gets the current size of buffer buf_pool in bytes.
UNIV_INLINE ulint buf_pool_get_n_pages | ( | void | ) |
Gets the current size of buffer buf_pool in pages.
UNIV_INLINE ulint buf_pool_index | ( | const buf_pool_t * | buf_pool | ) |
Calculates the index of a buffer pool to the buf_pool[] array.
buf_pool | in: buffer pool |
UNIV_INLINE void buf_pool_mutex_enter_all | ( | void | ) |
Acquire mutex on all buffer pool instances.
UNIV_INLINE void buf_pool_mutex_exit_all | ( | void | ) |
Release mutex on all buffer pool instances.
UNIV_INLINE void buf_ptr_get_fsp_addr | ( | const void * | ptr, |
ulint * | space, | ||
fil_addr_t * | addr | ||
) |
Gets the space id, page offset, and byte offset within page of a pointer pointing to a buffer frame containing a file page.
ptr | in: pointer to a buffer frame |
space | out: space id |
addr | out: page offset and byte offset |