MySQL 8.0.39
Source Code Documentation
|
Defines a file handler. More...
#include <rpl_info_file.h>
Public Member Functions | |
~Rpl_info_file () override | |
Public Member Functions inherited from Rpl_info_handler | |
Rpl_info_handler (const Rpl_info_handler &handler)=delete | |
Rpl_info_handler & | operator= (const Rpl_info_handler &handler)=delete |
int | init_info () |
After creating an object and assembling components, this method is used to initialize internal structures. More... | |
enum_return_check | check_info () |
Checks the repository's status. More... | |
int | flush_info (const bool force) |
Flushes and syncs in-memory information into a stable storage (i.e. More... | |
int | remove_info () |
Deletes any information in it and in some cases the repository. More... | |
int | clean_info () |
Deletes any information in the repository. More... | |
void | end_info () |
Closes access to the repository. More... | |
int | prepare_info_for_read () |
Enables the storage system to receive reads, i.e. More... | |
int | prepare_info_for_write () |
Enables the storage system to receive writes, i.e. More... | |
uint | get_rpl_info_type () |
Gets the type of the repository that is used. More... | |
const char * | get_rpl_info_type_str () |
Returns a string corresponding to the type. More... | |
template<class TypeHandler > | |
bool | set_info (TypeHandler const value) |
Sets the value of a field to value . More... | |
template<class TypeHandler > | |
bool | set_info (TypeHandler const value, const size_t size) |
template<class TypeHandler > | |
bool | set_info (int pk_cursor, TypeHandler const value) |
set the value of a field pointed at pk_cursor to @ value. More... | |
template<class TypeHandlerPointer , class TypeHandler > | |
enum_field_get_status | get_info (TypeHandlerPointer value, TypeHandler const default_value) |
Returns the value of a field. More... | |
template<class TypeHandler > | |
enum_field_get_status | get_info (TypeHandler value, const size_t size, std::add_const_t< std::remove_pointer_t< TypeHandler > > *default_value) |
Returns the value of a string field. More... | |
enum_field_get_status | get_info (Server_ids *value, const Server_ids *default_value) |
Returns the value of a Server_id field. More... | |
int | get_number_info () |
Returns the number of fields handled by this handler. More... | |
void | set_sync_period (uint period) |
Configures the number of events after which the info (e.g. More... | |
char * | get_description_info () |
Returns a string describing the repository. More... | |
bool | is_transactional () |
Any transactional repository may have its updates rolled back in case of a failure. More... | |
bool | update_is_transactional () |
Updates the value returned by the member function is_transactional() because it may be expensive to compute it whenever is_transactional() is called. More... | |
virtual | ~Rpl_info_handler () |
Private Member Functions | |
int | do_init_info () override |
int | do_init_info (uint instance) override |
enum_return_check | do_check_info () override |
enum_return_check | do_check_info (uint instance) override |
void | do_end_info () override |
int | do_flush_info (const bool force) override |
int | do_remove_info () override |
int | do_clean_info () override |
int | do_prepare_info_for_read () override |
int | do_prepare_info_for_write () override |
bool | do_set_info (const int pos, const char *value) override |
bool | do_set_info (const int pos, const uchar *value, const size_t size) override |
bool | do_set_info (const int pos, const int value) override |
bool | do_set_info (const int pos, const ulong value) override |
bool | do_set_info (const int pos, const float value) override |
bool | do_set_info (const int pos, const Server_ids *value) override |
bool | do_set_info (const int pos, const std::nullptr_t value) override |
Setter needed to set nullable fields to NULL . More... | |
bool | do_set_info (const int pos, const std::nullptr_t value, const size_t size) override |
Setter needed to set nullable fields to NULL . More... | |
Rpl_info_handler::enum_field_get_status | check_for_error (int pos, long n_read_bytes) |
Checks if the value returned from the read function is an actual error or just the side-effect of a nullable field. More... | |
Rpl_info_handler::enum_field_get_status | do_get_info (const int pos, char *value, const size_t size, const char *default_value) override |
Rpl_info_handler::enum_field_get_status | do_get_info (const int pos, uchar *value, const size_t size, const uchar *default_value) override |
Rpl_info_handler::enum_field_get_status | do_get_info (const int pos, int *value, const int default_value) override |
Rpl_info_handler::enum_field_get_status | do_get_info (const int pos, ulong *value, const ulong default_value) override |
Rpl_info_handler::enum_field_get_status | do_get_info (const int pos, float *value, const float default_value) override |
Rpl_info_handler::enum_field_get_status | do_get_info (const int pos, Server_ids *value, const Server_ids *default_value) override |
char * | do_get_description_info () override |
uint | do_get_rpl_info_type () override |
bool | do_is_transactional () override |
bool | do_update_is_transactional () override |
Rpl_info_file (int const nparam, const char *param_pattern_fname, const char *param_info_fname, bool name_indexed, MY_BITMAP const *nullable_bitmap) | |
Rpl_info_file (const Rpl_info_file &info) | |
Rpl_info_file & | operator= (const Rpl_info_file &info) |
Static Private Member Functions | |
static bool | do_count_info (const int nparam, const char *param_pattern_fname, bool indexed, MY_BITMAP const *nullable_bitmap, uint *counter) |
Returns the number of files that corresponds to param_info_fname. More... | |
static int | do_reset_info (int const nparam, const char *param_pattern_fname, bool name_indexed, MY_BITMAP const *nullable_bitmap) |
Private Attributes | |
char | info_fname [FN_REFLEN+128] |
This uniquely identifies a file. More... | |
char | pattern_fname [FN_REFLEN+128] |
This is used to identified a name's pattern. More... | |
File | info_fd |
IO_CACHE | info_file |
bool | name_indexed |
Friends | |
class | Rpl_info_factory |
Additional Inherited Members | |
Public Types inherited from Rpl_info_handler | |
enum class | enum_field_get_status : int { FIELD_VALUE_NOT_NULL = 0 , FIELD_VALUE_IS_NULL = 1 , FAILURE = 2 } |
Public Attributes inherited from Rpl_info_handler | |
Rpl_info_values * | field_values |
Protected Member Functions inherited from Rpl_info_handler | |
Rpl_info_handler (const int nparam, MY_BITMAP const *nullable_bitmap) | |
bool | is_field_nullable (int pos) |
Checks whether or not the field at position pos is allowed to be NULL . More... | |
Protected Attributes inherited from Rpl_info_handler | |
int | ninfo |
int | cursor |
bool | prv_error |
enum_field_get_status | prv_get_error |
uint | sync_counter |
uint | sync_period |
MY_BITMAP | nullable_fields |
Bitset holding which of the fields are allowed to be NULL . More... | |
Defines a file handler.
|
override |
|
private |
|
private |
|
private |
Checks if the value returned from the read function is an actual error or just the side-effect of a nullable field.
pos | the position of the field to check. |
n_read_bytes | number of read bytes, returned from the read function. |
FIELD_VALUE_NOT_NULL
if the number of read bytes is bigger or equal than 0 or the column is not nullable. FIELD_VALUE_IS_NULL
if the number of read bytes is 0 and the columns is nullable. FAILURE
if the number of read bytes is lower than 0.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
staticprivate |
Returns the number of files that corresponds to param_info_fname.
If param_info_fname is a regular expression, expression
is set.
[in] | nparam | Number of fields in the file. |
[in] | param_pattern_fname | File's name. |
[in] | indexed | indicates whether the file is indexed and if so there is a range to count in. |
[in] | nullable_bitmap | bitmap that holds the fields that are allowed to be NULL . |
[out] | counter | Number of files found. |
false | Success |
true | Error |
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
staticprivate |
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Setter needed to set nullable fields to NULL
.
pos | the index of the field to set to NULL . |
value | unused value, needed to desimbiguate polimorphism. |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Setter needed to set nullable fields to NULL
.
pos | the index of the field to set to NULL . |
value | unused value, needed to desimbiguate polimorphism. |
size | unused value size, needed to desimbiguate polimorphism. |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
overrideprivatevirtual |
Implements Rpl_info_handler.
|
private |
|
friend |
|
private |
|
private |
|
private |
This uniquely identifies a file.
When introducing multi-master replication one needs to ensure that files' names are unique. If tables are used, there is no issue at all. It is highly recommend to avoid using files as they do not provide an atomic behavior.
|
private |
|
private |
This is used to identified a name's pattern.
For instance, worker-relay-log.info.*.