Drizzled Public API Documentation

fut0lst.h File Reference
#include "univ.i"
#include "fil0fil.h"
#include "mtr0mtr.h"
#include "fut0lst.ic"

Go to the source code of this file.

Defines

#define FLST_BASE_NODE_SIZE   (4 + 2 * FIL_ADDR_SIZE)
#define FLST_NODE_SIZE   (2 * FIL_ADDR_SIZE)

Typedefs

typedef byte flst_base_node_t
typedef byte flst_node_t

Functions

UNIV_INLINE void flst_init (flst_base_node_t *base, mtr_t *mtr)
UNIV_INTERN void flst_add_last (flst_base_node_t *base, flst_node_t *node, mtr_t *mtr)
UNIV_INTERN void flst_add_first (flst_base_node_t *base, flst_node_t *node, mtr_t *mtr)
UNIV_INTERN void flst_insert_after (flst_base_node_t *base, flst_node_t *node1, flst_node_t *node2, mtr_t *mtr)
UNIV_INTERN void flst_insert_before (flst_base_node_t *base, flst_node_t *node2, flst_node_t *node3, mtr_t *mtr)
UNIV_INTERN void flst_remove (flst_base_node_t *base, flst_node_t *node2, mtr_t *mtr)
UNIV_INTERN void flst_cut_end (flst_base_node_t *base, flst_node_t *node2, ulint n_nodes, mtr_t *mtr)
UNIV_INTERN void flst_truncate_end (flst_base_node_t *base, flst_node_t *node2, ulint n_nodes, mtr_t *mtr)
UNIV_INLINE ulint flst_get_len (const flst_base_node_t *base, mtr_t *mtr)
UNIV_INLINE fil_addr_t flst_get_first (const flst_base_node_t *base, mtr_t *mtr)
UNIV_INLINE fil_addr_t flst_get_last (const flst_base_node_t *base, mtr_t *mtr)
UNIV_INLINE fil_addr_t flst_get_next_addr (const flst_node_t *node, mtr_t *mtr)
UNIV_INLINE fil_addr_t flst_get_prev_addr (const flst_node_t *node, mtr_t *mtr)
UNIV_INLINE void flst_write_addr (fil_faddr_t *faddr, fil_addr_t addr, mtr_t *mtr)
UNIV_INLINE fil_addr_t flst_read_addr (const fil_faddr_t *faddr, mtr_t *mtr)
UNIV_INTERN ibool flst_validate (const flst_base_node_t *base, mtr_t *mtr1)
UNIV_INTERN void flst_print (const flst_base_node_t *base, mtr_t *mtr)

Detailed Description

File-based list utilities

Created 11/28/1995 Heikki Tuuri

Definition in file fut0lst.h.


Function Documentation

UNIV_INTERN void flst_add_first ( flst_base_node_t *  base,
flst_node_t *  node,
mtr_t mtr 
)

Adds a node as the first node in a list. in: mini-transaction handle

Adds a node as the first node in a list.

Parameters:
basein: pointer to base node of list
nodein: node to add
mtrin: mini-transaction handle

Definition at line 118 of file fut0lst.cc.

References fil_addr_struct::boffset, buf_ptr_get_fsp_addr(), flst_get_first(), flst_get_len(), fut_get_ptr(), fil_addr_struct::page, page_align(), and ut_ad.

UNIV_INTERN void flst_add_last ( flst_base_node_t *  base,
flst_node_t *  node,
mtr_t mtr 
)

Adds a node as the last node in a list. in: mini-transaction handle

Adds a node as the last node in a list.

Parameters:
basein: pointer to base node of list
nodein: node to add
mtrin: mini-transaction handle

Definition at line 75 of file fut0lst.cc.

References fil_addr_struct::boffset, buf_ptr_get_fsp_addr(), flst_get_last(), flst_get_len(), fut_get_ptr(), fil_addr_struct::page, page_align(), and ut_ad.

UNIV_INTERN void flst_cut_end ( flst_base_node_t *  base,
flst_node_t *  node2,
ulint  n_nodes,
mtr_t mtr 
)

Cuts off the tail of the list, including the node given. The number of nodes which will be removed must be provided by the caller, as this function does not measure the length of the tail. in: mini-transaction handle

Cuts off the tail of the list, including the node given. The number of nodes which will be removed must be provided by the caller, as this function does not measure the length of the tail.

Parameters:
basein: pointer to base node of list
node2in: first node to remove
n_nodesin: number of nodes to remove, must be >= 1
mtrin: mini-transaction handle

Definition at line 347 of file fut0lst.cc.

References fil_addr_struct::boffset, buf_ptr_get_fsp_addr(), flst_get_len(), flst_get_prev_addr(), flst_write_addr(), fut_get_ptr(), MLOG_4BYTES, mlog_write_ulint(), fil_addr_struct::page, page_align(), and ut_ad.

UNIV_INLINE fil_addr_t flst_get_first ( const flst_base_node_t *  base,
mtr_t mtr 
)

Gets list first node address.

Returns:
file address in: mini-transaction handle
Parameters:
basein: pointer to base node

Referenced by flst_add_first(), flst_validate(), fsp_print(), and fsp_validate().

UNIV_INLINE fil_addr_t flst_get_last ( const flst_base_node_t *  base,
mtr_t mtr 
)

Gets list last node address.

Returns:
file address in: mini-transaction handle
Parameters:
basein: pointer to base node

Referenced by flst_add_last(), and flst_validate().

