MySQL 9.1.0
Source Code Documentation
mysql_harness::LogReopen::ThreadState Class Reference

#include <log_reopen.h>

Public Types

enum class  State { NONE , REQUESTED , ACTIVE , SHUTDOWN }
 

Public Member Functions

void request_reopen (const std::string &dst="")
 request reopen More...
 
bool is_completed () const
 
bool is_requested () const
 
bool is_active () const
 
bool is_shutdown () const
 
std::string errmsg () const
 
void errmsg (const std::string &errmsg)
 
void destination (const std::string &dst)
 
std::string destination () const
 
void state (State st)
 
State state () const
 

Private Attributes

State state_ {State::NONE}
 
std::string errmsg_
 
std::string dst_
 

Member Enumeration Documentation

◆ State

Enumerator
NONE 
REQUESTED 
ACTIVE 
SHUTDOWN 

Member Function Documentation

◆ destination() [1/2]

std::string mysql_harness::LogReopen::ThreadState::destination ( ) const
inline

◆ destination() [2/2]

void mysql_harness::LogReopen::ThreadState::destination ( const std::string &  dst)
inline

◆ errmsg() [1/2]

std::string mysql_harness::LogReopen::ThreadState::errmsg ( ) const
inline

◆ errmsg() [2/2]

void mysql_harness::LogReopen::ThreadState::errmsg ( const std::string &  errmsg)
inline

◆ is_active()

bool mysql_harness::LogReopen::ThreadState::is_active ( ) const
inline

◆ is_completed()

bool mysql_harness::LogReopen::ThreadState::is_completed ( ) const
inline

◆ is_requested()

bool mysql_harness::LogReopen::ThreadState::is_requested ( ) const
inline

◆ is_shutdown()

bool mysql_harness::LogReopen::ThreadState::is_shutdown ( ) const
inline

◆ request_reopen()

void mysql_harness::LogReopen::ThreadState::request_reopen ( const std::string &  dst = "")

request reopen

Note
Empty dst will cause reopen only, and the old content will not be moved to dst.
This method uses mutex::try_lock() to avoid blocking the interrupt handler if a signal is received during an already ongoing concurrent reopen. The consequence is that reopen requests are ignored if rotation is already in progress.
Parameters
dstfilename to use for old log file during reopen
Exceptions
std::system_errorsame as std::unique_lock::lock does

◆ state() [1/2]

State mysql_harness::LogReopen::ThreadState::state ( ) const
inline

◆ state() [2/2]

void mysql_harness::LogReopen::ThreadState::state ( State  st)
inline

Member Data Documentation

◆ dst_

std::string mysql_harness::LogReopen::ThreadState::dst_
private

◆ errmsg_

std::string mysql_harness::LogReopen::ThreadState::errmsg_
private

◆ state_

State mysql_harness::LogReopen::ThreadState::state_ {State::NONE}
private

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