Allows to wrap another Service Implementation of the Dynamic Loader service and add ability to store a list of groups of loaded components.
More...
|
static bool | init (void *thdp) |
| Initializes persistence store, loads all groups of components registered in component table. More...
|
|
static void | deinit () |
| De-initializes persistence loader. More...
|
|
static bool | initialized () |
| Initialisation status of persistence loader. More...
|
|
static mysql_service_status_t | load (void *thd_ptr, const char *urns[], int component_count) noexcept |
| Loads specified group of components by URN, initializes them and registers all service implementations present in these components. More...
|
|
static mysql_service_status_t | unload (void *thd_ptr, const char *urns[], int component_count) noexcept |
| Unloads specified group of Components by URN, deinitializes them and unregisters all service implementations present in these components. More...
|
|
static int | remove_from_cache (const char *urns[], int component_count) |
| Removes the entries from the in-memory cache. More...
|
|
Allows to wrap another Service Implementation of the Dynamic Loader service and add ability to store a list of groups of loaded components.
It reacts on successful invocations of the underlying Dynamic Loader Service Implementation methods load() and unload() and saves changes. It also loads during the start of the MySQL Server all groups of the Components that were still loaded on last MySQL Server shutdown, they are loaded in order of the original loads. It assumes that components does not any not fully-deterministic loads of another Components, which would break dependencies if they are decided to load other Components than last time. The list of groups of Components is stored in the 'mysql.component' table. It is valid to unload only part of the group of the previously loaded group of Components. In such a situation, as long as all dependencies are met, which is assured by the underlying Service Implementation, the rest of Components in group should load successfully after the MySQL Server restart.
bool mysql_persistent_dynamic_loader_imp::init |
( |
void * |
thdp | ) |
|
|
static |
Initializes persistence store, loads all groups of components registered in component table.
Shouldn't be called multiple times. We assume the order specified by group ID is correct one. This should be assured by dynamic loader as long as it will not allow to unload the component that has dependency on, in case there would be a possibility to switch that dependency to other component that is not to be unloaded. If this is assured, then it will not be possible for components with lower group IDs to have a dependency on component with higher group ID, even after state is restored in this initialization method.
- Parameters
-
thdp | Current thread execution context |
- Returns
- Status of performed operation
- Return values
-
mysql_service_status_t mysql_persistent_dynamic_loader_imp::unload |
( |
void * |
thd_ptr, |
|
|
const char * |
urns[], |
|
|
int |
component_count |
|
) |
| |
|
staticnoexcept |
Unloads specified group of Components by URN, deinitializes them and unregisters all service implementations present in these components.
Assumes, although does not check it, all dependencies of not unloaded components will still be met after unloading specified components. The dependencies may be circular, in such case it's necessary to specify all components on cycle to unload in one batch. From URNs specified the scheme part of URN (part before "://") is extracted and used to acquire service implementation of scheme component loader service for specified scheme. URN specified should be identical to ones specified in load() method, i.e. all letters must have the same case. If the unloading process successes then a group of Components by their URN is added to the component table.
- Parameters
-
thd_ptr | Current thread execution context. |
urns | List of URNs of components to unload. |
component_count | Number of components on list to unload. |
- Returns
- Status of performed operation
- Return values
-