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

Renamed transcation_context to transaction

This commit is contained in:
Teemu Ollakka
2018-06-17 10:04:00 +03:00
parent dd28b173ab
commit 790c2bec4e
25 changed files with 382 additions and 382 deletions

View File

@ -21,7 +21,7 @@
namespace wsrep
{
class transaction_context;
class transaction;
class client_state;
class client_service
{
@ -60,15 +60,15 @@ namespace wsrep
/**
* Set up a data for replication.
*/
virtual int prepare_data_for_replication(wsrep::client_state&, const wsrep::transaction_context&) = 0;
virtual int prepare_data_for_replication(wsrep::client_state&, const wsrep::transaction&) = 0;
//
// Streaming
//
virtual size_t bytes_generated() const = 0;
virtual int prepare_fragment_for_replication(
wsrep::client_state&, const wsrep::transaction_context&, wsrep::mutable_buffer&) = 0;
virtual void remove_fragments(const wsrep::transaction_context&) = 0;
wsrep::client_state&, const wsrep::transaction&, wsrep::mutable_buffer&) = 0;
virtual void remove_fragments(const wsrep::transaction&) = 0;
//
// Applying interface
@ -109,7 +109,7 @@ namespace wsrep
* @todo This should not be visible to DBMS level, should be
* handled internally by wsrep-lib.
*/
virtual void will_replay(const wsrep::transaction_context&) = 0;
virtual void will_replay(const wsrep::transaction&) = 0;
/**
* Replay the current transaction. The implementation must put
@ -121,7 +121,7 @@ namespace wsrep
*/
virtual enum wsrep::provider::status replay(
wsrep::client_state&,
wsrep::transaction_context&) = 0;
wsrep::transaction&) = 0;
/**
* Wait until all replaying transactions have been finished
@ -136,7 +136,7 @@ namespace wsrep
/**
* Append a write set fragment into fragment storage.
*/
virtual int append_fragment(const wsrep::transaction_context&, int flag, const wsrep::const_buffer&) = 0;
virtual int append_fragment(const wsrep::transaction&, int flag, const wsrep::const_buffer&) = 0;
//
// Debug interface

View File

@ -40,7 +40,7 @@
#include "server_context.hpp"
#include "provider.hpp"
#include "transaction_context.hpp"
#include "transaction.hpp"
#include "client_id.hpp"
#include "client_service.hpp"
#include "mutex.hpp"
@ -249,7 +249,7 @@ namespace wsrep
return transaction_.append_data(data);
}
int prepare_data_for_replication(const wsrep::transaction_context& tc)
int prepare_data_for_replication(const wsrep::transaction& tc)
{
return client_service_.prepare_data_for_replication(*this, tc);
}
@ -291,14 +291,14 @@ namespace wsrep
}
int prepare_fragment_for_replication(
const wsrep::transaction_context& tc,
const wsrep::transaction& tc,
wsrep::mutable_buffer& mb)
{
return client_service_.prepare_fragment_for_replication(
*this, tc, mb);
}
int append_fragment(const wsrep::transaction_context& tc,
int append_fragment(const wsrep::transaction& tc,
int flags,
const wsrep::const_buffer& buf)
{
@ -415,7 +415,7 @@ namespace wsrep
return transaction_.start_replaying(ws_meta);
}
void adopt_transaction(wsrep::transaction_context& transaction)
void adopt_transaction(wsrep::transaction& transaction)
{
assert(mode_ == m_high_priority);
transaction_.start_transaction(transaction.id());
@ -423,7 +423,7 @@ namespace wsrep
}
enum wsrep::provider::status replay(
wsrep::transaction_context& tc)
wsrep::transaction& tc)
{
return client_service_.replay(*this, tc);
}
@ -432,7 +432,7 @@ namespace wsrep
//
//
void will_replay(const wsrep::transaction_context& tc)
void will_replay(const wsrep::transaction& tc)
{
client_service_.will_replay(tc);
}
@ -512,7 +512,7 @@ namespace wsrep
*/
enum state state() const { return state_; }
const wsrep::transaction_context& transaction() const
const wsrep::transaction& transaction() const
{
return transaction_;
}
@ -563,7 +563,7 @@ namespace wsrep
friend class client_state_switch;
friend class high_priority_context;
friend class client_toi_mode;
friend class transaction_context;
friend class transaction;
void debug_log_state(const char*) const;
/**
@ -581,7 +581,7 @@ namespace wsrep
enum mode mode_;
enum state state_;
protected:
wsrep::transaction_context transaction_;
wsrep::transaction transaction_;
private:
/**
* @todo This boolean should be converted to better read isolation

View File

@ -76,7 +76,7 @@ namespace wsrep
class provider;
class client_state;
class transaction_id;
class transaction_context;
class transaction;
class id;
class gtid;
class view;
@ -365,7 +365,7 @@ namespace wsrep
* @todo Make this private, allow calls for provider implementations
* only.
* @param client_state Applier client context.
* @param transaction_context Transaction context.
* @param transaction Transaction context.
* @param data Write set data
*
* @return Zero on success, non-zero on failure.
@ -385,7 +385,7 @@ namespace wsrep
*/
virtual bool statement_allowed_for_streaming(
const wsrep::client_state& client_state,
const wsrep::transaction_context& transaction_context) const;
const wsrep::transaction& transaction) const;
void debug_log_level(int level) { debug_log_level_ = level; }
int debug_log_level() const { return debug_log_level_; }

