mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-03 16:22:35 +03:00
Refactored dbms simulator. Survives SST.
This commit is contained in:
@ -5,16 +5,21 @@
|
||||
#ifndef WSREP_DB_SIMULATOR_HPP
|
||||
#define WSREP_DB_SIMULATOR_HPP
|
||||
|
||||
#include "wsrep/gtid.hpp"
|
||||
#include "wsrep/mutex.hpp"
|
||||
#include "wsrep/lock.hpp"
|
||||
|
||||
#include "db_params.hpp"
|
||||
#include "db_server.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <chrono>
|
||||
#include <unordered_set>
|
||||
|
||||
#include "db_params.hpp"
|
||||
#include <map>
|
||||
|
||||
namespace db
|
||||
{
|
||||
class server;
|
||||
|
||||
class simulator
|
||||
{
|
||||
public:
|
||||
@ -29,23 +34,18 @@ namespace db
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
void donate_sst(server&,
|
||||
const std::string& req, const wsrep::gtid& gtid, bool);
|
||||
void sst(db::server&,
|
||||
const std::string&, const wsrep::gtid&, bool);
|
||||
const db::params& params() const
|
||||
{ return params_; }
|
||||
std::string stats() const;
|
||||
private:
|
||||
std::string server_port(size_t i) const
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << (10000 + (i + 1)*10);
|
||||
return os.str();
|
||||
}
|
||||
std::string server_port(size_t i) const;
|
||||
std::string build_cluster_address() const;
|
||||
|
||||
wsrep::default_mutex mutex_;
|
||||
const db::params& params_;
|
||||
std::map<size_t, std::unique_ptr<server>> servers_;
|
||||
std::map<size_t, std::unique_ptr<db::server>> servers_;
|
||||
std::chrono::time_point<std::chrono::steady_clock> clients_start_;
|
||||
std::chrono::time_point<std::chrono::steady_clock> clients_stop_;
|
||||
public:
|
||||
|
Reference in New Issue
Block a user