mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Execution context switching for high priority service.
This commit is contained in:
@ -80,9 +80,24 @@ namespace wsrep
|
||||
*/
|
||||
virtual void after_apply() = 0;
|
||||
|
||||
/**
|
||||
* Store global execution context for high priority service.
|
||||
*/
|
||||
virtual void store_globals() = 0;
|
||||
|
||||
/**
|
||||
* Reset global execution context for high priority service.
|
||||
*/
|
||||
virtual void reset_globals() = 0;
|
||||
|
||||
/**
|
||||
* Switch exection context to context of orig_hps.
|
||||
*
|
||||
* @param orig_hps Original high priority service.
|
||||
*/
|
||||
virtual void switch_execution_context(
|
||||
wsrep::high_priority_service& orig_hps) = 0;
|
||||
|
||||
virtual int log_dummy_write_set(const ws_handle&, const ws_meta&) = 0;
|
||||
|
||||
virtual bool is_replaying() const = 0;
|
||||
@ -102,6 +117,7 @@ namespace wsrep
|
||||
, current_service_(current_service)
|
||||
{
|
||||
orig_service_.reset_globals();
|
||||
current_service_.switch_execution_context(orig_service_);
|
||||
current_service_.store_globals();
|
||||
}
|
||||
~high_priority_switch()
|
||||
|
@ -34,13 +34,30 @@ namespace wsrep
|
||||
wsrep::client_service&) = 0;
|
||||
|
||||
virtual void release_storage_service(wsrep::storage_service*) = 0;
|
||||
|
||||
/**
|
||||
* Create an applier state for streaming transaction applying.
|
||||
*
|
||||
* @param orig_cs Reference to client service which is
|
||||
* requesting a new streaming applier service
|
||||
* instance.
|
||||
*
|
||||
* @return Pointer to streaming applier client state.
|
||||
*/
|
||||
virtual wsrep::high_priority_service*
|
||||
streaming_applier_service() = 0;
|
||||
streaming_applier_service(wsrep::client_service& orig_cs) = 0;
|
||||
|
||||
/**
|
||||
* Create an applier state for streaming transaction applying.
|
||||
*
|
||||
* @param orig_hps Reference to high priority service which is
|
||||
* requesting a new streaming applier service
|
||||
* instance.
|
||||
*
|
||||
* @return Pointer to streaming applier client state.
|
||||
*/
|
||||
virtual wsrep::high_priority_service*
|
||||
streaming_applier_service(wsrep::high_priority_service& orig_hps) = 0;
|
||||
|
||||
/**
|
||||
* Release a client state allocated by either local_client_state()
|
||||
|
@ -25,6 +25,7 @@ namespace wsrep
|
||||
{ }
|
||||
type get() const { return id_; }
|
||||
static unsigned long long undefined() { return type(-1); }
|
||||
bool is_undefined() const { return (id_ == type(-1)); }
|
||||
bool operator<(const transaction_id& other) const
|
||||
{
|
||||
return (id_ < other.id_);
|
||||
|
Reference in New Issue
Block a user