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

Removed ostream include from public API headers.

This commit is contained in:
Teemu Ollakka
2018-06-17 13:55:37 +03:00
parent 78cb0270af
commit af3119a58b
13 changed files with 119 additions and 63 deletions

View File

@ -7,6 +7,7 @@ add_library(wsrep-lib
id.cpp
logger.cpp
provider.cpp
seqno.cpp
server_state.cpp
transaction.cpp
wsrep_provider_v26.cpp)

View File

@ -185,6 +185,26 @@ wsrep::client_state::after_statement()
return asr_success;
}
int wsrep::client_state::enable_streaming(
enum wsrep::streaming_context::fragment_unit
fragment_unit,
size_t fragment_size)
{
assert(mode_ == m_replicating);
if (transaction_.active() &&
transaction_.streaming_context_.fragment_unit() !=
fragment_unit)
{
wsrep::log_error()
<< "Changing fragment unit for active transaction "
<< "not allowed";
return 1;
}
transaction_.streaming_context_.enable(
fragment_unit, fragment_size);
return 0;
}
// Private
void wsrep::client_state::debug_log_state(const char* context) const

View File

@ -33,3 +33,24 @@ wsrep::provider* wsrep::provider::make_provider(
}
return 0;
}
std::string wsrep::flags_to_string(int flags)
{
std::ostringstream oss;
if (flags & provider::flag::start_transaction)
oss << "start_transaction | ";
if (flags & provider::flag::commit)
oss << "commit | ";
if (flags & provider::flag::rollback)
oss << "rollback | ";
if (flags & provider::flag::isolation)
oss << "isolation | ";
if (flags & provider::flag::pa_unsafe)
oss << "pa_unsafe | ";
if (flags & provider::flag::snapshot)
oss << "snapshot | ";
std::string ret(oss.str());
if (ret.size() > 3) ret.erase(ret.size() - 3);
return ret;
}

11
src/seqno.cpp Normal file
View File

@ -0,0 +1,11 @@
//
// Copyright (C) 2018 Codership Oy <info@codership.com>
//
#include "wsrep/seqno.hpp"
#include <ostream>
std::ostream& wsrep::operator<<(std::ostream& os, wsrep::seqno seqno)
{
return (os << seqno.get());
}