diff --git a/include/wsrep/applying_service.hpp b/include/wsrep/applying_service.hpp new file mode 100644 index 0000000..40fb484 --- /dev/null +++ b/include/wsrep/applying_service.hpp @@ -0,0 +1,20 @@ +// +// Copyright (C) 2018 Codership Oy +// + +#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 diff --git a/include/wsrep/client_service.hpp b/include/wsrep/client_service.hpp index 7763bdb..3c953fc 100644 --- a/include/wsrep/client_service.hpp +++ b/include/wsrep/client_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 // diff --git a/include/wsrep/transaction_termination_service.hpp b/include/wsrep/transaction_termination_service.hpp new file mode 100644 index 0000000..886a377 --- /dev/null +++ b/include/wsrep/transaction_termination_service.hpp @@ -0,0 +1,21 @@ +// +// Copyright (C) 2018 Codership Oy +// + + +#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