View File

@ -21,7 +21,7 @@ namespace wsrep
class const_buffer;
class transaction_context
class transaction
{
public:
enum state
@ -43,8 +43,8 @@ namespace wsrep
enum state state() const
{ return state_; }
transaction_context(wsrep::client_state& client_state);
~transaction_context();
transaction(wsrep::client_state& client_state);
~transaction();
// Accessors
wsrep::transaction_id id() const
{ return id_; }
@ -124,8 +124,8 @@ namespace wsrep
const wsrep::ws_handle& ws_handle() const { return ws_handle_; }
const wsrep::ws_meta& ws_meta() const { return ws_meta_; }
private:
transaction_context(const transaction_context&);
transaction_context operator=(const transaction_context&);
transaction(const transaction&);
transaction operator=(const transaction&);
void flags(int flags) { flags_ = flags; }
int certify_fragment(wsrep::unique_lock<wsrep::mutex>&);
@ -151,22 +151,22 @@ namespace wsrep
wsrep::streaming_context streaming_context_;
};
static inline std::string to_string(enum wsrep::transaction_context::state state)
static inline std::string to_string(enum wsrep::transaction::state state)
{
switch (state)
{
case wsrep::transaction_context::s_executing: return "executing";
case wsrep::transaction_context::s_preparing: return "preparing";
case wsrep::transaction_context::s_certifying: return "certifying";
case wsrep::transaction_context::s_committing: return "committing";
case wsrep::transaction_context::s_ordered_commit: return "ordered_commit";
case wsrep::transaction_context::s_committed: return "committed";
case wsrep::transaction_context::s_cert_failed: return "cert_failed";
case wsrep::transaction_context::s_must_abort: return "must_abort";
case wsrep::transaction_context::s_aborting: return "aborting";
case wsrep::transaction_context::s_aborted: return "aborted";
case wsrep::transaction_context::s_must_replay: return "must_replay";
case wsrep::transaction_context::s_replaying: return "replaying";
case wsrep::transaction::s_executing: return "executing";
case wsrep::transaction::s_preparing: return "preparing";
case wsrep::transaction::s_certifying: return "certifying";
case wsrep::transaction::s_committing: return "committing";
case wsrep::transaction::s_ordered_commit: return "ordered_commit";
case wsrep::transaction::s_committed: return "committed";
case wsrep::transaction::s_cert_failed: return "cert_failed";
case wsrep::transaction::s_must_abort: return "must_abort";
case wsrep::transaction::s_aborting: return "aborting";
case wsrep::transaction::s_aborted: return "aborted";
case wsrep::transaction::s_must_replay: return "must_replay";
case wsrep::transaction::s_replaying: return "replaying";
}
return "unknown";
}