Share data between identical session commands
If two or more session commands contain identical buffers, the buffer of the first session command is shared between the others. This reduces the amount of memory used to store repeated executions of session commands. The purging of session command history in readwritesplit was replaced with session command de-duplication. This was done to prevent problems that could arise when the order of session commands plays a significant role.
This commit is contained in:
@ -89,6 +89,17 @@ public:
|
||||
*/
|
||||
bool eq(const SessionCommand& rhs) const;
|
||||
|
||||
/**
|
||||
* Mark the session command as a re-execution of another command
|
||||
*
|
||||
* This function makes the current command's buffer a reference to the other
|
||||
* command's buffer. The commands will still have separate positions and
|
||||
* reply statuses.
|
||||
*
|
||||
* @param rhs Session command whose data is used
|
||||
*/
|
||||
void mark_as_duplicate(const SessionCommand& rhs);
|
||||
|
||||
private:
|
||||
mxs::Buffer m_buffer; /**< The buffer containing the command */
|
||||
uint8_t m_command; /**< The command being executed */
|
||||
|
||||
Reference in New Issue
Block a user