1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-30 07:23:07 +03:00
Files
wsrep-lib/src/wsrep_provider_v26.hpp
Teemu Ollakka eb4cf86c1e Implemented thread service support.
Added a wsrep::thread_service interface to allow application to
inject instrumented thread, mutex and condition variable implementation
for provider.

The interface is defined in include/wsrep/thread_service.hpp.
Sample implementation is provided in dbsim/db_threads.[h|c]pp.

This patch will also clean up some remaining dependencies to
wsrep-API compilation units so that the dependency to wsrep-API
is header only. This will extending the provider support to
later wsrep-API versions.
2019-10-14 09:30:15 +03:00

105 lines
4.1 KiB
C++

/*
* Copyright (C) 2018 Codership Oy <info@codership.com>
*
* This file is part of wsrep-lib.
*
* Wsrep-lib is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Wsrep-lib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wsrep-lib. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef WSREP_WSREP_PROVIDER_V26_HPP
#define WSREP_WSREP_PROVIDER_V26_HPP
#include "wsrep/provider.hpp"
struct wsrep_st;
namespace wsrep
{
class thread_service;
class wsrep_provider_v26 : public wsrep::provider
{
public:
wsrep_provider_v26(wsrep::server_state&, const std::string&,
const std::string&,
const wsrep::provider::services& services);
~wsrep_provider_v26();
enum wsrep::provider::status
connect(const std::string&, const std::string&, const std::string&,
bool);
int disconnect();
int capabilities() const;
int desync();
int resync();
wsrep::seqno pause();
int resume();
enum wsrep::provider::status run_applier(wsrep::high_priority_service*);
int start_transaction(wsrep::ws_handle&) { return 0; }
enum wsrep::provider::status
assign_read_view(wsrep::ws_handle&, const wsrep::gtid*);
int append_key(wsrep::ws_handle&, const wsrep::key&);
enum wsrep::provider::status
append_data(wsrep::ws_handle&, const wsrep::const_buffer&);
enum wsrep::provider::status
certify(wsrep::client_id, wsrep::ws_handle&,
int,
wsrep::ws_meta&);
enum wsrep::provider::status
bf_abort(wsrep::seqno,
wsrep::transaction_id,
wsrep::seqno&);
enum wsrep::provider::status rollback(const wsrep::transaction_id);
enum wsrep::provider::status
commit_order_enter(const wsrep::ws_handle&,
const wsrep::ws_meta&);
int commit_order_leave(const wsrep::ws_handle&,
const wsrep::ws_meta&,
const wsrep::mutable_buffer&);
int release(wsrep::ws_handle&);
enum wsrep::provider::status replay(const wsrep::ws_handle&,
wsrep::high_priority_service*);
enum wsrep::provider::status enter_toi(wsrep::client_id,
const wsrep::key_array&,
const wsrep::const_buffer&,
wsrep::ws_meta&,
int);
enum wsrep::provider::status leave_toi(wsrep::client_id,
const wsrep::mutable_buffer&);
std::pair<wsrep::gtid, enum wsrep::provider::status>
causal_read(int) const;
enum wsrep::provider::status wait_for_gtid(const wsrep::gtid&, int) const;
wsrep::gtid last_committed_gtid() const;
int sst_sent(const wsrep::gtid&,int);
int sst_received(const wsrep::gtid& gtid, int);
int enc_set_key(const wsrep::const_buffer& key);
std::vector<status_variable> status() const;
void reset_status();
std::string options() const;
enum wsrep::provider::status options(const std::string&);
std::string name() const;
std::string version() const;
std::string vendor() const;
void* native() const;
private:
wsrep_provider_v26(const wsrep_provider_v26&);
wsrep_provider_v26& operator=(const wsrep_provider_v26);
struct wsrep_st* wsrep_;
};
}
#endif // WSREP_WSREP_PROVIDER_V26_HPP