mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-02 05:22:26 +03:00
Changed project name to wsrep-lib.
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
#include "wsrep_provider_v26.hpp"
|
||||
#include "trrep/exception.hpp"
|
||||
#include "wsrep/exception.hpp"
|
||||
|
||||
#include <wsrep_api.h>
|
||||
|
||||
@ -12,27 +12,27 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
trrep::wsrep_provider_v26::wsrep_provider_v26(
|
||||
wsrep::wsrep_provider_v26::wsrep_provider_v26(
|
||||
const char* path,
|
||||
struct wsrep_init_args* args)
|
||||
wsrep_init_args* args)
|
||||
: wsrep_()
|
||||
{
|
||||
if (wsrep_load(path, &wsrep_, 0))
|
||||
{
|
||||
throw trrep::runtime_error("Failed to load wsrep library");
|
||||
throw wsrep::runtime_error("Failed to load wsrep library");
|
||||
}
|
||||
if (wsrep_->init(wsrep_, args) != WSREP_OK)
|
||||
{
|
||||
throw trrep::runtime_error("Failed to initialize wsrep provider");
|
||||
throw wsrep::runtime_error("Failed to initialize wsrep provider");
|
||||
}
|
||||
}
|
||||
|
||||
trrep::wsrep_provider_v26::~wsrep_provider_v26()
|
||||
wsrep::wsrep_provider_v26::~wsrep_provider_v26()
|
||||
{
|
||||
wsrep_unload(wsrep_);
|
||||
}
|
||||
|
||||
int trrep::wsrep_provider_v26::connect(
|
||||
int wsrep::wsrep_provider_v26::connect(
|
||||
const std::string& cluster_name,
|
||||
const std::string& cluster_url,
|
||||
const std::string& state_donor,
|
||||
@ -53,7 +53,7 @@ int trrep::wsrep_provider_v26::connect(
|
||||
return ret;
|
||||
}
|
||||
|
||||
int trrep::wsrep_provider_v26::disconnect()
|
||||
int wsrep::wsrep_provider_v26::disconnect()
|
||||
{
|
||||
int ret(0);
|
||||
wsrep_status_t wret;
|
||||
@ -66,26 +66,26 @@ int trrep::wsrep_provider_v26::disconnect()
|
||||
return ret;
|
||||
}
|
||||
|
||||
wsrep_status_t trrep::wsrep_provider_v26::run_applier(void *applier_ctx)
|
||||
wsrep_status_t wsrep::wsrep_provider_v26::run_applier(void *applier_ctx)
|
||||
{
|
||||
return wsrep_->recv(wsrep_, applier_ctx);
|
||||
}
|
||||
|
||||
int trrep::wsrep_provider_v26::append_key(wsrep_ws_handle_t* wsh,
|
||||
int wsrep::wsrep_provider_v26::append_key(wsrep_ws_handle_t* wsh,
|
||||
const wsrep_key_t* key)
|
||||
{
|
||||
return (wsrep_->append_key(wsrep_, wsh, key, 1, WSREP_KEY_EXCLUSIVE, true)
|
||||
!= WSREP_OK);
|
||||
}
|
||||
|
||||
int trrep::wsrep_provider_v26::append_data(wsrep_ws_handle_t* wsh,
|
||||
int wsrep::wsrep_provider_v26::append_data(wsrep_ws_handle_t* wsh,
|
||||
const wsrep_buf_t* data)
|
||||
{
|
||||
return (wsrep_->append_data(wsrep_, wsh, data, 1, WSREP_DATA_ORDERED, true)
|
||||
!= WSREP_OK);
|
||||
}
|
||||
|
||||
wsrep_status_t trrep::wsrep_provider_v26::certify(wsrep_conn_id_t conn_id,
|
||||
wsrep_status_t wsrep::wsrep_provider_v26::certify(wsrep_conn_id_t conn_id,
|
||||
wsrep_ws_handle_t* wsh,
|
||||
uint32_t flags,
|
||||
wsrep_trx_meta_t* meta)
|
||||
@ -93,7 +93,7 @@ wsrep_status_t trrep::wsrep_provider_v26::certify(wsrep_conn_id_t conn_id,
|
||||
return wsrep_->certify(wsrep_, conn_id, wsh, flags, meta);
|
||||
}
|
||||
|
||||
wsrep_status_t trrep::wsrep_provider_v26::bf_abort(
|
||||
wsrep_status_t wsrep::wsrep_provider_v26::bf_abort(
|
||||
wsrep_seqno_t bf_seqno,
|
||||
wsrep_trx_id_t victim_id,
|
||||
wsrep_seqno_t *victim_seqno)
|
||||
@ -102,32 +102,32 @@ wsrep_status_t trrep::wsrep_provider_v26::bf_abort(
|
||||
wsrep_, bf_seqno, victim_id, victim_seqno);
|
||||
}
|
||||
|
||||
wsrep_status_t trrep::wsrep_provider_v26::commit_order_enter(
|
||||
wsrep_status_t wsrep::wsrep_provider_v26::commit_order_enter(
|
||||
const wsrep_ws_handle_t* wsh,
|
||||
const wsrep_trx_meta_t* meta)
|
||||
{
|
||||
return wsrep_->commit_order_enter(wsrep_, wsh, meta);
|
||||
}
|
||||
|
||||
int trrep::wsrep_provider_v26::commit_order_leave(
|
||||
int wsrep::wsrep_provider_v26::commit_order_leave(
|
||||
const wsrep_ws_handle_t* wsh,
|
||||
const wsrep_trx_meta_t* meta)
|
||||
{
|
||||
return (wsrep_->commit_order_leave(wsrep_, wsh, meta, 0) != WSREP_OK);
|
||||
}
|
||||
|
||||
int trrep::wsrep_provider_v26::release(wsrep_ws_handle_t* wsh)
|
||||
int wsrep::wsrep_provider_v26::release(wsrep_ws_handle_t* wsh)
|
||||
{
|
||||
return (wsrep_->release(wsrep_, wsh) != WSREP_OK);
|
||||
}
|
||||
|
||||
int trrep::wsrep_provider_v26::replay(wsrep_ws_handle_t* wsh,
|
||||
int wsrep::wsrep_provider_v26::replay(wsrep_ws_handle_t* wsh,
|
||||
void* applier_ctx)
|
||||
{
|
||||
return (wsrep_->replay_trx(wsrep_, wsh, applier_ctx) != WSREP_OK);
|
||||
}
|
||||
|
||||
int trrep::wsrep_provider_v26::sst_sent(const wsrep_gtid_t& gtid, int err)
|
||||
int wsrep::wsrep_provider_v26::sst_sent(const wsrep_gtid_t& gtid, int err)
|
||||
{
|
||||
if (wsrep_->sst_sent(wsrep_, >id, err) != WSREP_OK)
|
||||
{
|
||||
@ -136,7 +136,7 @@ int trrep::wsrep_provider_v26::sst_sent(const wsrep_gtid_t& gtid, int err)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int trrep::wsrep_provider_v26::sst_received(const wsrep_gtid_t& gtid, int err)
|
||||
int wsrep::wsrep_provider_v26::sst_received(const wsrep_gtid_t& gtid, int err)
|
||||
{
|
||||
if (wsrep_->sst_received(wsrep_, >id, 0, err) != WSREP_OK)
|
||||
{
|
||||
@ -145,12 +145,12 @@ int trrep::wsrep_provider_v26::sst_received(const wsrep_gtid_t& gtid, int err)
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<trrep::provider::status_variable>
|
||||
trrep::wsrep_provider_v26::status() const
|
||||
std::vector<wsrep::provider::status_variable>
|
||||
wsrep::wsrep_provider_v26::status() const
|
||||
{
|
||||
std::vector<status_variable> ret;
|
||||
struct wsrep_stats_var* const stats(wsrep_->stats_get(wsrep_));
|
||||
struct wsrep_stats_var* i(stats);
|
||||
wsrep_stats_var* const stats(wsrep_->stats_get(wsrep_));
|
||||
wsrep_stats_var* i(stats);
|
||||
if (i)
|
||||
{
|
||||
while (i->name)
|
||||
|
Reference in New Issue
Block a user