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:
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
11
src/seqno.cpp
Normal 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());
|
||||
}
|
Reference in New Issue
Block a user