Take Backend into use in rwsplit_select_backends.cc
This is the first step to taking the Backend class into use. It is now used in rwsplit_select_backends.cc and readwritesplit.hh. The module is not yet functional and doesn't even compile. Added some helper functions to the Backend class to get easier access to the server referenced by the SERVER_REF and to check the state of the backend.
This commit is contained in:
@ -86,7 +86,7 @@ public:
|
||||
/**
|
||||
* @brief Check if backend has session commands
|
||||
*
|
||||
* @return True if backend has session commands
|
||||
* @return Number of session commands
|
||||
*/
|
||||
size_t session_command_count() const;
|
||||
|
||||
@ -97,6 +97,20 @@ public:
|
||||
*/
|
||||
SERVER_REF* backend() const;
|
||||
|
||||
/**
|
||||
* @brief Get pointer to server
|
||||
*
|
||||
* @return Pointer to server
|
||||
*/
|
||||
SERVER* server() const;
|
||||
|
||||
/**
|
||||
* @brief Check if a connection to this backend can be made
|
||||
*
|
||||
* @return True if the backend has not failed and a connection can be attempted
|
||||
*/
|
||||
bool can_connect() const;
|
||||
|
||||
/**
|
||||
* @brief Create a new connection
|
||||
*
|
||||
|
Reference in New Issue
Block a user