Rename and overload adding of session commands
As the session commands are always appended to the end of the list, the name should reflect that action. For this reason, the function was renamed to append_session_command. Readwritesplit supports replacement of slave servers by storing all executed session commands in a list. To make the copying of this list a bit cleaner, an overload for a list of session commands was added. This will allow relatively smooth addition of server replacement to all router modules that use the Backend class.
This commit is contained in:
@ -111,16 +111,21 @@ bool Backend::execute_session_command()
|
||||
return rval;
|
||||
}
|
||||
|
||||
void Backend::add_session_command(GWBUF* buffer, uint64_t sequence)
|
||||
void Backend::append_session_command(GWBUF* buffer, uint64_t sequence)
|
||||
{
|
||||
m_session_commands.push_back(SSessionCommand(new SessionCommand(buffer, sequence)));
|
||||
}
|
||||
|
||||
void Backend::add_session_command(const SSessionCommand& sescmd)
|
||||
void Backend::append_session_command(const SSessionCommand& sescmd)
|
||||
{
|
||||
m_session_commands.push_back(sescmd);
|
||||
}
|
||||
|
||||
void Backend::append_session_command(const SessionCommandList& sescmdlist)
|
||||
{
|
||||
m_session_commands.insert(m_session_commands.end(), sescmdlist.begin(), sescmdlist.end());
|
||||
}
|
||||
|
||||
uint64_t Backend::complete_session_command()
|
||||
{
|
||||
uint64_t rval = m_session_commands.front()->get_position();
|
||||
|
Reference in New Issue
Block a user