MySQL 8.0.33
Source Code Documentation
persistent_dynamic_loader.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2023, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, 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*/
40BEGIN_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*/
59DECLARE_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*/
80 (void *thd, const char *urns[], int component_count));
81END_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:307
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:111