MySQL 26.7.0
Source Code Documentation
fil0innodb_tablespaces_nodes.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 2026, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify it under
4the terms of the GNU General Public License, version 2.0, as published by the
5Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
18for more details.
19
20You should have received a copy of the GNU General Public License along with
21this program; if not, write to the Free Software Foundation, Inc.,
2251 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23*/
24
25#pragma once
26
29
30namespace ib::fil {
31
33 public:
34 Tablespaces_nodes() = default;
35
36 ~Tablespaces_nodes() override = default;
37
38 [[nodiscard]] Capabilities get_capabilities() override;
39
42 create(Tablespace_id space_id, size_t node_order,
43 const Create_node_hints &hints, uint32_t flags,
44 page_no_t size_in_pages) override;
45
48 open(Tablespace_id space_id, size_t node_order, const Node_hints &hints,
49 size_t page_size, bool for_read_only) override;
50
51 [[nodiscard]] Status remove(Tablespace_id space_id, size_t node_order,
52 const Node_hints &hints) override;
53
54 [[nodiscard]] Status rename(Tablespace_id space_id, size_t node_order,
55 const std::string &old_path,
56 const std::string &new_path) override;
58 Tablespace_id space_id, size_t node_order, const Node_hints &hints,
59 size_t page_size) override;
60
61 private:
62 /** Opens an UNDO tablespace using the supplied path in the @p hints.
63 @param[in] space_id Tablespace ID to open the node's storage for.
64 @param[in] hints Additional information that may be useful for
65 opening the node's storage, including path to
66 file.
67 @param[in] page_size Physical page size used in the tablespace,
68 must match one specified when creating the
69 tablespace.
70 @param[in] for_read_only True if the storage should be opened for
71 read-only access.
72 @return Pointer to handle to be used for accessing the node's storage if the
73 storage is opened successfully, error code otherwise. */
76 open_undo_tablespace(space_id_t space_id, const Node_hints &hints,
77 size_t page_size, bool for_read_only);
78};
79
80} /* namespace ib::fil */
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:49
uint32_t page_no_t
Page number.
Definition: api0api.h:47
Manages low-level storage for Tablespaces.
Definition: fil0tablespaces_nodes_interface.h:37
uint32_t Tablespace_id
Type used for giving the tablespaces unique number.
Definition: fil0tablespaces_nodes_interface.h:40
Open_error
Definition: fil0tablespaces_nodes_interface.h:111
Status
Definition: fil0tablespaces_nodes_interface.h:64
Create_error
Definition: fil0tablespaces_nodes_interface.h:66
Definition: fil0innodb_tablespaces_nodes.h:32
ut::Expected< Node_info, Node_error > get_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 no...
Definition: fil0innodb_tablespaces_nodes.cc:320
Capabilities get_capabilities() override
Query the capabilities of the Page Service implementation.
Definition: fil0innodb_tablespaces_nodes.cc:37
Status remove(Tablespace_id space_id, size_t node_order, const Node_hints &hints) override
Deletes a specified tablespace's node storage by path.
Definition: fil0innodb_tablespaces_nodes.cc:293
ut::Expected< ut::unique_ptr< Tablespace_node_handle_interface >, Open_error > open_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.
Definition: fil0innodb_tablespaces_nodes.cc:179
ut::Expected< ut::unique_ptr< Tablespace_node_handle_interface >, Open_error > open(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,...
Definition: fil0innodb_tablespaces_nodes.cc:209
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.
Definition: fil0innodb_tablespaces_nodes.cc:258
ut::Expected< ut::unique_ptr< Tablespace_node_handle_interface >, Create_error > create(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.
Definition: fil0innodb_tablespaces_nodes.cc:52
~Tablespaces_nodes() override=default
C++23 std::expected.
Definition: ut0expected.h:74
static int flags[50]
Definition: hp_test1.cc:40
Definition: fil0fil.cc:1392
Definition: fil0tablespaces_nodes_interface.h:48
Definition: fil0tablespaces_nodes_interface.h:86
Definition: fil0tablespaces_nodes_interface.h:76