1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-27 09:01:50 +03:00

Pass callback to get provider options to provider_v26 constructor

Passing a callback allows constructing the options string using
config service after loading the provider but before initializing
the provider. This way it is possible get options which are given
at DBMS startup, in command line or config file.
This commit is contained in:
Daniele Sciascia
2025-02-19 13:31:52 +02:00
parent 2dc8339ff1
commit 3965d83968
12 changed files with 195 additions and 56 deletions

View File

@ -29,6 +29,7 @@
#include <cstring>
#include <functional>
#include <memory>
#include <string>
#include <vector>
@ -50,6 +51,7 @@ namespace wsrep
class event_service;
class client_service;
class connection_monitor_service;
class provider_options;
class stid
{
public:
@ -521,13 +523,13 @@ namespace wsrep
* Create a new provider.
*
* @param provider_spec Provider specification
* @param provider_options Initial options to provider
* @param provider_options_cb Callback to get initial provider options
* @param thread_service Optional thread service implementation.
*/
static std::unique_ptr<provider> make_provider(
wsrep::server_state&,
const std::string& provider_spec,
const std::string& provider_options,
wsrep::server_state&, const std::string& provider_spec,
const std::function<int(const provider_options&, std::string&)>&
provider_options_cb,
const wsrep::provider::services& services
= wsrep::provider::services());