MySQL 9.1.0
Source Code Documentation
fut0lst.h File Reference

File-based list utilities. More...

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

Go to the source code of this file.

Classes

struct  flst_bnode_t
 In-memory representation of flst_base_node_t. More...
 

Namespaces

namespace  bulk
 Used for bulk load of data.
 

Typedefs

typedef byte flst_base_node_t
 
typedef byte flst_node_t
 

Functions

static void flst_init (flst_base_node_t *base, mtr_t *mtr)
 Initializes a list base node. More...
 
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. More...
 
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. More...
 
void flst_remove (flst_base_node_t *base, flst_node_t *node2, mtr_t *mtr)
 Removes a node. More...
 
static ulint flst_get_len (const flst_base_node_t *base)
 Get the length of a list. More...
 
static fil_addr_t flst_get_first (const flst_base_node_t *base, mtr_t *mtr)
 Gets list first node address. More...
 
static fil_addr_t flst_get_last (const flst_base_node_t *base, mtr_t *mtr)
 Gets list last node address. More...
 
static fil_addr_t flst_get_next_addr (const flst_node_t *node, mtr_t *mtr)
 Gets list next node address. More...
 
static fil_addr_t flst_get_prev_addr (const flst_node_t *node, mtr_t *mtr)
 Gets list prev node address. More...
 
static void flst_write_addr (fil_faddr_t *faddr, fil_addr_t addr, mtr_t *mtr)
 Writes a file address. More...
 
static fil_addr_t flst_read_addr (const fil_faddr_t *faddr, mtr_t *mtr)
 Reads a file address. More...
 
void flst_validate (const flst_base_node_t *base, mtr_t *mtr1)
 Validates a file-based list. More...
 
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. More...
 
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. More...
 
std::ostream & operator<< (std::ostream &out, const flst_bnode_t &obj)
 
void bulk::flst_init (flst_base_node_t *base)
 Initializes a list base node. More...
 
void bulk::flst_insert_after (flst_base_node_t *base, flst_node_t *node1, flst_node_t *node2, std::vector< buf_block_t * > &blocks)
 Inserts a node after another in a list. More...
 
void bulk::flst_write_addr (fil_faddr_t *faddr, fil_addr_t addr)
 Writes a file address. More...
 
void bulk::flst_add_last (flst_base_node_t *base, flst_node_t *node, std::vector< buf_block_t * > &blocks)
 Adds a node as the last node in a list. More...
 
fil_addr_t bulk::flst_get_first (const flst_base_node_t *base)
 Gets list first node address. More...
 
fil_addr_t bulk::flst_get_prev_addr (const flst_node_t *node)
 Gets list prev node address. More...
 
fil_addr_t bulk::flst_get_next_addr (const flst_node_t *node)
 Gets list next node address. More...
 
fil_addr_t bulk::flst_read_addr (const fil_faddr_t *faddr)
 Reads a file address. More...
 
void bulk::flst_remove (flst_base_node_t *base, flst_node_t *node2, std::vector< buf_block_t * > &blocks)
 Bulk load version. More...
 
bytebulk::fut_get_ptr (fil_addr_t addr, std::vector< buf_block_t * > &blocks)
 Gets a pointer to a file address. More...
 
fil_addr_t bulk::flst_get_last (const flst_base_node_t *base)
 Gets list last node address. More...
 

Variables

constexpr ulint FLST_BASE_NODE_SIZE = 4 + 2 * FIL_ADDR_SIZE
 
constexpr ulint FLST_NODE_SIZE = 2 * FIL_ADDR_SIZE
 

Detailed Description

File-based list utilities.

Created 11/28/1995 Heikki Tuuri

Typedef Documentation

◆ flst_base_node_t

◆ flst_node_t

typedef byte flst_node_t

Function Documentation

◆ flst_add_first()

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.

Parameters
[in]basePointer to base node of list
[in]nodeNode to add
[in]mtrMini-transaction handle

◆ flst_add_last()

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.

Parameters
[in]basePointer to base node of list
[in]nodeNode to add
[in]mtrMini-transaction handle

◆ flst_get_first()

static fil_addr_t flst_get_first ( const flst_base_node_t base,
mtr_t mtr 
)
inlinestatic

Gets list first node address.

Parameters
[in]basePointer to base node
[in]mtrMini-transaction handle
Returns
file address

◆ flst_get_last()

static fil_addr_t flst_get_last ( const flst_base_node_t base,
mtr_t mtr 
)
inlinestatic

Gets list last node address.

Parameters
[in]basePointer to base node
[in]mtrMini-transaction handle
Returns
file address

◆ flst_get_len()

static ulint flst_get_len ( const flst_base_node_t base)
inlinestatic

Get the length of a list.

Parameters
[in]basebase node
Returns
length

◆ flst_get_next_addr()

static fil_addr_t flst_get_next_addr ( const flst_node_t node,
mtr_t mtr 
)
inlinestatic

Gets list next node address.

Parameters
[in]nodePointer to node
[in]mtrMini-transaction handle
Returns
file address

◆ flst_get_prev_addr()

static fil_addr_t flst_get_prev_addr ( const flst_node_t node,
mtr_t mtr 
)
inlinestatic

Gets list prev node address.

Parameters
[in]nodePointer to node
[in]mtrMini-transaction handle
Returns
file address

◆ flst_init()

static void flst_init ( flst_base_node_t base,
mtr_t mtr 
)
inlinestatic

Initializes a list base node.

Parameters
[in]basePointer to base node
[in]mtrMini-transaction handle

◆ flst_insert_after()

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.

Parameters
[in]basePointer to base node of list
[in]node1Node to insert after
[in]node2Node to add
[in]mtrMini-transaction handle.

in: mini-transaction handle

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

◆ flst_insert_before()

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.

Parameters
[in]basePointer to base node of list
[in]node2Node to insert
[in]node3Node to insert before
[in]mtrMini-transaction handle.

in: mini-transaction handle

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

◆ flst_read_addr()

static fil_addr_t flst_read_addr ( const fil_faddr_t faddr,
mtr_t mtr 
)
inlinestatic

Reads a file address.

Parameters
[in]faddrPointer to file faddress
[in]mtrMini-transaction handle
Returns
file address

◆ flst_remove()

void flst_remove ( flst_base_node_t base,
flst_node_t node2,
mtr_t mtr 
)

Removes a node.

Parameters
[in]basePointer to base node of list
[in]node2Node to remove
[in]mtrMini-transaction handle

◆ flst_validate()

void flst_validate ( const flst_base_node_t base,
mtr_t mtr1 
)

Validates a file-based list.

Parameters
[in]basepointer to base node of list
[in]mtr1mtr

◆ flst_write_addr()

static void flst_write_addr ( fil_faddr_t faddr,
fil_addr_t  addr,
mtr_t mtr 
)
inlinestatic

Writes a file address.

Parameters
[in]faddrPointer to file faddress
[in]addrFile address
[in]mtrMini-transaction handle

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const flst_bnode_t obj 
)
inline

Variable Documentation

◆ FLST_BASE_NODE_SIZE

constexpr ulint FLST_BASE_NODE_SIZE = 4 + 2 * FIL_ADDR_SIZE
constexpr

◆ FLST_NODE_SIZE

constexpr ulint FLST_NODE_SIZE = 2 * FIL_ADDR_SIZE
constexpr