MXS-1849 Combine table and database mapping

Previously schemarouter only mapped databases to the servers
they were resided on. Now all the tables are also mapped to allow the
router to route queries to the right server based on the tables used in
that query.
This commit is contained in:
Marko
2018-06-24 22:17:22 +03:00
parent b38cac4939
commit f308dd281a
4 changed files with 101 additions and 266 deletions

View File

@ -42,16 +42,6 @@ public:
*/
bool add_location(std::string db, SERVER* target);
/**
* @brief Add a table location
*
* @param table table to add
* @param target Target where database is located
*
* @return True if location was added
*/
bool add_table_location(std::string table, SERVER* target);
/**
* @brief Retrieve the location of a database
*
@ -61,16 +51,6 @@ public:
*/
SERVER* get_location(std::string db);
/**
* @brief Retrieve the location of a table
*
* @param table table to locate
*
* @return The server or NULL if no server contains the database
*/
SERVER* get_table_location(std::string table);
/**
* @brief Change the location of a database
*
@ -95,8 +75,6 @@ public:
*/
bool empty() const;
bool tables_empty() const;
/**
* @brief Retrieve all database to server mappings
*
@ -115,7 +93,6 @@ public:
private:
ServerMap m_map;
ServerMap m_table_map;
time_t m_last_updated;
};