#include <file_storage.h>
|
static const std::string | SERVICE_NAME {"binlog_storage_iterator.file"} |
| The fully qualified service name: "binlog_storage_iterator.file". More...
|
|
◆ deinit()
Destroys the iterator.
- Parameters
-
[in] | iterator | the iterator to destroy. |
◆ get()
Returns the next entry in the log files, end-of-file, or an error.
- Parameters
-
[in] | iterator | the iterator context |
[in,out] | buffer | the buffer where to put the next value. |
[in] | buffer_capacity | the buffer size. |
[out] | bytes_read | the size of the value added to the buffer. If the value is larger than the buffer length, then an error is returned and this value is undefined. |
- Note
- If there are new transactions being written to the log file after the iterator has been opened, get will return them if the iterator is not disposed before reaching that point in the log.
-
If the log file rotates after the iterator has been opened, the iterator itself shall rotate to the new file as well.
-
The iterator will stop once it reached the end of the most recent log file.
- Return values
-
kBinlogIteratorGetOk | if the operation succeeded. |
kBinlogIteratorGetEndOfChanges | if there are no more events to read. The iterator is still valid and if you call get again you either get the same error back or new entries that may have been added in the meantime. |
kBinlogIteratorGetInsufficientBuffer | if the buffer is insufficient to store the next entry. The iterator is still valid and you can call try to get another entry with a larger buffer. |
kBinlogIteratorGetErrorClosed | if the log is closed. The iterator is still valid, but retrying will get the same error back as long as the change log is closed. |
kBinlogIteratorGetErrorInvalid | if the iterator itself has become invalid. This can happen if the memory structures of the iterator are tampered with. The iterator state is invalid and therefore the behavior is undefined if one retries getting the next entry. May result on the same error again. This iterator should be de-initialized and a new one created. |
kBinlogIteratorGetErrorUnspecified | if there was an undefined error while reading the next entry. The iterator state is invalid and therefore the behavior is undefined if one retries getting the next entry. May result on the same error again. This iterator should be de-initialized and a new one created. |
◆ get_next_entry_size()
Gets the size of the next block to be read.
This member function can be used to check how larger the size of the buffer to read the next block/event shall be. Note though that if the next block ends up being skipped the obtained via this function is obsolete and a new get_next_entry_size may have to be executed to fetch the buffer needed for the next entry. Therefore it is a good practice for the caller to loop over a get function while it returns insufficient buffer and thus allocate a bigger buffer in that case.
- Parameters
-
[in] | iterator | the iterator context. |
[out] | size | a pointer that stores the size if the function returns successfully. |
- Returns
- false on success, true otherwise.
◆ get_storage_details()
Gets details about the entry's storage in a JSON format.
- Parameters
-
[in] | iterator | a valid iterator, i.e., one that has been initialized and not destroyed yet. |
[in,out] | buffer | The buffer to store the information in. |
[in,out] | size | As input, the size of the buffer provided. As output, the size of the data copied into the buffer. |
- Returns
- false on success, true otherwise.
◆ init()
Initializes the iterator.
This function must be called prior to using the iterator.
- Parameters
-
[out] | iterator | a pointer to the iterator to initialize. |
[in] | excluded_gtids_as_string | the set of transaction identifiers to skip while reading from the log. |
- Return values
-
kBinlogIteratorInitOk | if the operation concluded successfully. |
kBinlogIteratorIniErrorPurgedGtids | if the iterator was not successfully initialized due to transactions having been purged. |
kBinlogIteratorInitErrorLogClosed | if the iterator was not successfully initialized because the log is closed. |
BINLOG_INIT_ITERATOR_ERROR_UNDEF | if the iterator was not initialized due to an undefined error. |
◆ register_service()
bool binlog::services::iterator::FileStorage::register_service |
( |
| ) |
|
|
static |
This registers runtime binary log related file services in the service registry.
This function is called at server startup.
- Returns
- true on failure
-
false on success
◆ unregister_service()
bool binlog::services::iterator::FileStorage::unregister_service |
( |
| ) |
|
|
static |
This unregisters runtime binary log related file storage services from the server registry.
This function is called, when the binary log is closed or when the server is shutting down.
- Returns
- true on failure.
-
false on success.
◆ SERVICE_NAME
const std::string binlog::services::iterator::FileStorage::SERVICE_NAME {"binlog_storage_iterator.file"} |
|
static |
The fully qualified service name: "binlog_storage_iterator.file".
The documentation for this class was generated from the following files: