Skip to content

Commit e8313df

Browse files
author
Daniele Sciascia
committed
Bump config service to version 2
The service and its API remains the same. Version 2 allows the service to be used before the provider is initialized.
1 parent a77d40f commit e8313df

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

wsrep_config_service.h

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* This file defines interface to retrieve a complete list of configuration
2323
* parameters accepted by the provider.
24-
* *
24+
*
2525
* The provider which is capable of using the service interface v1 must
2626
* export the following functions:
2727
*
@@ -30,6 +30,13 @@
3030
*
3131
* which can be probed by the application.
3232
*
33+
* Version 2 of the service interface is the same as version 1, except
34+
* that it allows to retrieve a complete list of configuration parameters
35+
* before the provider is initialized. In that case the provider export
36+
* the following functions:
37+
*
38+
* int wsrep_init_config_service_v2(wsrep_config_service_v1_t*)
39+
* void wsrep_deinit_config_service_v2()
3340
*/
3441

3542
#ifndef WSREP_CONFIG_SERVICE_H
@@ -85,6 +92,9 @@ typedef wsrep_status_t (*wsrep_get_parameters_cb) (const wsrep_parameter_t* p,
8592

8693
/**
8794
* Get configuration parameters exposed by the provider.
95+
* If the provider supports version 2 of this service,
96+
* then the the function can be called before the provider
97+
* is initialized using init() function from wsrep api.
8898
*
8999
* @param wsrep pointer to provider handle
90100
* @param cb function pointer for callback
@@ -106,11 +116,25 @@ typedef struct wsrep_config_service_v1_st {
106116
wsrep_get_parameters_fn get_parameters;
107117
} wsrep_config_service_v1_t;
108118

119+
/**
120+
* Config service struct - version 2
121+
*
122+
* A pointer to this struct must be passed to the call to
123+
* wsrep_init_config_service_v2.
124+
*
125+
*/
126+
typedef struct wsrep_config_service_v2_st {
127+
wsrep_get_parameters_fn get_parameters;
128+
} wsrep_config_service_v2_t;
129+
109130
#ifdef __cplusplus
110131
}
111132
#endif
112133

113134
#define WSREP_CONFIG_SERVICE_INIT_FUNC_V1 "wsrep_init_config_service_v1"
114135
#define WSREP_CONFIG_SERVICE_DEINIT_FUNC_V1 "wsrep_deinit_config_service_v1"
115136

137+
#define WSREP_CONFIG_SERVICE_INIT_FUNC_V2 "wsrep_init_config_service_v2"
138+
#define WSREP_CONFIG_SERVICE_DEINIT_FUNC_V2 "wsrep_deinit_config_service_v2"
139+
116140
#endif /* WSREP_CONFIG_SERVICE */

0 commit comments

Comments
 (0)