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