1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-21 12:22:06 +03:00

Refactored server_service out of server_state.

This commit is contained in:
Teemu Ollakka
2018-06-18 17:45:24 +03:00
parent ef5751943d
commit cf231bdf2d
14 changed files with 142 additions and 89 deletions

View File

@ -173,7 +173,7 @@ int wsrep::server_state::on_apply(
assert(not_replaying);
assert(find_streaming_applier(
ws_meta.server_id(), ws_meta.transaction_id()) == 0);
wsrep::client_state* sac(streaming_applier_client_state());
wsrep::client_state* sac(server_service_.streaming_applier_client_state());
start_streaming_applier(
ws_meta.server_id(), ws_meta.transaction_id(), sac);
sac->start_transaction(ws_handle, ws_meta);
@ -191,7 +191,7 @@ int wsrep::server_state::on_apply(
sac->after_command_before_result();
sac->after_command_after_result();
}
log_dummy_write_set(client_state, ws_meta);
server_service_.log_dummy_write_set(client_state, ws_meta);
}
else if (ws_meta.flags() == 0)
{
@ -219,7 +219,7 @@ int wsrep::server_state::on_apply(
sac->after_command_before_result();
sac->after_command_after_result();
}
log_dummy_write_set(client_state, ws_meta);
server_service_.log_dummy_write_set(client_state, ws_meta);
}
else if (commits_transaction(ws_meta.flags()))
{
@ -251,7 +251,7 @@ int wsrep::server_state::on_apply(
sac->after_command_after_result();
stop_streaming_applier(
ws_meta.server_id(), ws_meta.transaction_id());
release_client_state(sac);
server_service_.release_client_state(sac);
}
}
else
@ -273,16 +273,6 @@ int wsrep::server_state::on_apply(
return ret;
}
#if 0
bool wsrep::server_state::statement_allowed_for_streaming(
const wsrep::client_state&,
const wsrep::transaction&) const
{
/* Streaming not implemented yet. */
return false;
}
#endif
void wsrep::server_state::start_streaming_applier(
const wsrep::id& server_id,
const wsrep::transaction_id& transaction_id,