Logical binlog file which wraps and hides the detail of lower layer storage implementation.
More...
#include <binlog_ofile.h>
Logical binlog file which wraps and hides the detail of lower layer storage implementation.
Binlog code just use this class to control real storage
◆ ~Binlog_ofile()
| MYSQL_BIN_LOG::Binlog_ofile::~Binlog_ofile |
( |
| ) |
|
|
override |
◆ close()
| void MYSQL_BIN_LOG::Binlog_ofile::close |
( |
| ) |
|
|
virtual |
◆ flush()
| bool MYSQL_BIN_LOG::Binlog_ofile::flush |
( |
| ) |
|
|
virtual |
◆ flush_and_sync()
| bool MYSQL_BIN_LOG::Binlog_ofile::flush_and_sync |
( |
| ) |
|
|
virtual |
◆ get_encrypted_header_size()
| int MYSQL_BIN_LOG::Binlog_ofile::get_encrypted_header_size |
( |
| ) |
|
|
virtual |
Returns the encrypted header size of the binary log file.
- Return values
-
| 0 | The file is not encrypted. |
| >0 | The encryption header size. |
◆ get_pipeline_head()
Get the pipeline head.
- Return values
-
| Returns | the pipeline head or nullptr. |
◆ get_real_file_size()
| my_off_t MYSQL_BIN_LOG::Binlog_ofile::get_real_file_size |
( |
| ) |
|
|
virtual |
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.
- Returns
- The real file size considering the encryption header.
◆ is_empty()
| bool MYSQL_BIN_LOG::Binlog_ofile::is_empty |
( |
| ) |
|
|
virtual |
◆ is_encrypted()
| bool MYSQL_BIN_LOG::Binlog_ofile::is_encrypted |
( |
| ) |
|
|
virtual |
Check if the log file is encrypted.
- Return values
-
| True | if the log file is encrypted. |
| False | if the log file is not encrypted. |
◆ is_open()
| bool MYSQL_BIN_LOG::Binlog_ofile::is_open |
( |
| ) |
|
|
virtual |
◆ open()
| bool MYSQL_BIN_LOG::Binlog_ofile::open |
( |
PSI_file_key |
log_file_key, |
|
|
const char * |
binlog_name, |
|
|
myf |
flags, |
|
|
bool |
existing = false |
|
) |
| |
Opens the binlog file.
It opens the lower layer storage.
- Parameters
-
| [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. |
- Return values
-
◆ open_existing()
Opens an existing binlog file.
It opens the lower layer storage reusing the existing file password if needed.
- Parameters
-
| [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. |
- Return values
-
| std::unique_ptr | A Binlog_ofile object pointer. |
| nullptr | Error. |
◆ position()
| my_off_t MYSQL_BIN_LOG::Binlog_ofile::position |
( |
| ) |
|
|
virtual |
◆ set_encrypted()
| void MYSQL_BIN_LOG::Binlog_ofile::set_encrypted |
( |
| ) |
|
|
virtual |
Set that the log file is encrypted.
◆ sync()
| bool MYSQL_BIN_LOG::Binlog_ofile::sync |
( |
| ) |
|
|
virtual |
◆ truncate()
| bool MYSQL_BIN_LOG::Binlog_ofile::truncate |
( |
my_off_t |
offset | ) |
|
|
virtual |
Truncates some data at the end of the binlog file.
- Parameters
-
| [in] | offset | where the binlog file will be truncated to. |
- Return values
-
◆ update()
| bool MYSQL_BIN_LOG::Binlog_ofile::update |
( |
const unsigned char * |
buffer, |
|
|
my_off_t |
length, |
|
|
my_off_t |
offset |
|
) |
| |
|
virtual |
Updates some bytes in the binlog file.
If is only used for clearing LOG_EVENT_BINLOG_IN_USE_F.
- Parameters
-
| [in] | buffer | the data will be written |
| [in] | length | the length of the data |
| [in] | offset | the offset of the bytes will be updated |
- Return values
-
◆ write()
| bool MYSQL_BIN_LOG::Binlog_ofile::write |
( |
const unsigned char * |
buffer, |
|
|
my_off_t |
length |
|
) |
| |
|
overridevirtual |
Writes data into storage and maintains binlog position.
- Parameters
-
| [in] | buffer | the data will be written |
| [in] | length | the length of the data |
- Return values
-
Implements Basic_ostream.
◆ m_encrypted
| bool MYSQL_BIN_LOG::Binlog_ofile::m_encrypted = false |
|
private |
◆ m_encrypted_header_size
| int MYSQL_BIN_LOG::Binlog_ofile::m_encrypted_header_size = 0 |
|
private |
◆ m_pipeline_head
◆ m_position
| my_off_t MYSQL_BIN_LOG::Binlog_ofile::m_position = 0 |
|
private |
The documentation for this class was generated from the following files: