MySQL 8.0.39
Source Code Documentation
partition_index.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__PARTITION_INDEX_INCLUDED
25#define DD__PARTITION_INDEX_INCLUDED
26
27#include "sql/dd/sdi_fwd.h" // dd::Sdi_wcontext
28#include "sql/dd/types/index.h" // dd::Index
29#include "sql/dd/types/weak_object.h" // dd::Weak_object
30
31namespace dd {
32
33///////////////////////////////////////////////////////////////////////////
34
35class Index;
36class Partition;
37class Partition_index_impl;
38class Properties;
39class Tablespace;
40
41namespace tables {
42class Index_partitions;
43}
44
45///////////////////////////////////////////////////////////////////////////
46
47class Partition_index : virtual public Weak_object {
48 public:
51
52 public:
53 ~Partition_index() override = default;
54
55 /////////////////////////////////////////////////////////////////////////
56 // Partition.
57 /////////////////////////////////////////////////////////////////////////
58
59 virtual const Partition &partition() const = 0;
60
61 virtual Partition &partition() = 0;
62
63 /////////////////////////////////////////////////////////////////////////
64 // Index.
65 /////////////////////////////////////////////////////////////////////////
66
67 virtual const Index &index() const = 0;
68
69 virtual Index &index() = 0;
70
71 const String_type &name() const { return index().name(); }
72
73 /////////////////////////////////////////////////////////////////////////
74 // Options.
75 /////////////////////////////////////////////////////////////////////////
76
77 virtual const Properties &options() const = 0;
78
79 virtual Properties &options() = 0;
80 virtual bool set_options(const Properties &options) = 0;
81 virtual bool set_options(const String_type &options_raw) = 0;
82
83 /////////////////////////////////////////////////////////////////////////
84 // se_private_data.
85 /////////////////////////////////////////////////////////////////////////
86
87 virtual const Properties &se_private_data() const = 0;
88
90 virtual bool set_se_private_data(const String_type &se_private_data_raw) = 0;
91
93
94 /////////////////////////////////////////////////////////////////////////
95 // Tablespace.
96 /////////////////////////////////////////////////////////////////////////
97
98 virtual Object_id tablespace_id() const = 0;
100
101 /**
102 Converts *this into json.
103
104 Converts all member variables that are to be included in the sdi
105 into json by transforming them appropriately and passing them to
106 the rapidjson writer provided.
107
108 @param wctx opaque context for data needed by serialization
109 @param w rapidjson writer which will perform conversion to json
110
111 */
112
113 virtual void serialize(Sdi_wcontext *wctx, Sdi_writer *w) const = 0;
114
115 /**
116 Re-establishes the state of *this by reading sdi information from
117 the rapidjson DOM subobject provided.
118
119 Cross-references encountered within this object are tracked in
120 sdictx, so that they can be updated when the entire object graph
121 has been established.
122
123 @param rctx stores book-keeping information for the
124 deserialization process
125 @param val subobject of rapidjson DOM containing json
126 representation of this object
127 */
128
129 virtual bool deserialize(Sdi_rcontext *rctx, const RJ_Value &val) = 0;
130};
131
132///////////////////////////////////////////////////////////////////////////
133
134} // namespace dd
135
136#endif // DD__PARTITION_INDEX_INCLUDED
Data structure that contains the information about shared tablespaces.
Definition: fsp0space.h:47
virtual const String_type & name() const =0
Definition: index.h:51
Definition: partition_index_impl.h:57
Definition: partition_index.h:47
virtual bool set_options(const String_type &options_raw)=0
virtual void set_tablespace_id(Object_id tablespace_id)=0
virtual const Index & index() const =0
const String_type & name() const
Definition: partition_index.h:71
virtual bool set_se_private_data(const String_type &se_private_data_raw)=0
~Partition_index() override=default
virtual const Partition & partition() const =0
virtual const Properties & se_private_data() const =0
Partition_index_impl Impl
Definition: partition_index.h:49
virtual void serialize(Sdi_wcontext *wctx, Sdi_writer *w) const =0
Converts *this into json.
virtual const Properties & options() const =0
virtual Properties & options()=0
virtual Partition & partition()=0
virtual bool set_se_private_data(const Properties &se_private_data)=0
virtual Object_id tablespace_id() const =0
tables::Index_partitions DD_table
Definition: partition_index.h:50
virtual Index & index()=0
virtual bool set_options(const Properties &options)=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...
virtual Properties & se_private_data()=0
Definition: partition.h:51
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
Base class for all data dictionary objects.
Definition: weak_object.h:42
Definition: index_partitions.h:38
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
unsigned long long Object_id
Definition: object_id.h:31
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
Definition: options.cc:49
This header provides Rapidjson Type Aliases.