23#ifndef RPL_INFO_HANDLER_H
24#define RPL_INFO_HANDLER_H
180 template <
class TypeHandler>
189 template <
class TypeHandler>
190 bool set_info(TypeHandler
const value,
const size_t size) {
210 template <
class TypeHandler>
211 bool set_info(
int pk_cursor, TypeHandler
const value) {
212 if (pk_cursor >=
ninfo)
return true;
230 template <
class TypeHandlerPo
inter,
class TypeHandler>
232 TypeHandler
const default_value) {
263 template <
class TypeHandler>
265 TypeHandler value,
const size_t size,
266 std::add_const_t<std::remove_pointer_t<TypeHandler>> *default_value) {
411 const size_t size) = 0;
416 virtual bool do_set_info(
const int pos,
const std::nullptr_t value) = 0;
417 virtual bool do_set_info(
const int pos,
const std::nullptr_t value,
418 const size_t size) = 0;
421 const char *default_value) = 0;
424 const uchar *default_value) = 0;
426 const ulong default_value) = 0;
428 const int default_value) = 0;
430 const float default_value) = 0;
Definition: rpl_info_factory.h:43
Definition: rpl_info_handler.h:57
void set_sync_period(uint period)
Configures the number of events after which the info (e.g.
Definition: rpl_info_handler.cc:64
uint get_rpl_info_type()
Gets the type of the repository that is used.
Definition: rpl_info_handler.h:163
virtual int do_init_info(uint instance)=0
enum_return_check check_info()
Checks the repository's status.
Definition: rpl_info_handler.h:96
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.
Definition: rpl_info_handler.h:264
virtual bool do_set_info(const int pos, const float value)=0
virtual bool do_set_info(const int pos, const uchar *value, const size_t size)=0
virtual enum_field_get_status do_get_info(const int pos, char *value, const size_t size, const char *default_value)=0
int clean_info()
Deletes any information in the repository.
Definition: rpl_info_handler.h:133
enum_field_get_status get_info(Server_ids *value, const Server_ids *default_value)
Returns the value of a Server_id field.
Definition: rpl_info_handler.h:290
Rpl_info_values * field_values
Definition: rpl_info_handler.h:357
virtual int do_init_info()=0
virtual int do_remove_info()=0
virtual bool do_update_is_transactional()=0
virtual bool do_set_info(const int pos, const std::nullptr_t value, const size_t size)=0
MY_BITMAP nullable_fields
Bitset holding which of the fields are allowed to be NULL.
Definition: rpl_info_handler.h:386
bool prv_error
Definition: rpl_info_handler.h:369
virtual int do_flush_info(const bool force)=0
virtual bool do_set_info(const int pos, const ulong value)=0
bool is_field_nullable(int pos)
Checks whether or not the field at position pos is allowed to be NULL.
Definition: rpl_info_handler.cc:80
virtual enum_field_get_status do_get_info(const int pos, int *value, const int default_value)=0
virtual bool do_set_info(const int pos, const char *value)=0
uint sync_counter
Definition: rpl_info_handler.h:376
virtual int do_prepare_info_for_read()=0
virtual enum_return_check do_check_info()=0
virtual enum_field_get_status do_get_info(const int pos, float *value, const float default_value)=0
char * get_description_info()
Returns a string describing the repository.
Definition: rpl_info_handler.h:325
Rpl_info_handler & operator=(const Rpl_info_handler &handler)=delete
enum_field_get_status prv_get_error
Definition: rpl_info_handler.h:370
bool set_info(TypeHandler const value)
Sets the value of a field to value.
Definition: rpl_info_handler.h:181
int prepare_info_for_read()
Enables the storage system to receive reads, i.e.
Definition: rpl_info_handler.h:147
enum_field_get_status get_info(TypeHandlerPointer value, TypeHandler const default_value)
Returns the value of a field.
Definition: rpl_info_handler.h:231
virtual bool do_is_transactional()=0
const char * get_rpl_info_type_str()
Returns a string corresponding to the type.
Definition: rpl_info_handler.cc:66
int get_number_info()
Returns the number of fields handled by this handler.
Definition: rpl_info_handler.h:307
int ninfo
Definition: rpl_info_handler.h:363
int init_info()
After creating an object and assembling components, this method is used to initialize internal struct...
Definition: rpl_info_handler.h:84
bool update_is_transactional()
Updates the value returned by the member function is_transactional() because it may be expensive to c...
Definition: rpl_info_handler.h:350
virtual uint do_get_rpl_info_type()=0
int flush_info(const bool force)
Flushes and syncs in-memory information into a stable storage (i.e.
Definition: rpl_info_handler.h:114
virtual bool do_set_info(const int pos, const int value)=0
virtual int do_clean_info()=0
int remove_info()
Deletes any information in it and in some cases the repository.
Definition: rpl_info_handler.h:124
void end_info()
Closes access to the repository.
Definition: rpl_info_handler.h:138
Rpl_info_handler(const Rpl_info_handler &handler)=delete
virtual enum_field_get_status do_get_info(const int pos, uchar *value, const size_t size, const uchar *default_value)=0
virtual enum_field_get_status do_get_info(const int pos, Server_ids *value, const Server_ids *default_value)=0
enum_field_get_status
Definition: rpl_info_handler.h:65
virtual ~Rpl_info_handler()
Definition: rpl_info_handler.cc:59
virtual int do_prepare_info_for_write()=0
int prepare_info_for_write()
Enables the storage system to receive writes, i.e.
Definition: rpl_info_handler.h:156
virtual bool do_set_info(const int pos, const std::nullptr_t value)=0
virtual bool do_set_info(const int pos, const Server_ids *value)=0
bool set_info(TypeHandler const value, const size_t size)
Definition: rpl_info_handler.h:190
virtual enum_return_check do_check_info(uint instance)=0
bool is_transactional()
Any transactional repository may have its updates rolled back in case of a failure.
Definition: rpl_info_handler.h:335
uint sync_period
Definition: rpl_info_handler.h:381
virtual enum_field_get_status do_get_info(const int pos, ulong *value, const ulong default_value)=0
virtual char * do_get_description_info()=0
virtual void do_end_info()=0
bool set_info(int pk_cursor, TypeHandler const value)
set the value of a field pointed at pk_cursor to @ value.
Definition: rpl_info_handler.h:211
int cursor
Definition: rpl_info_handler.h:366
Definition: rpl_info_values.h:30
Definition: dynamic_ids.h:32
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4365
Some integer typedefs for easier portability.
unsigned char uchar
Definition: my_inttypes.h:51
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:60
ulong w_rr
Definition: rpl_rli_pdb.cc:77
enum_info_repository
Definition: rpl_info_handler.h:36
@ INFO_REPOSITORY_FILE
Definition: rpl_info_handler.h:37
@ INFO_REPOSITORY_TABLE
Definition: rpl_info_handler.h:38
@ INVALID_INFO_REPOSITORY
Definition: rpl_info_handler.h:44
@ INFO_REPOSITORY_DUMMY
Definition: rpl_info_handler.h:39
bool operator!(Rpl_info_handler::enum_field_get_status status)
Definition: rpl_info_handler.cc:29
enum_return_check
Definition: rpl_info_handler.h:50
@ ERROR_CHECKING_REPOSITORY
Definition: rpl_info_handler.h:53
@ REPOSITORY_EXISTS
Definition: rpl_info_handler.h:52
@ REPOSITORY_DOES_NOT_EXIST
Definition: rpl_info_handler.h:51
@ REPOSITORY_CLEARED
Definition: rpl_info_handler.h:54
uint mta_debug_concurrent_access
Definition: rpl_rli_pdb.cc:78
Definition: my_bitmap.h:42
unsigned int uint
Definition: uca9-dump.cc:74