MXS-2555 Beta Smart Router.

1. Remove persistence of performance data
2. Move global CanonicalPerformance into SmartRouter object
3. Implement another kill_all_others_v2. Left kill_all_others_v1
    in case it should be fixed and used instead.
This commit is contained in:
Niclas Antti
2019-06-13 13:43:30 +03:00
parent 1241300494
commit 6a7b6d4b89
6 changed files with 138 additions and 144 deletions

View File

@ -18,6 +18,8 @@
* @file Smart Router. Routes queries to the best router for the type of query.
*/
#include "performance.hh"
#include <maxscale/ccdefs.hh>
#include <maxscale/config2.hh>
#include <maxscale/router.hh>
@ -75,8 +77,18 @@ public:
return m_config;
}
/** Thread safe find a PerformanceInfo. Some entry expiration handling is done here.
*/
PerformanceInfo perf_find(const std::string& canonical);
/** Thread safe update/insert a PerformanceInfo. Some entry expiration handling is done here.
*/
bool perf_update(const std::string& canonical, const PerformanceInfo& perf);
private:
SmartRouter(SERVICE* service);
Config m_config;
Config m_config;
CanonicalPerformance m_performance;
std::mutex m_perf_mutex;
};