UNIV_INLINE ulint flst_get_len ( const flst_base_node_t *  base,
mtr_t mtr 
)
UNIV_INLINE fil_addr_t flst_get_next_addr ( const flst_node_t *  node,
mtr_t mtr 
)

Gets list next node address.

Returns:
file address in: mini-transaction handle
Parameters:
nodein: pointer to node

Referenced by flst_insert_after(), flst_remove(), flst_truncate_end(), flst_validate(), fsp_print(), and fsp_validate().

UNIV_INLINE fil_addr_t flst_get_prev_addr ( const flst_node_t *  node,
mtr_t mtr 
)

Gets list prev node address.

Returns:
file address in: mini-transaction handle
Parameters:
nodein: pointer to node

Referenced by flst_cut_end(), flst_insert_before(), flst_remove(), and flst_validate().

UNIV_INLINE void flst_init ( flst_base_node_t *  base,
mtr_t mtr 
)

Initializes a list base node. in: mini-transaction handle

Parameters:
basein: pointer to base node

Referenced by btr_create(), fseg_create_general(), fsp_header_init(), and trx_rseg_header_create().

UNIV_INTERN void flst_insert_after ( flst_base_node_t *  base,
flst_node_t *  node1,
flst_node_t *  node2,
mtr_t mtr 
)

Inserts a node after another in a list. in: mini-transaction handle

Inserts a node after another in a list.

Parameters:
basein: pointer to base node of list
node1in: node to insert after
node2in: node to add
mtrin: mini-transaction handle

Definition at line 161 of file fut0lst.cc.

References buf_ptr_get_fsp_addr(), flst_get_len(), flst_get_next_addr(), flst_write_addr(), fut_get_ptr(), MLOG_4BYTES, mlog_write_ulint(), and ut_ad.

UNIV_INTERN void flst_insert_before ( flst_base_node_t *  base,
flst_node_t *  node2,
flst_node_t *  node3,
mtr_t mtr 
)

Inserts a node before another in a list. in: mini-transaction handle

Inserts a node before another in a list.

Parameters:
basein: pointer to base node of list
node2in: node to insert
node3in: node to insert before
mtrin: mini-transaction handle

Definition at line 216 of file fut0lst.cc.

References buf_ptr_get_fsp_addr(), flst_get_len(), flst_get_prev_addr(), flst_write_addr(), fut_get_ptr(), MLOG_4BYTES, mlog_write_ulint(), and ut_ad.

UNIV_INTERN void flst_print ( const flst_base_node_t *  base,
mtr_t mtr 
)

Prints info of a file-based list. in: mtr

Prints info of a file-based list.

Parameters:
basein: pointer to base node of list
mtrin: mtr

Definition at line 510 of file fut0lst.cc.

References flst_get_len(), page_align(), page_get_page_no(), page_get_space_id(), page_offset(), and ut_ad.

UNIV_INLINE fil_addr_t flst_read_addr ( const fil_faddr_t faddr,
mtr_t mtr 
)

Reads a file address.

Returns:
file address in: mini-transaction handle
Parameters:
faddrin: pointer to file faddress
UNIV_INTERN void flst_remove ( flst_base_node_t *  base,
flst_node_t *  node2,
mtr_t mtr 
)

Removes a node. in: mini-transaction handle

Removes a node.

Parameters:
basein: pointer to base node of list
node2in: node to remove
mtrin: mini-transaction handle

Definition at line 270 of file fut0lst.cc.

References fil_addr_struct::boffset, buf_ptr_get_fsp_addr(), flst_get_len(), flst_get_next_addr(), flst_get_prev_addr(), flst_write_addr(), fut_get_ptr(), MLOG_4BYTES, mlog_write_ulint(), fil_addr_struct::page, page_align(), and ut_ad.

UNIV_INTERN void flst_truncate_end ( flst_base_node_t *  base,
flst_node_t *  node2,
ulint  n_nodes,
mtr_t mtr 
)

Cuts off the tail of the list, not including the given node. The number of nodes which will be removed must be provided by the caller, as this function does not measure the length of the tail. in: mini-transaction handle

Cuts off the tail of the list, not including the given node. The number of nodes which will be removed must be provided by the caller, as this function does not measure the length of the tail.

Parameters:
basein: pointer to base node of list
node2in: first node not to remove
n_nodesin: number of nodes to remove
mtrin: mini-transaction handle

Definition at line 404 of file fut0lst.cc.

References buf_ptr_get_fsp_addr(), flst_get_len(), flst_get_next_addr(), flst_write_addr(), MLOG_4BYTES, mlog_write_ulint(), and ut_ad.

UNIV_INTERN ibool flst_validate ( const flst_base_node_t *  base,
mtr_t mtr1 
)

Validates a file-based list.

Returns:
TRUE if ok in: mtr

Validates a file-based list.

Returns:
TRUE if ok
Parameters:
basein: pointer to base node of list
mtr1in: mtr

Definition at line 444 of file fut0lst.cc.

References buf_ptr_get_fsp_addr(), flst_get_first(), flst_get_last(), flst_get_len(), flst_get_next_addr(), flst_get_prev_addr(), fut_get_ptr(), mtr_commit(), mtr_start(), ut_a, and ut_ad.

UNIV_INLINE void flst_write_addr ( fil_faddr_t faddr,
fil_addr_t  addr,
mtr_t mtr 
)

Writes a file address. in: mini-transaction handle

Parameters:
faddrin: pointer to file faddress
addrin: file address

Referenced by flst_cut_end(), flst_insert_after(), flst_insert_before(), flst_remove(), and flst_truncate_end().