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