Formatted readconnroute

Formatted readconnroute files according to the style guide.
This commit is contained in:
Markus Makela
2015-12-01 12:49:43 +02:00
parent 7119ed817d
commit 91eba965fc
2 changed files with 617 additions and 592 deletions

View File

@ -37,52 +37,55 @@
* connections to. This provides the storage for routing module specific data * connections to. This provides the storage for routing module specific data
* that is required for each of the backend servers. * that is required for each of the backend servers.
*/ */
typedef struct backend { typedef struct backend
SERVER *server; /*< The server itself */ {
int current_connection_count; /*< Number of connections to the server */ SERVER *server; /*< The server itself */
int weight; /*< Desired routing weight */ int current_connection_count; /*< Number of connections to the server */
int weight; /*< Desired routing weight */
} BACKEND; } BACKEND;
/** /**
* The client session structure used within this router. * The client session structure used within this router.
*/ */
typedef struct router_client_session { typedef struct router_client_session
{
#if defined(SS_DEBUG) #if defined(SS_DEBUG)
skygw_chk_t rses_chk_top; skygw_chk_t rses_chk_top;
#endif #endif
SPINLOCK rses_lock; /*< protects rses_deleted */ SPINLOCK rses_lock; /*< protects rses_deleted */
int rses_versno; /*< even = no active update, else odd */ int rses_versno; /*< even = no active update, else odd */
bool rses_closed; /*< true when closeSession is called */ bool rses_closed; /*< true when closeSession is called */
BACKEND *backend; /*< Backend used by the client session */ BACKEND *backend; /*< Backend used by the client session */
DCB *backend_dcb; /*< DCB Connection to the backend */ DCB *backend_dcb; /*< DCB Connection to the backend */
struct router_client_session *next; struct router_client_session *next;
int rses_capabilities; /*< input type, for example */ int rses_capabilities; /*< input type, for example */
#if defined(SS_DEBUG) #if defined(SS_DEBUG)
skygw_chk_t rses_chk_tail; skygw_chk_t rses_chk_tail;
#endif #endif
} ROUTER_CLIENT_SES; } ROUTER_CLIENT_SES;
/** /**
* The statistics for this router instance * The statistics for this router instance
*/ */
typedef struct { typedef struct
int n_sessions; /*< Number sessions created */ {
int n_queries; /*< Number of queries forwarded */ int n_sessions; /*< Number sessions created */
int n_queries; /*< Number of queries forwarded */
} ROUTER_STATS; } ROUTER_STATS;
/** /**
* The per instance data for the router. * The per instance data for the router.
*/ */
typedef struct router_instance { typedef struct router_instance
SERVICE *service; /*< Pointer to the service using this router */ {
ROUTER_CLIENT_SES *connections; /*< Link list of all the client connections */ SERVICE *service; /*< Pointer to the service using this router */
SPINLOCK lock; /*< Spinlock for the instance data */ ROUTER_CLIENT_SES *connections; /*< Link list of all the client connections */
BACKEND **servers; /*< List of backend servers */ SPINLOCK lock; /*< Spinlock for the instance data */
unsigned int bitmask; /*< Bitmask to apply to server->status */ BACKEND **servers; /*< List of backend servers */
unsigned int bitvalue; /*< Required value of server->status */ unsigned int bitmask; /*< Bitmask to apply to server->status */
ROUTER_STATS stats; /*< Statistics for this router */ unsigned int bitvalue; /*< Required value of server->status */
struct router_instance ROUTER_STATS stats; /*< Statistics for this router */
*next; struct router_instance
*next;
} ROUTER_INSTANCE; } ROUTER_INSTANCE;
#endif #endif

File diff suppressed because it is too large Load Diff