MySQL 8.0.40
Source Code Documentation
persistent_dynamic_loader.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_PERSISTENT_DYNAMIC_LOADER_H
25#define MYSQL_PERSISTENT_DYNAMIC_LOADER_H
26
28
29/**
30 Service for managing the list of loaded Components. It assures the list to be
31 persisted in MySQL table.
32
33 This service breaks a little a concept of having only simple types
34 as arguments. This possibly could be improved further into process of making
35 more system parts implemented as proper components. Once we have a way to
36 access (system) tables through services, this would not be needed and
37 persistent dynamic loader could be another implementation of dynamic_loader
38 service. Also, the THD parameter could be replaced by getting the value of
39 the current_thd.
40*/
41BEGIN_SERVICE_DEFINITION(persistent_dynamic_loader)
42/**
43 Loads specified group of components by URN, initializes them and
44 registers all service implementations present in these components.
45 Assures all dependencies will be met after loading specified components.
46 The dependencies may be circular, in such case it's necessary to specify
47 all components on cycle to load in one batch. From URNs specified the
48 scheme part of URN (part before "://") is extracted and used to acquire
49 service implementation of scheme component loader service for specified
50 scheme. If the loading process successes then a group of Components by their
51 URN is added to the component table.
52
53 @param thd Current thread execution context.
54 @param urns List of URNs of Components to load.
55 @param component_count Number of Components on list to load.
56 @return Status of performed operation
57 @retval false success
58 @retval true failure
59*/
60DECLARE_BOOL_METHOD(load, (void *thd, const char *urns[], int component_count));
61/**
62 Unloads specified group of Components by URN, deinitializes them and
63 unregisters all service implementations present in these components.
64 Assumes, although does not check it, all dependencies of not unloaded
65 components will still be met after unloading specified components.
66 The dependencies may be circular, in such case it's necessary to specify
67 all components on cycle to unload in one batch. From URNs specified the
68 scheme part of URN (part before "://") is extracted and used to acquire
69 service implementation of scheme component loader service for specified
70 scheme. If the unloading process successes then a group of Components by
71 their URN is added to the component table.
72
73 @param thd Current thread execution context.
74 @param urns List of URNs of components to unload.
75 @param component_count Number of components on list to unload.
76 @return Status of performed operation
77 @retval false success
78 @retval true failure
79*/
81 (void *thd, const char *urns[], int component_count));
82END_SERVICE_DEFINITION(persistent_dynamic_loader)
83
84#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:308
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112