Added more doxygen documentation.
This commit is contained in:
@ -33,32 +33,21 @@
|
||||
#include <hashtable.h>
|
||||
#include <mysql_client_server_protocol.h>
|
||||
|
||||
#undef PREP_STMT_CACHING
|
||||
|
||||
#if defined(PREP_STMT_CACHING)
|
||||
|
||||
typedef enum prep_stmt_type {
|
||||
PREP_STMT_NAME,
|
||||
PREP_STMT_ID
|
||||
} prep_stmt_type_t;
|
||||
|
||||
typedef enum prep_stmt_state {
|
||||
PREP_STMT_ALLOC,
|
||||
PREP_STMT_SENT,
|
||||
PREP_STMT_RECV,
|
||||
PREP_STMT_DROPPED
|
||||
} prep_stmt_state_t;
|
||||
|
||||
#endif /*< PREP_STMT_CACHING */
|
||||
|
||||
typedef enum init_state
|
||||
/**
|
||||
* Bitmask values for the router session's initialization. These values are used
|
||||
* to prevent responses from internal commands being forwarded to the client.
|
||||
*/
|
||||
typedef enum init_mask
|
||||
{
|
||||
INIT_READY = 0x0,
|
||||
INIT_MAPPING = 0x1,
|
||||
INIT_USE_DB = 0x02
|
||||
|
||||
} init_state_t;
|
||||
} init_mask_t;
|
||||
|
||||
/**
|
||||
* The state of the backend server reference
|
||||
*/
|
||||
typedef enum bref_state {
|
||||
BREF_IN_USE = 0x01,
|
||||
BREF_WAITING_RESULT = 0x02, /*< for session commands only */
|
||||
@ -73,6 +62,10 @@ typedef enum bref_state {
|
||||
#define BREF_IS_QUERY_ACTIVE(s) ((s)->bref_state & BREF_QUERY_ACTIVE)
|
||||
#define BREF_IS_CLOSED(s) ((s)->bref_state & BREF_CLOSED)
|
||||
#define BREF_IS_MAPPED(s) ((s)->bref_mapped)
|
||||
|
||||
/**
|
||||
* The type of the backend server
|
||||
*/
|
||||
typedef enum backend_type_t {
|
||||
BE_UNDEFINED=-1,
|
||||
BE_MASTER,
|
||||
@ -83,6 +76,9 @@ typedef enum backend_type_t {
|
||||
|
||||
struct router_instance;
|
||||
|
||||
/**
|
||||
* Route target types
|
||||
*/
|
||||
typedef enum {
|
||||
TARGET_UNDEFINED = 0x00,
|
||||
TARGET_MASTER = 0x01,
|
||||
@ -101,6 +97,9 @@ typedef enum {
|
||||
typedef struct rses_property_st rses_property_t;
|
||||
typedef struct router_client_session ROUTER_CLIENT_SES;
|
||||
|
||||
/**
|
||||
* Router session properties
|
||||
*/
|
||||
typedef enum rses_property_type_t {
|
||||
RSES_PROP_TYPE_UNDEFINED=-1,
|
||||
RSES_PROP_TYPE_SESCMD=0,
|
||||
@ -132,10 +131,10 @@ typedef struct mysql_sescmd_st {
|
||||
#if defined(SS_DEBUG)
|
||||
skygw_chk_t my_sescmd_chk_top;
|
||||
#endif
|
||||
rses_property_t* my_sescmd_prop; /*< parent property */
|
||||
GWBUF* my_sescmd_buf; /*< query buffer */
|
||||
unsigned char my_sescmd_packet_type;/*< packet type */
|
||||
bool my_sescmd_is_replied; /*< is cmd replied to client */
|
||||
rses_property_t* my_sescmd_prop; /*< Parent property */
|
||||
GWBUF* my_sescmd_buf; /*< Query buffer */
|
||||
unsigned char my_sescmd_packet_type;/*< Packet type */
|
||||
bool my_sescmd_is_replied; /*< Is cmd replied to client */
|
||||
#if defined(SS_DEBUG)
|
||||
skygw_chk_t my_sescmd_chk_tail;
|
||||
#endif
|
||||
@ -149,14 +148,14 @@ struct rses_property_st {
|
||||
#if defined(SS_DEBUG)
|
||||
skygw_chk_t rses_prop_chk_top;
|
||||
#endif
|
||||
ROUTER_CLIENT_SES* rses_prop_rsession; /*< parent router session */
|
||||
int rses_prop_refcount;
|
||||
rses_property_type_t rses_prop_type;
|
||||
ROUTER_CLIENT_SES* rses_prop_rsession; /*< Parent router session */
|
||||
int rses_prop_refcount; /*< Reference count*/
|
||||
rses_property_type_t rses_prop_type; /*< Property type */
|
||||
union rses_prop_data {
|
||||
mysql_sescmd_t sescmd;
|
||||
HASHTABLE* temp_tables;
|
||||
mysql_sescmd_t sescmd; /*< Session commands */
|
||||
HASHTABLE* temp_tables; /*< Hashtable of table names */
|
||||
} rses_prop_data;
|
||||
rses_property_t* rses_prop_next; /*< next property of same type */
|
||||
rses_property_t* rses_prop_next; /*< Next property of same type */
|
||||
#if defined(SS_DEBUG)
|
||||
skygw_chk_t rses_prop_chk_tail;
|
||||
#endif
|
||||
@ -212,24 +211,26 @@ typedef struct backend_ref_st {
|
||||
#if defined(SS_DEBUG)
|
||||
skygw_chk_t bref_chk_top;
|
||||
#endif
|
||||
BACKEND* bref_backend;
|
||||
DCB* bref_dcb;
|
||||
bref_state_t bref_state;
|
||||
bool bref_mapped;
|
||||
int bref_num_result_wait;
|
||||
sescmd_cursor_t bref_sescmd_cur;
|
||||
BACKEND* bref_backend; /*< Backend server */
|
||||
DCB* bref_dcb; /*< Backend DCB */
|
||||
bref_state_t bref_state; /*< State of the backend */
|
||||
bool bref_mapped; /*< Whether the backend has been mapped */
|
||||
int bref_num_result_wait; /*< Number of not yet received results */
|
||||
sescmd_cursor_t bref_sescmd_cur; /*< Session command cursor */
|
||||
GWBUF* bref_pending_cmd; /*< For stmt which can't be routed due active sescmd execution */
|
||||
#if defined(SS_DEBUG)
|
||||
skygw_chk_t bref_chk_tail;
|
||||
#endif
|
||||
} backend_ref_t;
|
||||
|
||||
|
||||
/**
|
||||
* Configuration values
|
||||
*/
|
||||
typedef struct dbshard_config_st {
|
||||
int rw_max_slave_conn_percent;
|
||||
int rw_max_slave_conn_count;
|
||||
target_t rw_use_sql_variables_in;
|
||||
} rwsplit_config_t;
|
||||
} dbshard_config_t;
|
||||
|
||||
|
||||
/**
|
||||
@ -243,27 +244,24 @@ struct router_client_session {
|
||||
int rses_versno; /*< even = no active update, else odd. not used 4/14 */
|
||||
bool rses_closed; /*< true when closeSession is called */
|
||||
DCB* rses_client_dcb;
|
||||
MYSQL_session* rses_mysql_session;
|
||||
MYSQL_session* rses_mysql_session; /*< Session client data (username, password, SHA1). */
|
||||
/** Properties listed by their type */
|
||||
rses_property_t* rses_properties[RSES_PROP_TYPE_COUNT];
|
||||
backend_ref_t* rses_master_ref;
|
||||
rses_property_t* rses_properties[RSES_PROP_TYPE_COUNT]; /*< Session properties */
|
||||
backend_ref_t* rses_master_ref; /*< Router session master reference */
|
||||
backend_ref_t* rses_backend_ref; /*< Pointer to backend reference array */
|
||||
rwsplit_config_t rses_config; /*< copied config info from router instance */
|
||||
int rses_nbackends;
|
||||
int rses_capabilities; /*< input type, for example */
|
||||
bool rses_autocommit_enabled;
|
||||
bool rses_transaction_active;
|
||||
#if defined(PREP_STMT_CACHING)
|
||||
HASHTABLE* rses_prep_stmt[2];
|
||||
#endif
|
||||
dbshard_config_t rses_config; /*< Copied config info from router instance */
|
||||
int rses_nbackends; /*< Number of backends */
|
||||
int rses_capabilities; /*< Input type, for example */
|
||||
bool rses_autocommit_enabled; /*< Is autocommit enabled */
|
||||
bool rses_transaction_active; /*< Is a transaction active */
|
||||
struct router_instance *router; /*< The router instance */
|
||||
struct router_client_session* next;
|
||||
HASHTABLE* dbhash;
|
||||
char connect_db[MYSQL_DATABASE_MAXLEN+1];
|
||||
init_state_t init;
|
||||
GWBUF* queue;
|
||||
DCB* dcb_route;
|
||||
DCB* dcb_reply;
|
||||
struct router_client_session* next; /*< List of router sessions */
|
||||
HASHTABLE* dbhash; /*< Database hash containing names of the databases mapped to the servers that contain them */
|
||||
char connect_db[MYSQL_DATABASE_MAXLEN+1]; /*< Database the user was trying to connect to */
|
||||
init_mask_t init; /*< Initialization state bitmask */
|
||||
GWBUF* queue; /*< Query that was received before the session was ready */
|
||||
DCB* dcb_route; /*< Internal DCB used to trigger re-routing of buffers */
|
||||
DCB* dcb_reply; /*< Internal DCB used to send replies to the client */
|
||||
#if defined(SS_DEBUG)
|
||||
skygw_chk_t rses_chk_tail;
|
||||
#endif
|
||||
@ -290,7 +288,7 @@ typedef struct router_instance {
|
||||
SPINLOCK lock; /*< Lock for the instance data */
|
||||
BACKEND** servers; /*< Backend servers */
|
||||
BACKEND* master; /*< NULL or pointer */
|
||||
rwsplit_config_t dbshard_config; /*< expanded config info from SERVICE */
|
||||
dbshard_config_t dbshard_config; /*< expanded config info from SERVICE */
|
||||
int dbshard_version;/*< version number for router's config */
|
||||
unsigned int bitmask; /*< Bitmask to apply to server->status */
|
||||
unsigned int bitvalue; /*< Required value of server->status */
|
||||
|
||||
Reference in New Issue
Block a user