1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-05 03:41:13 +03:00

Refactored storage service out of client service interface.

This commit is contained in:
Teemu Ollakka
2018-07-07 18:06:37 +03:00
parent a8be09161c
commit 2ac13100f7
31 changed files with 465 additions and 247 deletions

View File

@ -23,11 +23,12 @@ void db::simulator::sst(db::server& server,
const wsrep::gtid& gtid,
bool bypass)
{
size_t id;
wsrep::id id;
std::istringstream is(request);
is >> id;
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
auto i(servers_.find(id));
wsrep::log_info() << "SST request";
if (i == servers_.end())
{
throw wsrep::runtime_error("Server " + request + " not found");
@ -86,9 +87,10 @@ void db::simulator::start()
id_os << (i + 1);
std::ostringstream address_os;
address_os << "127.0.0.1:" << server_port(i);
wsrep::id server_id(id_os.str());
auto it(servers_.insert(
std::make_pair(
(i + 1),
server_id,
std::make_unique<db::server>(
*this,
name_os.str(),