MySQL 26.7.0
Source Code Documentation
ib::fil::Tablespaces_nodes Class Referencefinal

#include <fil0innodb_tablespaces_nodes.h>

Inheritance diagram for ib::fil::Tablespaces_nodes:
[legend]

Public Member Functions

 Tablespaces_nodes ()=default
 
 ~Tablespaces_nodes () override=default
 
Capabilities get_capabilities () override
 Query the capabilities of the Page Service implementation. More...
 
ut::Expected< ut::unique_ptr< Tablespace_node_handle_interface >, Create_errorcreate (Tablespace_id space_id, size_t node_order, const Create_node_hints &hints, uint32_t flags, page_no_t size_in_pages) override
 Creates a low-level storage for a new tablespace node. More...
 
ut::Expected< ut::unique_ptr< Tablespace_node_handle_interface >, Open_erroropen (Tablespace_id space_id, size_t node_order, const Node_hints &hints, size_t page_size, bool for_read_only) override
 Opens an existing tablespace's node storage by path, so it is ready to read and write pages, flush and extend the tablespace node. More...
 
Status remove (Tablespace_id space_id, size_t node_order, const Node_hints &hints) override
 Deletes a specified tablespace's node storage by path. More...
 
Status rename (Tablespace_id space_id, size_t node_order, const std::string &old_path, const std::string &new_path) override
 Rename a tablespace file. More...
 
ut::Expected< Node_info, Node_errorget_node_info (Tablespace_id space_id, size_t node_order, const Node_hints &hints, size_t page_size) override
 Gets basic information about the node specified, this includes its size (first page offset that is not available for reading and writing) and minimum block size for usage in transparent page compression. More...
 
- Public Member Functions inherited from ib::fil::Tablespaces_nodes_interface
virtual ~Tablespaces_nodes_interface ()=default
 Performs any clean up. More...
 

Private Member Functions

ut::Expected< ut::unique_ptr< Tablespace_node_handle_interface >, Open_erroropen_undo_tablespace (space_id_t space_id, const Node_hints &hints, size_t page_size, bool for_read_only)
 Opens an UNDO tablespace using the supplied path in the hints. More...
 

Additional Inherited Members

- Public Types inherited from ib::fil::Tablespaces_nodes_interface
enum class  Status { SUCCESS = 0 , IO_ERROR }
 
enum class  Create_error {
  NODE_EXISTS = 1 , FILE_NAME_TOO_LONG , OUT_OF_DISK_SPACE , IO_ERROR ,
  UNSUPPORTED
}
 
enum class  Open_error { NODE_DOES_NOT_EXIST = 1 , NO_ACCESS_PERMISSIONS , IO_ERROR }
 
enum class  Node_error { NODE_DOES_NOT_EXIST , NOT_A_NODE , IO_ERROR }
 Errors that can be returned while getting information about a node. More...
 
using Tablespace_id = uint32_t
 Type used for giving the tablespaces unique number. More...
 

Constructor & Destructor Documentation

◆ Tablespaces_nodes()

ib::fil::Tablespaces_nodes::Tablespaces_nodes ( )
default

◆ ~Tablespaces_nodes()

ib::fil::Tablespaces_nodes::~Tablespaces_nodes ( )
overridedefault

Member Function Documentation

◆ create()

ut::Expected< ut::unique_ptr< Tablespace_node_handle_interface >, Tablespaces_nodes_interface::Create_error > ib::fil::Tablespaces_nodes::create ( Tablespace_id  space_id,
size_t  node_order,
const Create_node_hints hints,
uint32_t  flags,
page_no_t  size_in_pages 
)
overridevirtual

Creates a low-level storage for a new tablespace node.

if storage 'path' already exists, it returns error TABLESPACE_EXISTS. To be used in fil_create_tablespace().

Parameters
[in]space_idTablespace ID to create the node's storage for.
[in]node_orderNumber of the node in the tablespace.
[in]hintsAdditional information that may be useful for creating the node's storage.
[in]flagsTablespace flags
[in]size_in_pagesInitial size of the tablespace node in pages, must be >= FIL_IBD_FILE_INITIAL_SIZE
Returns
Pointer to handle to be used for accessing the node's storage if the storage is created successfully, error code otherwise.

Implements ib::fil::Tablespaces_nodes_interface.

◆ get_capabilities()

Tablespaces_nodes::Capabilities ib::fil::Tablespaces_nodes::get_capabilities ( )
overridevirtual

Query the capabilities of the Page Service implementation.

