KILL [CONNECTION | QUERY] support, part2B

Various small changes to part2, as suggested by comments and otherwise.
Mostly renaming, working logic should not change.

Exception: session id changed to 64bit in the container and associated
functions. Another commit will change it to 64bit in the session itself.
This commit is contained in:
Esa Korhonen
2017-05-04 17:51:10 +03:00
parent 17f6e94cba
commit ee20191645
6 changed files with 84 additions and 68 deletions

View File

@ -69,7 +69,7 @@ public:
typedef WORKER_STATISTICS STATISTICS;
typedef WorkerTask Task;
typedef WorkerDisposableTask DisposableTask;
typedef std::tr1::unordered_map<uint32_t, MXS_SESSION*> SessionsById;
typedef std::tr1::unordered_map<uint64_t, MXS_SESSION*> SessionsById;
enum state_t
{
@ -387,29 +387,28 @@ public:
bool post_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2);
/**
* Add a session to the sessions hashmap
* Add a session to the session container.
*
* @param id Session id, must be unique
* @param session The session to add
* @return true if successful
*/
bool add_to_session_map(SessionsById::key_type id, SessionsById::mapped_type session);
bool register_session(MXS_SESSION* session);
/**
* Remove a session from the sessions hashmap
* Remove a session from the session container.
*
* @param id Session id
* @return The removed session, or NULL if not found
*/
SessionsById::mapped_type remove_from_session_map(SessionsById::key_type id);
MXS_SESSION* deregister_session(uint64_t id);
/**
* Find a session in the sessions hashmap
* Find a session in the session container.
*
* @param id Session id
* @return The found session, or NULL if not found
*/
SessionsById::mapped_type find_in_session_map(SessionsById::key_type id);
MXS_SESSION* find_session(uint64_t id);
/**
* Broadcast a message to all worker.