MySQL 26.7.0
Source Code Documentation
ib::fil::Tablespaces_nodes_interface Class Referenceabstract

Manages low-level storage for Tablespaces. More...

#include <fil0tablespaces_nodes_interface.h>

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

Classes

struct  Capabilities
 
struct  Create_node_hints
 
struct  Node_hints
 
struct  Node_info
 Stored general information about the storage node at the time of calling the get_node_info(). More...
 

Public Types

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...
 

Public Member Functions

virtual ~Tablespaces_nodes_interface ()=default
 Performs any clean up. More...
 
virtual Capabilities get_capabilities ()=0
 Query the capabilities of the Page Service implementation. More...
 
virtual 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)=0
 Creates a low-level storage for a new tablespace node. More...
 
virtual 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)=0
 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...
 
virtual Status rename (space_id_t space_id, size_t node_order, const std::string &old_path, const std::string &new_path)=0
 Rename a tablespace file. More...
 
virtual Status remove (Tablespace_id space_id, size_t node_order, const Node_hints &hints)=0
 Deletes a specified tablespace's node storage by path. More...
 
virtual ut::Expected< Node_info, Node_errorget_node_info (Tablespace_id space_id, size_t node_order, const Node_hints &hints, size_t page_size)=0
 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...
 

Detailed Description

Manages low-level storage for Tablespaces.

Member Typedef Documentation

◆ Tablespace_id

Type used for giving the tablespaces unique number.

Member Enumeration Documentation

◆ Create_error

Enumerator
NODE_EXISTS 
FILE_NAME_TOO_LONG 
OUT_OF_DISK_SPACE 
IO_ERROR 
UNSUPPORTED 

◆ Node_error

Errors that can be returned while getting information about a node.

Enumerator
NODE_DOES_NOT_EXIST 

The specified node does not exist and the hinted path is free to be reserved by any new node.

NOT_A_NODE 

The specified node does not exist, but the hinted path is used by something that is not a node and can't be used to create a new node.

IO_ERROR 

A generic error occurred during the operation, the existence of the node could not be determined.

◆ Open_error

Enumerator
NODE_DOES_NOT_EXIST 
NO_ACCESS_PERMISSIONS 
IO_ERROR 

◆ Status

Enumerator
SUCCESS 
IO_ERROR 

Constructor & Destructor Documentation

◆ ~Tablespaces_nodes_interface()

virtual ib::fil::Tablespaces_nodes_interface::~Tablespaces_nodes_interface ( )
virtualdefault

Performs any clean up.

Member Function Documentation

◆ create()

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

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.

Implemented in ib::fil::Tablespaces_nodes.

◆ get_capabilities()

virtual Capabilities ib::fil::Tablespaces_nodes_interface::get_capabilities ( )
pure virtual

Query the capabilities of the Page Service implementation.

This function can be called even before start().

Returns
the capabilities of this Page Service implementation

Implemented in ib::fil::Tablespaces_nodes.

◆ get_node_info()

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

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.

Implemented in ib::fil::Tablespaces_nodes.

◆ open()

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

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.

Implemented in ib::fil::Tablespaces_nodes.

◆ remove()

virtual Status ib::fil::Tablespaces_nodes_interface::remove ( Tablespace_id  space_id,
size_t  node_order,
const Node_hints hints 
)
pure virtual

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.

Implemented in ib::fil::Tablespaces_nodes.

◆ rename()

virtual Status ib::fil::Tablespaces_nodes_interface::rename ( space_id_t  space_id,
size_t  node_order,
const std::string &  old_path,
const std::string &  new_path 
)
pure virtual

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

Implemented in ib::fil::Tablespaces_nodes.


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