mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
Renamed transcation_context to transaction
This commit is contained in:
@ -57,7 +57,7 @@ int db::client::client_command(F f)
|
||||
{
|
||||
// wsrep::log_info() << "Current error";
|
||||
assert(client_state_.transaction().state() ==
|
||||
wsrep::transaction_context::s_aborted);
|
||||
wsrep::transaction::s_aborted);
|
||||
err = 1;
|
||||
}
|
||||
client_state_.after_command_after_result();
|
||||
@ -79,7 +79,7 @@ void db::client::run_one_transaction()
|
||||
return err;
|
||||
});
|
||||
|
||||
const wsrep::transaction_context& transaction(
|
||||
const wsrep::transaction& transaction(
|
||||
client_state_.transaction());
|
||||
|
||||
err = err || client_command(
|
||||
@ -125,17 +125,17 @@ void db::client::run_one_transaction()
|
||||
});
|
||||
|
||||
assert(err ||
|
||||
transaction.state() == wsrep::transaction_context::s_aborted ||
|
||||
transaction.state() == wsrep::transaction_context::s_committed);
|
||||
transaction.state() == wsrep::transaction::s_aborted ||
|
||||
transaction.state() == wsrep::transaction::s_committed);
|
||||
assert(se_trx_.active() == false);
|
||||
assert(transaction.active() == false);
|
||||
|
||||
switch (transaction.state())
|
||||
{
|
||||
case wsrep::transaction_context::s_committed:
|
||||
case wsrep::transaction::s_committed:
|
||||
++stats_.commits;
|
||||
break;
|
||||
case wsrep::transaction_context::s_aborted:
|
||||
case wsrep::transaction::s_aborted:
|
||||
++stats_.rollbacks;
|
||||
break;
|
||||
default:
|
||||
|
@ -38,10 +38,10 @@ int db::client_service::rollback(wsrep::client_state&)
|
||||
}
|
||||
enum wsrep::provider::status
|
||||
db::client_service::replay(wsrep::client_state&,
|
||||
wsrep::transaction_context& transaction_context)
|
||||
wsrep::transaction& transaction)
|
||||
{
|
||||
wsrep::high_priority_context high_priority_context(client_state_);
|
||||
auto ret(provider_.replay(transaction_context.ws_handle(),
|
||||
auto ret(provider_.replay(transaction.ws_handle(),
|
||||
&client_state_));
|
||||
if (ret == wsrep::provider::success)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#define WSREP_DB_CLIENT_SERVICE_HPP
|
||||
|
||||
#include "wsrep/client_service.hpp"
|
||||
#include "wsrep/transaction_context.hpp"
|
||||
#include "wsrep/transaction.hpp"
|
||||
|
||||
#include "db_client_state.hpp"
|
||||
|
||||
@ -46,7 +46,7 @@ namespace db
|
||||
client_state_.store_globals();
|
||||
}
|
||||
|
||||
int prepare_data_for_replication(wsrep::client_state&, const wsrep::transaction_context&) override
|
||||
int prepare_data_for_replication(wsrep::client_state&, const wsrep::transaction&) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -57,13 +57,13 @@ namespace db
|
||||
}
|
||||
|
||||
int prepare_fragment_for_replication(wsrep::client_state&,
|
||||
const wsrep::transaction_context&,
|
||||
const wsrep::transaction&,
|
||||
wsrep::mutable_buffer&) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void remove_fragments(const wsrep::transaction_context&) override
|
||||
void remove_fragments(const wsrep::transaction&) override
|
||||
{ }
|
||||
|
||||
int apply(wsrep::client_state&, const wsrep::const_buffer&) override;
|
||||
@ -73,16 +73,16 @@ namespace db
|
||||
|
||||
int rollback(wsrep::client_state&) override;
|
||||
|
||||
void will_replay(const wsrep::transaction_context&) override
|
||||
void will_replay(const wsrep::transaction&) override
|
||||
{ }
|
||||
|
||||
void wait_for_replayers(wsrep::client_state&,
|
||||
wsrep::unique_lock<wsrep::mutex>&) override { }
|
||||
enum wsrep::provider::status replay(wsrep::client_state&,
|
||||
wsrep::transaction_context&)
|
||||
wsrep::transaction&)
|
||||
override;
|
||||
|
||||
int append_fragment(const wsrep::transaction_context&, int,
|
||||
int append_fragment(const wsrep::transaction&, int,
|
||||
const wsrep::const_buffer&) override
|
||||
{
|
||||
return 0;
|
||||
|
@ -16,10 +16,10 @@ void db::storage_engine::transaction::start(db::client* cc)
|
||||
}
|
||||
|
||||
void db::storage_engine::transaction::apply(
|
||||
const wsrep::transaction_context& transaction_context)
|
||||
const wsrep::transaction& transaction)
|
||||
{
|
||||
assert(cc_);
|
||||
se_.bf_abort_some(transaction_context);
|
||||
se_.bf_abort_some(transaction);
|
||||
}
|
||||
|
||||
void db::storage_engine::transaction::commit()
|
||||
@ -43,7 +43,7 @@ void db::storage_engine::transaction::rollback()
|
||||
cc_ = nullptr;
|
||||
}
|
||||
|
||||
void db::storage_engine::bf_abort_some(const wsrep::transaction_context& txc)
|
||||
void db::storage_engine::bf_abort_some(const wsrep::transaction& txc)
|
||||
{
|
||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||
if (alg_freq_ && (std::rand() % alg_freq_) == 0)
|
||||
|
@ -39,7 +39,7 @@ namespace db
|
||||
}
|
||||
bool active() const { return cc_ != nullptr; }
|
||||
void start(client* cc);
|
||||
void apply(const wsrep::transaction_context&);
|
||||
void apply(const wsrep::transaction&);
|
||||
void commit();
|
||||
void rollback();
|
||||
db::client* client() { return cc_; }
|
||||
@ -49,7 +49,7 @@ namespace db
|
||||
db::storage_engine& se_;
|
||||
db::client* cc_;
|
||||
};
|
||||
void bf_abort_some(const wsrep::transaction_context& tc);
|
||||
void bf_abort_some(const wsrep::transaction& tc);
|
||||
long long bf_aborts() const { return bf_aborts_; }
|
||||
private:
|
||||
wsrep::default_mutex mutex_;
|
||||
|
Reference in New Issue
Block a user