/*! Type of the status variable value in struct wsrep_status_var */
typedef enum wsrep_var_type
{
WSREP_STATUS_STRING, //!< pointer to null-terminated string
WSREP_STATUS_INT64, //!< int64_t
WSREP_STATUS_DOUBLE, //!< double
}
wsrep_var_type_t;
/*! Generalized status variable representation */
struct wsrep_status_var
{
const char* name; //!< variable name
wsrep_var_type_t type; //!< variable value type
union {
int64_t _int64;
double _double;
const char* _string;
} value; //!< variable value
};
/*!
* @brief Returns an array fo status variables.
* Array is terminated by Null variable name.
*
* @param wsrep this wsrep handle
* @return array of struct wsrep_status_var
*/
struct wsrep_status_var* (*status_get) (wsrep_t*);
Now it looks like this:
/*! Type of the status variable value in struct wsrep_status_var */ STATUS_ STRING, //!< pointer to null-terminated string STATUS_ INT64, //!< int64_t STATUS_ DOUBLE, //!< double
typedef enum wsrep_var_type
{
WSREP_
WSREP_
WSREP_
}
wsrep_var_type_t;
/*! Generalized status variable representation */ var_type_ t type; //!< variable value type
struct wsrep_status_var
{
const char* name; //!< variable name
wsrep_
union {
int64_t _int64;
double _double;
const char* _string;
} value; //!< variable value
};
/*!
* @brief Returns an array fo status variables.
* Array is terminated by Null variable name.
*
* @param wsrep this wsrep handle
* @return array of struct wsrep_status_var
*/
struct wsrep_status_var* (*status_get) (wsrep_t*);
On provider side: STRING, {._string = state_uuid_str}}, committed" , WSREP_STATUS_INT64, { -1 } }, d_bytes" , WSREP_STATUS_INT64, { 0 } }, bytes", WSREP_STATUS_INT64, { 0 } }, commits" , WSREP_STATUS_INT64, { 0 } }, cert_failures" , WSREP_STATUS_INT64, { 0 } }, bf_aborts" , WSREP_STATUS_INT64, { 0 } },
static struct wsrep_status_var wsrep_status[] =
{
{"state_uuid", WSREP_STATUS_
{"last_
{"replicated", WSREP_STATUS_INT64, { 0 } },
{"replicate
{"received", WSREP_STATUS_INT64, { 0 } },
{"received_
{"local_
{"local_
{"local_
{NULL, 0, { 0 }}
};