MySQL 9.1.0
Source Code Documentation
|
Logical binlog file which wraps and hides the detail of lower layer storage implementation. More...
Public Member Functions | |
~Binlog_ofile () override | |
bool | open (PSI_file_key log_file_key, const char *binlog_name, myf flags, bool existing=false) |
Opens the binlog file. More... | |
void | close () |
bool | write (const unsigned char *buffer, my_off_t length) override |
Writes data into storage and maintains binlog position. More... | |
bool | update (const unsigned char *buffer, my_off_t length, my_off_t offset) |
Updates some bytes in the binlog file. More... | |
bool | truncate (my_off_t offset) |
Truncates some data at the end of the binlog file. More... | |
bool | flush () |
bool | sync () |
bool | flush_and_sync () |
my_off_t | position () |
bool | is_empty () |
bool | is_open () |
int | get_encrypted_header_size () |
Returns the encrypted header size of the binary log file. More... | |
my_off_t | get_real_file_size () |
Returns the real file size. More... | |
std::unique_ptr< Truncatable_ostream > | get_pipeline_head () |
Get the pipeline head. More... | |
bool | is_encrypted () |
Check if the log file is encrypted. More... | |
void | set_encrypted () |
Set that the log file is encrypted. More... | |
Public Member Functions inherited from Basic_ostream | |
virtual | ~Basic_ostream ()=default |
Static Public Member Functions | |
static std::unique_ptr< Binlog_ofile > | open_existing (PSI_file_key log_file_key, const char *binlog_name, myf flags) |
Opens an existing binlog file. More... | |
Private Attributes | |
my_off_t | m_position = 0 |
int | m_encrypted_header_size = 0 |
std::unique_ptr< Truncatable_ostream > | m_pipeline_head |
bool | m_encrypted = false |
Logical binlog file which wraps and hides the detail of lower layer storage implementation.
Binlog code just use this class to control real storage
|
inlineoverride |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the encrypted header size of the binary log file.
0 | The file is not encrypted. |
>0 | The encryption header size. |
|
inline |
Get the pipeline head.
Returns | the pipeline head or nullptr. |
|
inline |
Returns the real file size.
While position() returns the "file size" from the plain binary log events stream point of view, this function considers the encryption header when it exists.
|
inline |
|
inline |
Check if the log file is encrypted.
True | if the log file is encrypted. |
False | if the log file is not encrypted. |
|
inline |
|
inline |
Opens the binlog file.
It opens the lower layer storage.
[in] | log_file_key | The PSI_file_key for this stream |
[in] | binlog_name | The file to be opened |
[in] | flags | The flags used by IO_CACHE. |
[in] | existing | True if opening the file, false if creating a new one. |
false | Success |
true | Error |
|
inlinestatic |
Opens an existing binlog file.
It opens the lower layer storage reusing the existing file password if needed.
[in] | log_file_key | The PSI_file_key for this stream |
[in] | binlog_name | The file to be opened |
[in] | flags | The flags used by IO_CACHE. |
std::unique_ptr | A Binlog_ofile object pointer. |
nullptr | Error. |
|
inline |
|
inline |
Set that the log file is encrypted.
|
inline |
|
inline |
Truncates some data at the end of the binlog file.
[in] | offset | where the binlog file will be truncated to. |
false | Success |
true | Error |
|
inline |
Updates some bytes in the binlog file.
If is only used for clearing LOG_EVENT_BINLOG_IN_USE_F.
[in] | buffer | the data will be written |
[in] | length | the length of the data |
[in] | offset | the offset of the bytes will be updated |
false | Success |
true | Error |
|
inlineoverridevirtual |
Writes data into storage and maintains binlog position.
[in] | buffer | the data will be written |
[in] | length | the length of the data |
false | Success |
true | Error |
Implements Basic_ostream.
|
private |
|
private |
|
private |
|
private |