mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-05 03:41:13 +03:00
Moved commit()/rollback() to transaction_termination_service interface.
This commit is contained in:
20
include/wsrep/applying_service.hpp
Normal file
20
include/wsrep/applying_service.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
//
|
||||
// Copyright (C) 2018 Codership Oy <info@codership.com>
|
||||
//
|
||||
|
||||
#ifndef WSREP_APPLYING_SERVICE_HPP
|
||||
#define WSREP_APPLYING_SERVICE_HPP
|
||||
|
||||
namespace wsrep
|
||||
{
|
||||
class applying_service
|
||||
{
|
||||
public:
|
||||
virtual int start_transaction();
|
||||
virtual int apply_write_set(const wsrep::const_buffer&) = 0;
|
||||
virtual int apply_toi(const wsrep::const_buffer&);
|
||||
virtual int apply_nbo(const wsrep::const_buffer&);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // WSREP_APPLYING_SERVICE_HPP
|
@ -14,6 +14,8 @@
|
||||
#ifndef WSREP_CLIENT_SERVICE_HPP
|
||||
#define WSREP_CLIENT_SERVICE_HPP
|
||||
|
||||
#include "transaction_termination_service.hpp"
|
||||
|
||||
#include "buffer.hpp"
|
||||
#include "provider.hpp"
|
||||
#include "mutex.hpp"
|
||||
@ -22,7 +24,7 @@
|
||||
namespace wsrep
|
||||
{
|
||||
class transaction;
|
||||
class client_service
|
||||
class client_service : public wsrep::transaction_termination_service
|
||||
{
|
||||
public:
|
||||
client_service(wsrep::provider& provider)
|
||||
@ -76,17 +78,6 @@ namespace wsrep
|
||||
* Apply a write set.
|
||||
*/
|
||||
virtual int apply(const wsrep::const_buffer&) = 0;
|
||||
|
||||
/**
|
||||
* Commit transaction.
|
||||
*/
|
||||
virtual int commit(const wsrep::ws_handle&, const wsrep::ws_meta&) = 0;
|
||||
|
||||
/**
|
||||
* Roll back transaction.
|
||||
*/
|
||||
virtual int rollback() = 0;
|
||||
|
||||
//
|
||||
// Interface to global server state
|
||||
//
|
||||
|
21
include/wsrep/transaction_termination_service.hpp
Normal file
21
include/wsrep/transaction_termination_service.hpp
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// Copyright (C) 2018 Codership Oy <info@codership.com>
|
||||
//
|
||||
|
||||
|
||||
#ifndef WSREP_TRANSACTION_TERMINATION_SERVICE_HPP
|
||||
#define WSREP_TRANSACTION_TERMINATION_SERVICE_HPP
|
||||
|
||||
namespace wsrep
|
||||
{
|
||||
class ws_handle;
|
||||
class ws_meta;
|
||||
class transaction_termination_service
|
||||
{
|
||||
public:
|
||||
virtual int commit(const wsrep::ws_handle&, const wsrep::ws_meta&) = 0;
|
||||
virtual int rollback() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // WSREP_TRANSACTION_TERMINATION_SERVICE_HPP
|
Reference in New Issue
Block a user