MySQL 9.5.0
Source Code Documentation
mysqlrouter::MySQLAccountsCleaner Class Reference

#include <accounts_cleaner.h>

Classes

struct  UndoCreateAccountList
 

Public Member Functions

 MySQLAccountsCleaner (std::ostream &err_stream)
 
 ~MySQLAccountsCleaner ()
 
std::string make_account_list (const std::string username, const std::set< std::string > &hostnames)
 
void set_session (MySQLSession *session)
 
void register_tmp_undo_account_list (const UndoCreateAccountList &account_list)
 
void register_undo_account_list (const UndoCreateAccountList &account_list)
 
void clear ()
 
void undo_create_user_for_new_accounts () noexcept
 Deletes Router accounts just created. More...
 

Private Attributes

MySQLSessionsession_ {nullptr}
 
std::ostream & err_stream_
 
UndoCreateAccountList tmp_undo_create_account_list_
 
std::vector< UndoCreateAccountListundo_create_account_list_
 

Constructor & Destructor Documentation

◆ MySQLAccountsCleaner()

mysqlrouter::MySQLAccountsCleaner::MySQLAccountsCleaner ( std::ostream &  err_stream)
inline

◆ ~MySQLAccountsCleaner()

mysqlrouter::MySQLAccountsCleaner::~MySQLAccountsCleaner ( )
inline

Member Function Documentation

◆ clear()

void mysqlrouter::MySQLAccountsCleaner::clear ( )
inline

◆ make_account_list()

std::string MySQLAccountsCleaner::make_account_list ( const std::string  username,
const std::set< std::string > &  hostnames 
)

◆ register_tmp_undo_account_list()

void mysqlrouter::MySQLAccountsCleaner::register_tmp_undo_account_list ( const UndoCreateAccountList account_list)
inline

◆ register_undo_account_list()

void mysqlrouter::MySQLAccountsCleaner::register_undo_account_list ( const UndoCreateAccountList account_list)
inline

◆ set_session()

void mysqlrouter::MySQLAccountsCleaner::set_session ( MySQLSession session)
inline

◆ undo_create_user_for_new_accounts()

void MySQLAccountsCleaner::undo_create_user_for_new_accounts ( )
noexcept

Deletes Router accounts just created.

This method runs as a cleanup after something goes wrong. Its purpose is to undo CREATE USER [IF NOT EXISTS] for accounts that got created during bootstrap. Note that it will drop only those accounts which did not exist prior to bootstrap (it may be a subset of account names passed to CREATE USER [IF NOT EXISTS]). If it is not able to determine what this (sub)set is, it will not drop anything - instead it will advise user on how to clean those up manually.

Member Data Documentation

◆ err_stream_

std::ostream& mysqlrouter::MySQLAccountsCleaner::err_stream_
private

◆ session_

MySQLSession* mysqlrouter::MySQLAccountsCleaner::session_ {nullptr}
private

◆ tmp_undo_create_account_list_

UndoCreateAccountList mysqlrouter::MySQLAccountsCleaner::tmp_undo_create_account_list_
private

◆ undo_create_account_list_

std::vector<UndoCreateAccountList> mysqlrouter::MySQLAccountsCleaner::undo_create_account_list_
private

The documentation for this class was generated from the following files: