MySQL 8.4.0
Source Code Documentation
tablespace_file.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef DD__TABLESPACE_FILES_INCLUDED
25#define DD__TABLESPACE_FILES_INCLUDED
26
27#include "my_inttypes.h"
28#include "sql/dd/sdi_fwd.h" // dd::Sdi_wcontext
29#include "sql/dd/types/weak_object.h" // dd::Weak_object
30
31namespace dd {
32
33///////////////////////////////////////////////////////////////////////////
34
35class Properties;
36class Tablespace;
37class Tablespace_file_impl;
38
39namespace tables {
41}
42
43///////////////////////////////////////////////////////////////////////////
44
45class Tablespace_file : virtual public Weak_object {
46 public:
49
50 public:
51 ~Tablespace_file() override = default;
52
53 /////////////////////////////////////////////////////////////////////////
54 // ordinal_position.
55 /////////////////////////////////////////////////////////////////////////
56
57 virtual uint ordinal_position() const = 0;
58
59 /////////////////////////////////////////////////////////////////////////
60 // filename.
61 /////////////////////////////////////////////////////////////////////////
62
63 virtual const String_type &filename() const = 0;
64 virtual void set_filename(const String_type &filename) = 0;
65
66 /////////////////////////////////////////////////////////////////////////
67 // se_private_data.
68 /////////////////////////////////////////////////////////////////////////
69
70 virtual const Properties &se_private_data() const = 0;
71
73 virtual bool set_se_private_data(const String_type &se_private_data_raw) = 0;
74
75 /////////////////////////////////////////////////////////////////////////
76 // tablespace.
77 /////////////////////////////////////////////////////////////////////////
78
79 virtual const Tablespace &tablespace() const = 0;
80
81 virtual Tablespace &tablespace() = 0;
82
83 /**
84 Converts *this into json.
85
86 Converts all member variables that are to be included in the sdi
87 into json by transforming them appropriately and passing them to
88 the rapidjson writer provided.
89
90 @param wctx opaque context for data needed by serialization
91 @param w rapidjson writer which will perform conversion to json
92
93 */
94
95 virtual void serialize(Sdi_wcontext *wctx, Sdi_writer *w) const = 0;
96
97 /**
98 Re-establishes the state of *this by reading sdi information from
99 the rapidjson DOM subobject provided.
100
101 Cross-references encountered within this object are tracked in
102 sdictx, so that they can be updated when the entire object graph
103 has been established.
104
105 @param rctx stores book-keeping information for the
106 deserialization process
107 @param val subobject of rapidjson DOM containing json
108 representation of this object
109 */
110
111 virtual bool deserialize(Sdi_rcontext *rctx, const RJ_Value &val) = 0;
112};
113
114///////////////////////////////////////////////////////////////////////////
115
116} // namespace dd
117
118#endif // DD__TABLESPACE_FILES_INCLUDED
Tablespace files discovered during startup.
Definition: fil0fil.cc:374
Data structure that contains the information about shared tablespaces.
Definition: fsp0space.h:47
The Properties class defines an interface for storing key=value pairs, where both key and value may b...
Definition: properties.h:74
Opaque context which keeps reusable resoureces needed during deserialization.
Definition: sdi.cc:231
Opaque context which keeps reusable resources needed during serialization.
Definition: sdi.cc:129
Definition: tablespace_file_impl.h:53
Definition: tablespace_file.h:45
virtual const Properties & se_private_data() const =0
Tablespace_file_impl Impl
Definition: tablespace_file.h:47
virtual Tablespace & tablespace()=0
virtual void set_filename(const String_type &filename)=0
virtual const String_type & filename() const =0
virtual uint ordinal_position() const =0
tables::Tablespace_files DD_table
Definition: tablespace_file.h:48
virtual const Tablespace & tablespace() const =0
~Tablespace_file() override=default
virtual void serialize(Sdi_wcontext *wctx, Sdi_writer *w) const =0
Converts *this into json.
virtual bool deserialize(Sdi_rcontext *rctx, const RJ_Value &val)=0
Re-establishes the state of *this by reading sdi information from the rapidjson DOM subobject provide...
virtual bool set_se_private_data(const String_type &se_private_data_raw)=0
virtual Properties & se_private_data()=0
Definition: tablespace.h:56
Base class for all data dictionary objects.
Definition: weak_object.h:42
Definition: tablespace_files.h:38
Some integer typedefs for easier portability.
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
RJ_Writer Sdi_writer
Alias for the rapidjson Writer type to use in serialization.
Definition: sdi_fwd.h:64
rapidjson::GenericValue< RJ_Encoding, RJ_Allocator > RJ_Value
Definition: sdi_fwd.h:49
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
This header provides Rapidjson Type Aliases.