1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Refactoring dbms simulator. Intermediate commit.

This commit is contained in:
Teemu Ollakka
2018-06-15 12:58:36 +03:00
parent cb3b2fbf9e
commit 4fbf1d0cf8
17 changed files with 771 additions and 68 deletions

46
dbsim/db_client.hpp Normal file
View File

@ -0,0 +1,46 @@
//
// Copyright (C) 2018 Codership Oy <info@codership.com>
//
#ifndef WSREP_DB_CLIENT_HPP
#define WSREP_DB_CLIENT_HPP
#include "db_client_context.hpp"
#include "db_server_context.hpp"
#include "db_storage_engine.hpp"
namespace db
{
class client
{
public:
struct stats
{
long long commits;
long long rollbacks;
long long replays;
stats()
: commits(0)
, rollbacks(0)
, replays(0)
{ }
};
client();
bool bf_abort(wsrep::seqno);
private:
template <class F> int client_command(F f);
void run_one_transaction();
void reset_error();
wsrep::default_mutex mutex_;
const db::params& params_;
db::server_context& server_context_;
db::client_context client_context_;
db::storage_engine::transaction se_trx_;
stats stats_;
};
}
#endif // WSREP_DB_CLIENT_HPP