MXS-2220 Run uncrustify on server headers

This commit is contained in:
Esa Korhonen
2019-01-04 15:51:39 +02:00
parent b16ee3a94e
commit 03adee2030
2 changed files with 36 additions and 35 deletions

View File

@ -75,20 +75,20 @@ public:
struct Version struct Version
{ {
uint64_t total = 0; /**< The version number received from server */ uint64_t total = 0; /**< The version number received from server */
uint32_t major = 0; /**< Major version */ uint32_t major = 0; /**< Major version */
uint32_t minor = 0; /**< Minor version */ uint32_t minor = 0; /**< Minor version */
uint32_t patch = 0; /**< Patch version */ uint32_t patch = 0; /**< Patch version */
}; };
// Base settings // Base settings
char address[MAX_ADDRESS_LEN] = {'\0'}; /**< Server hostname/IP-address */ char address[MAX_ADDRESS_LEN] = {'\0'}; /**< Server hostname/IP-address */
int port = -1; /**< Server port */ int port = -1; /**< Server port */
int extra_port = -1; /**< Alternative monitor port if normal port fails */ int extra_port = -1; /**< Alternative monitor port if normal port fails */
// Other settings // Other settings
bool proxy_protocol = false; /**< Send proxy-protocol header to backends when connecting bool proxy_protocol = false; /**< Send proxy-protocol header to backends when connecting
* routing sessions. */ * routing sessions. */
// Base variables // Base variables
bool is_active = false; /**< Server is active and has not been "destroyed" */ bool is_active = false; /**< Server is active and has not been "destroyed" */
@ -103,9 +103,9 @@ public:
int64_t triggered_at = 0; /**< Time when the last event was triggered */ int64_t triggered_at = 0; /**< Time when the last event was triggered */
// Status descriptors. Updated automatically by a monitor or manually by the admin // Status descriptors. Updated automatically by a monitor or manually by the admin
uint64_t status = 0; /**< Current status flag bitmap */ uint64_t status = 0; /**< Current status flag bitmap */
int maint_request = MAINTENANCE_NO_CHANGE; /**< Is admin requesting Maintenance=ON/OFF on the int maint_request = MAINTENANCE_NO_CHANGE; /**< Is admin requesting Maintenance=ON/OFF on the
* server? */ * server? */
long node_id = -1; /**< Node id, server_id for M/S or local_index for Galera */ long node_id = -1; /**< Node id, server_id for M/S or local_index for Galera */
long master_id = -1; /**< Master server id of this node */ long master_id = -1; /**< Master server id of this node */
@ -458,13 +458,13 @@ bool server_set_disk_space_threshold(SERVER* server, const char* disk_space_thre
*/ */
void server_add_response_average(SERVER* server, double ave, int num_samples); void server_add_response_average(SERVER* server, double ave, int num_samples);
extern int server_free(SERVER* server); extern int server_free(SERVER* server);
extern SERVER* server_find_by_unique_name(const char* name); extern SERVER* server_find_by_unique_name(const char* name);
extern int server_find_by_unique_names(char** server_names, int size, SERVER*** output); extern int server_find_by_unique_names(char** server_names, int size, SERVER*** output);
extern void server_clear_set_status_nolock(SERVER* server, uint64_t bits_to_clear, uint64_t bits_to_set); extern void server_clear_set_status_nolock(SERVER* server, uint64_t bits_to_clear, uint64_t bits_to_set);
extern void server_set_status_nolock(SERVER* server, uint64_t bit); extern void server_set_status_nolock(SERVER* server, uint64_t bit);
extern void server_clear_status_nolock(SERVER* server, uint64_t bit); extern void server_clear_status_nolock(SERVER* server, uint64_t bit);
extern void server_transfer_status(SERVER* dest_server, const SERVER* source_server); extern void server_transfer_status(SERVER* dest_server, const SERVER* source_server);
extern void server_update_address(SERVER* server, const char* address); extern void server_update_address(SERVER* server, const char* address);
extern uint64_t server_map_status(const char* str); extern uint64_t server_map_status(const char* str);

View File

@ -274,25 +274,25 @@ public:
std::string monitor_password() const; std::string monitor_password() const;
mutable std::mutex m_lock; mutable std::mutex m_lock;
DCB** persistent = nullptr; /**< List of unused persistent connections to the server */ DCB** persistent = nullptr;/**< List of unused persistent connections to the server */
private: private:
struct Settings struct Settings
{ {
mutable std::mutex lock; /**< Protects array-like settings from concurrent access */ mutable std::mutex lock; /**< Protects array-like settings from concurrent access */
/** All config settings in text form. This is only read and written from the admin thread /** All config settings in text form. This is only read and written from the admin thread
* so no need for locking. */ * so no need for locking. */
std::vector<ConfigParameter> all_parameters; std::vector<ConfigParameter> all_parameters;
std::string protocol; /**< Backend protocol module name. Does not change so needs no locking. */ std::string protocol; /**< Backend protocol module name. Does not change so needs no locking. */
std::string authenticator; /**< Authenticator module name. Does not change so needs no locking. */ std::string authenticator; /**< Authenticator module name. Does not change so needs no locking. */
char monuser[MAX_MONUSER_LEN + 1] = {'\0'}; /**< Monitor username, overrides monitor setting */ char monuser[MAX_MONUSER_LEN + 1] = {'\0'}; /**< Monitor username, overrides monitor setting */
char monpw[MAX_MONPW_LEN + 1] = {'\0'}; /**< Monitor password, overrides monitor setting */ char monpw[MAX_MONPW_LEN + 1] = {'\0'}; /**< Monitor password, overrides monitor setting */
long persistpoolmax = 0; /**< Maximum size of persistent connections pool */ long persistpoolmax = 0; /**< Maximum size of persistent connections pool */
long persistmaxtime = 0; /**< Maximum number of seconds connection can live */ long persistmaxtime = 0; /**< Maximum number of seconds connection can live */
/** Disk space thresholds. Can be queried from modules at any time so access must be protected /** Disk space thresholds. Can be queried from modules at any time so access must be protected
* by mutex. */ * by mutex. */
@ -318,21 +318,22 @@ private:
*/ */
void set(uint64_t version_num, const std::string& version_string); void set(uint64_t version_num, const std::string& version_string);
Version version_num() const; Version version_num() const;
Type type() const; Type type() const;
std::string version_string() const; std::string version_string() const;
private: private:
mutable std::mutex m_lock; /**< Protects against concurrent writing */ mutable std::mutex m_lock; /**< Protects against concurrent writing */
Version m_version_num; /**< Numeric version */
Type m_type = Type::MARIADB; /**< Server type */ Version m_version_num; /**< Numeric version */
char m_version_str[MAX_VERSION_LEN + 1] = {'\0'}; /**< Server version string */ Type m_type = Type::MARIADB; /**< Server type */
char m_version_str[MAX_VERSION_LEN + 1] = {'\0'};/**< Server version string */
}; };
const std::string m_name; /**< Server config name */ const std::string m_name; /**< Server config name */
Settings m_settings; /**< Server settings */ Settings m_settings; /**< Server settings */
VersionInfo info; /**< Server version and type information */ VersionInfo info; /**< Server version and type information */
maxbase::EMAverage m_response_time; /**< Response time calculations for this server */ maxbase::EMAverage m_response_time; /**< Response time calculations for this server */
}; };
void server_free(Server* server); void server_free(Server* server);