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

Pass high_priority_service instead of void ptr for provider methods.

This commit is contained in:
Teemu Ollakka
2018-07-03 07:48:35 +03:00
parent 004244d203
commit 3632e7823c
9 changed files with 38 additions and 33 deletions

View File

@ -9,6 +9,8 @@
#ifndef WSREP_HIGH_PRIORITY_SERVICE_HPP
#define WSREP_HIGH_PRIORITY_SERVICE_HPP
#include "server_state.hpp"
namespace wsrep
{
class ws_handle;
@ -18,10 +20,15 @@ namespace wsrep
class high_priority_service
{
public:
high_priority_service(wsrep::server_state& server_state)
: server_state_(server_state) { }
virtual ~high_priority_service() { }
virtual int apply(const ws_handle&, const ws_meta&,
const const_buffer&) = 0;
int apply(const ws_handle& ws_handle, const ws_meta& ws_meta,
const const_buffer& data)
{
return server_state_.on_apply(*this, ws_handle, ws_meta, data);
}
/**
* Start a new transaction
*/
@ -71,7 +78,8 @@ namespace wsrep
virtual int log_dummy_write_set(const ws_handle&, const ws_meta&) = 0;
virtual bool is_replaying() const = 0;
private:
protected:
wsrep::server_state& server_state_;
};
class high_priority_switch

View File

@ -20,7 +20,7 @@
namespace wsrep
{
class server_state;
class high_priority_service;
class stid
{
public:
@ -237,7 +237,8 @@ namespace wsrep
virtual int resume() = 0;
// Applier interface
virtual enum status run_applier(void* applier_ctx) = 0;
virtual enum status run_applier(wsrep::high_priority_service*
applier_ctx) = 0;
// Write set replication
// TODO: Rename to assing_read_view()
virtual int start_transaction(wsrep::ws_handle&) = 0;
@ -276,7 +277,8 @@ namespace wsrep
* @return Zero in case of success, non-zero on failure.
*/
virtual enum status replay(
const wsrep::ws_handle& ws_handle, void* applier_ctx) = 0;
const wsrep::ws_handle& ws_handle,
wsrep::high_priority_service* applier_ctx) = 0;
/**
* Enter total order isolation critical section