This function can be called even before start().

Returns
the capabilities of this Page Service implementation

Implements ib::fil::Tablespaces_nodes_interface.

◆ get_node_info()

ut::Expected< Tablespaces_nodes_interface::Node_info, Tablespaces_nodes_interface::Node_error > ib::fil::Tablespaces_nodes::get_node_info ( Tablespace_id  space_id,
size_t  node_order,
const Node_hints hints,
size_t  page_size 
)
overridevirtual

Gets basic information about the node specified, this includes its size (first page offset that is not available for reading and writing) and minimum block size for usage in transparent page compression.

If Node_hints::m_check_permissions is true, currently available access modes are also checked; otherwise Node_info::access_permissions is not reliable. The node may not exist, or the path specified may lead to a non-file object or the operation may encounter any other problem in which case a suitable Node_error will be returned.

Parameters
[in]space_idTablespace ID. It can be SPACE_UNKNOWN to check if the path specified in hints exists and get all info but the size of node in pages.
[in]node_orderNumber of the node in the tablespace.
[in]hintsAdditional information that may be useful for querying the node's storage.
[in]page_sizePhysical page size used in the tablespace, must match one specified when creating the tablespace. However, if the space_id is SPACE_UNKNOWN or we are not interested in the node size, a value of 0 can be specified. In such case, the returned Node_info::size will be 0.

Implements ib::fil::Tablespaces_nodes_interface.

◆ open()

ut::Expected< ut::unique_ptr< Tablespace_node_handle_interface >, Tablespaces_nodes_interface::Open_error > ib::fil::Tablespaces_nodes::open ( Tablespace_id  space_id,
size_t  node_order,
const Node_hints hints,
size_t  page_size,
bool  for_read_only 
)
overridevirtual

Opens an existing tablespace's node storage by path, so it is ready to read and write pages, flush and extend the tablespace node.

The tablespace must not be opened at the time of this call. To be used in fil_node_t::open().

Parameters
[in]space_idTablespace ID to open the node's storage for.
[in]node_orderNumber of the node in the tablespace.
[in]hintsAdditional information that may be useful for opening the node's storage.
[in]page_sizePhysical page size used in the tablespace, must match one specified when creating the tablespace.
[in]for_read_onlyTrue if the storage should be opened for read-only access.
Returns
Pointer to handle to be used for accessing the node's storage if the storage is opened successfully, error code otherwise.

Implements ib::fil::Tablespaces_nodes_interface.

◆ open_undo_tablespace()

ut::Expected< ut::unique_ptr< Tablespace_node_handle_interface >, Tablespaces_nodes_interface::Open_error > ib::fil::Tablespaces_nodes::open_undo_tablespace ( space_id_t  space_id,
const Node_hints hints,
size_t  page_size,
bool  for_read_only 
)
private

Opens an UNDO tablespace using the supplied path in the hints.

Parameters
[in]space_idTablespace ID to open the node's storage for.
[in]hintsAdditional information that may be useful for opening the node's storage, including path to file.
[in]page_sizePhysical page size used in the tablespace, must match one specified when creating the tablespace.
[in]for_read_onlyTrue if the storage should be opened for read-only access.
Returns
Pointer to handle to be used for accessing the node's storage if the storage is opened successfully, error code otherwise.

◆ remove()

Tablespaces_nodes::Status ib::fil::Tablespaces_nodes::remove ( Tablespace_id  space_id,
size_t  node_order,
const Node_hints hints 
)
overridevirtual

Deletes a specified tablespace's node storage by path.

To be used in Fil_shard::space_delete().

Parameters
[in]space_idTablespace ID
[in]node_orderNumber of the node in the tablespace.
[in]hintsAdditional information that may be useful for removing the node's storage.
Returns
Status::SUCCESS if tablespace storage is removed successfully, error code otherwise.

Implements ib::fil::Tablespaces_nodes_interface.

◆ rename()

Tablespaces_nodes::Status ib::fil::Tablespaces_nodes::rename ( Tablespace_id  space_id,
size_t  node_order,
const std::string &  old_path,
const std::string &  new_path 
)
overridevirtual

Rename a tablespace file.

Parameters
[in]space_idtablespace_id
[in]node_orderNumber of the node in the tablespace.
[in]old_pathold name of the file
[in]new_pathnew name of the file
Returns
SUCCESS if renames successfully, error code otherwise

Implements ib::fil::Tablespaces_nodes_interface.


The documentation for this class was generated from the following files: