MySQL  8.0.17
Source Code Documentation
persistent_dynamic_loader.h
Go to the documentation of this file.
1 /* Copyright (c) 2016, 2019, 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 MYSQL_PERSISTENT_DYNAMIC_LOADER_H
24 #define MYSQL_PERSISTENT_DYNAMIC_LOADER_H
25 
27 
28 /**
29  Service for managing the list of loaded Components. It assures the list to be
30  persisted in MySQL table.
31 
32  This service breaks a little a concept of having only simple types
33  as arguments. This possibly could be improved further into process of making
34  more system parts implemented as proper components. Once we have a way to
35  access (system) tables through services, this would not be needed and
36  persistent dynamic loader could be another implementation of dynamic_loader
37  service. Also, the THD parameter could be replaced by getting the value of
38  the current_thd.
39 */
40 BEGIN_SERVICE_DEFINITION(persistent_dynamic_loader)
41 /**
42  Loads specified group of components by URN, initializes them and
43  registers all service implementations present in these components.
44  Assures all dependencies will be met after loading specified components.
45  The dependencies may be circular, in such case it's necessary to specify
46  all components on cycle to load in one batch. From URNs specified the
47  scheme part of URN (part before "://") is extracted and used to acquire
48  service implementation of scheme component loader service for specified
49  scheme. If the loading process successes then a group of Components by their
50  URN is added to the component table.
51 
52  @param thd Current thread execution context.
53  @param urns List of URNs of Components to load.
54  @param component_count Number of Components on list to load.
55  @return Status of performed operation
56  @retval false success
57  @retval true failure
58 */
59 DECLARE_BOOL_METHOD(load, (void *thd, const char *urns[], int component_count));
60 /**
61  Unloads specified group of Components by URN, deinitializes them and
62  unregisters all service implementations present in these components.
63  Assumes, although does not check it, all dependencies of not unloaded
64  components will still be met after unloading specified components.
65  The dependencies may be circular, in such case it's necessary to specify
66  all components on cycle to unload in one batch. From URNs specified the
67  scheme part of URN (part before "://") is extracted and used to acquire
68  service implementation of scheme component loader service for specified
69  scheme. If the unloading process successes then a group of Components by
70  their URN is added to the component table.
71 
72  @param thd Current thread execution context.
73  @param urns List of URNs of components to unload.
74  @param component_count Number of components on list to unload.
75  @return Status of performed operation
76  @retval false success
77  @retval true failure
78 */
79 DECLARE_BOOL_METHOD(unload,
80  (void *thd, const char *urns[], int component_count));
81 END_SERVICE_DEFINITION(persistent_dynamic_loader)
82 
83 #endif /* MYSQL_PERSISTENT_DYNAMIC_LOADER_H */
bool load(THD *, const dd::String_type &fname, dd::String_type *buf)
Read an sdi file from disk and store in a buffer.
Definition: sdi_file.cc:306
#define DECLARE_BOOL_METHOD(name, args)
#define BEGIN_SERVICE_DEFINITION(name)
#define END_SERVICE_DEFINITION(name)