MXS-553: Provide full session to DCB mapping

By storing a link to the backend DCBs in the session object itself, we can
reach all related objects from the session. This removes the need to
iterate over all DCBs to find the set of related DCBs.
This commit is contained in:
Markus Mäkelä
2018-05-18 10:07:34 +03:00
parent de0541f76b
commit 643fc825fa
5 changed files with 31 additions and 7 deletions

View File

@ -29,12 +29,15 @@
#ifdef __cplusplus
#include <tr1/unordered_map>
#include <tr1/unordered_set>
#include <string>
#include <deque>
#include <vector>
typedef std::deque<std::vector<uint8_t> > SessionStmtQueue;
typedef std::tr1::unordered_set<DCB*> DCBSet;
#else
typedef void SessionStmtQueue;
typedef void DCBSet;
#endif
MXS_BEGIN_DECLS
@ -211,6 +214,7 @@ typedef struct session
GWBUF* buffer; /*< Buffer to deliver to up. */
} response; /*< Shortcircuited response */
SessionStmtQueue* last_statements; /*< The N last statements by the client */
DCBSet* dcb_set; /*< Set of associated backend DCBs */
skygw_chk_t ses_chk_tail;
} MXS_SESSION;