dbms: Server: add support for multiple connections in PoolWithFailoverBase. [#METR-14410]

This commit is contained in:
Alexey Arno 2014-12-30 17:11:02 +03:00
parent 3bf24e5e28
commit 79ea4bf08f
2 changed files with 4 additions and 6 deletions

View File

@ -28,7 +28,7 @@ public:
typedef PoolBase<Connection>::Entry Entry;
virtual Entry get(Settings * settings = nullptr) = 0;
virtual std::vector<Entry> getMany(Settings * settings = nullptr)
virtual std::vector<Entry> getMany(unsigned max_connections, Settings * settings = nullptr)
{
return std::vector<Entry>{ get(settings) };
}

View File

@ -57,13 +57,11 @@ public:
return Base::get(settings);
}
/** Выделяет до указанного количества соединений для работы.
* Соединения предоставляют доступ к разным репликам одного шарда.
*/
std::vector<Entry> getMany(Settings * settings = nullptr) override
/** Выделяет до указанного количества соединений. */
std::vector<Entry> getMany(unsigned max_connections, Settings * settings = nullptr) override
{
applyLoadBalancing(settings);
return Base::getMany(settings);
return Base::getMany(max_connections, settings);
}
protected: