MySQL 8.0.39
Source Code Documentation
|
This is a group of all component service APIs. More...
Modules | |
Keyring component services | |
MySQL string services | |
Table Access services | |
Classes | |
struct | s_mysql_mysql_audit_api_connection |
A service to generate Audit API events of the connection class (MYSQL_AUDIT_CONNECTION_CLASS). More... | |
struct | s_mysql_mysql_audit_api_connection_with_error |
A service to generate Audit API events of the connection class (MYSQL_AUDIT_CONNECTION_CLASS) with the explicitly specified error code value. More... | |
struct | s_mysql_component_sys_variable_register |
Service to register variable and get variable value. More... | |
struct | s_mysql_component_sys_variable_unregister |
Service to unregister variable. More... | |
struct | s_mysql_group_replication_message_service_send |
A service that sends content agnostic messages from a member to the group. More... | |
struct | s_mysql_group_replication_status_service_v1 |
A service to get the status of a member of Group Replication. More... | |
struct | s_mysql_host_application_signal |
A service to deliver a signal to host application. More... | |
struct | s_mysql_mysql_keyring_iterator |
Keyring iterator component service definition, which enables to iterate over items stored within currently used keyring. More... | |
struct | s_mysql_mysql_admin_session |
A service to create an "admin" session that's not a subject to max connection count limits. More... | |
struct | s_mysql_mysql_audit_print_service_double_data_source |
Audit print service allows to obtain data of the double type associated with the THD object, which keeps various data of the user session. More... | |
struct | s_mysql_mysql_audit_print_service_longlong_data_source |
Audit print service allows to obtain data of the long long type associated with the THD object, which keeps various data of the user session. More... | |
struct | s_mysql_mysql_authentication_registration |
A service to do registration of fido device. More... | |
struct | s_mysql_mysql_text_consumer_factory_v1 |
An implementation of these services will be called as the data resulting from calling mysql_query() service are produced by the server. More... | |
struct | s_mysql_mysql_text_consumer_metadata_v1 |
A service that provides the apis for start_result_metadata, field_metadata, and end_result_metadata. More... | |
struct | s_mysql_mysql_text_consumer_row_factory_v1 |
A service that provides the apis for start_row, abort_row and end_row. More... | |
struct | s_mysql_mysql_text_consumer_error_v1 |
A service that provides the apis for handle_ok, handle_error and error. More... | |
struct | s_mysql_mysql_text_consumer_get_null_v1 |
A service that provides the apis for get_null. More... | |
struct | s_mysql_mysql_text_consumer_get_integer_v1 |
A service that provides the apis for get_integer. More... | |
struct | s_mysql_mysql_text_consumer_get_longlong_v1 |
A service that provides the apis for get_longlong. More... | |
struct | s_mysql_mysql_text_consumer_get_decimal_v1 |
A service that provides the apis for get_decimal. More... | |
struct | s_mysql_mysql_text_consumer_get_double_v1 |
A service that provides the apis for get_double. More... | |
struct | s_mysql_mysql_text_consumer_get_date_time_v1 |
A service that provides the apis for get_date, get_time and get_datatime. More... | |
struct | s_mysql_mysql_text_consumer_get_string_v1 |
A service that provides the apis for get_string. More... | |
struct | s_mysql_mysql_text_consumer_client_capabilities_v1 |
A service that provides the apis for client_capabilities. More... | |
struct | s_mysql_mysql_command_factory |
A service that provides the apis for mysql command init, info, connect, reset, close, commit, auto_commit and rollback. More... | |
struct | s_mysql_mysql_command_thread |
A service that provides the apis for mysql command session thread init and thread end. More... | |
struct | s_mysql_mysql_command_options |
A service that provides the apis for mysql command get_option and set_option. More... | |
struct | s_mysql_mysql_command_query |
A service that provides the apis for mysql command query and affected_rows. More... | |
struct | s_mysql_mysql_command_query_result |
A service that provides the apis for mysql command, store_result, free_result, more_results, next_result, result_metadata and fetch_row. More... | |
struct | s_mysql_mysql_command_field_info |
A service that provides the apis for mysql command field info, fetch_field, num_fields, fetch_fields and field_count. More... | |
struct | s_mysql_mysql_command_field_metadata |
Fetch the metadata of a service. More... | |
struct | s_mysql_mysql_command_error_info |
A service that provides the apis for mysql command error info, mysql_errno, error, sqlstate. More... | |
struct | s_mysql_mysql_current_thread_reader |
A service to fetch the current thread id. More... | |
struct | s_mysql_mysql_keyring_native_key_id |
A service to read native keybackend id. More... | |
struct | s_mysql_mysql_query_attributes_iterator |
A service to fetch the query attributes for the current thread. More... | |
struct | s_mysql_mysql_query_attribute_string |
A service to fetch the query attribute value as a string. More... | |
struct | s_mysql_mysql_query_attribute_isnull |
A service to fetch the query attribute null flag. More... | |
struct | s_mysql_mysql_scheduler |
The Scheduler queueing interface. More... | |
struct | s_mysql_mysql_scheduler_notify |
Notification service for the scheduler customers. More... | |
struct | s_mysql_mysql_status_variable_string |
Service to read the value of a status variable as a string. More... | |
struct | s_mysql_mysql_system_variable_update_string |
Service to set the value of system variables. More... | |
struct | s_mysql_mysql_system_variable_update_integer |
Service to set the value of integer system variables. More... | |
struct | s_mysql_mysql_system_variable_update_default |
Service to set the default value of system variables. More... | |
struct | s_mysql_mysql_thd_attributes |
THD Attributes service allows to obtain data associated with the THD object, which keeps various attributes of the user session. More... | |
struct | s_mysql_psi_tls_channel_v1 |
Service for instrumentation of TLS channel in performance schema. More... | |
struct | s_mysql_reference_caching_channel |
A reference caching channel service. More... | |
struct | s_mysql_validate_password |
Interfaces to enforce a password policy. More... | |
struct | s_mysql_validate_password_changed_characters |
Service to enforce that new password contains N different characters compared to existing password. More... | |
Typedefs | |
typedef struct s_mysql_mysql_audit_api_connection | mysql_service_mysql_audit_api_connection_t |
A service to generate Audit API events of the connection class (MYSQL_AUDIT_CONNECTION_CLASS). More... | |
typedef struct s_mysql_mysql_audit_api_connection_with_error | mysql_service_mysql_audit_api_connection_with_error_t |
A service to generate Audit API events of the connection class (MYSQL_AUDIT_CONNECTION_CLASS) with the explicitly specified error code value. More... | |
typedef struct s_mysql_component_sys_variable_register | mysql_service_component_sys_variable_register_t |
Service to register variable and get variable value. More... | |
typedef struct s_mysql_component_sys_variable_unregister | mysql_service_component_sys_variable_unregister_t |
Service to unregister variable. More... | |
typedef struct s_mysql_group_replication_message_service_send | mysql_service_group_replication_message_service_send_t |
A service that sends content agnostic messages from a member to the group. More... | |
typedef struct s_mysql_group_replication_status_service_v1 | mysql_service_group_replication_status_service_v1_t |
A service to get the status of a member of Group Replication. More... | |
typedef struct s_mysql_host_application_signal | mysql_service_host_application_signal_t |
A service to deliver a signal to host application. More... | |
typedef struct s_mysql_mysql_keyring_iterator | mysql_service_mysql_keyring_iterator_t |
Keyring iterator component service definition, which enables to iterate over items stored within currently used keyring. More... | |
typedef struct s_mysql_mysql_admin_session | mysql_service_mysql_admin_session_t |
A service to create an "admin" session that's not a subject to max connection count limits. More... | |
typedef struct s_mysql_mysql_audit_print_service_double_data_source | mysql_service_mysql_audit_print_service_double_data_source_t |
Audit print service allows to obtain data of the double type associated with the THD object, which keeps various data of the user session. More... | |
typedef struct s_mysql_mysql_audit_print_service_longlong_data_source | mysql_service_mysql_audit_print_service_longlong_data_source_t |
Audit print service allows to obtain data of the long long type associated with the THD object, which keeps various data of the user session. More... | |
typedef struct s_mysql_mysql_authentication_registration | mysql_service_mysql_authentication_registration_t |
A service to do registration of fido device. More... | |
typedef struct s_mysql_mysql_text_consumer_factory_v1 | mysql_service_mysql_text_consumer_factory_v1_t |
An implementation of these services will be called as the data resulting from calling mysql_query() service are produced by the server. More... | |
typedef struct s_mysql_mysql_text_consumer_metadata_v1 | mysql_service_mysql_text_consumer_metadata_v1_t |
A service that provides the apis for start_result_metadata, field_metadata, and end_result_metadata. More... | |
typedef struct s_mysql_mysql_text_consumer_row_factory_v1 | mysql_service_mysql_text_consumer_row_factory_v1_t |
A service that provides the apis for start_row, abort_row and end_row. More... | |
typedef struct s_mysql_mysql_text_consumer_error_v1 | mysql_service_mysql_text_consumer_error_v1_t |
A service that provides the apis for handle_ok, handle_error and error. More... | |
typedef struct s_mysql_mysql_text_consumer_get_null_v1 | mysql_service_mysql_text_consumer_get_null_v1_t |
A service that provides the apis for get_null. More... | |
typedef struct s_mysql_mysql_text_consumer_get_integer_v1 | mysql_service_mysql_text_consumer_get_integer_v1_t |
A service that provides the apis for get_integer. More... | |
typedef struct s_mysql_mysql_text_consumer_get_longlong_v1 | mysql_service_mysql_text_consumer_get_longlong_v1_t |
A service that provides the apis for get_longlong. More... | |
typedef struct s_mysql_mysql_text_consumer_get_decimal_v1 | mysql_service_mysql_text_consumer_get_decimal_v1_t |
A service that provides the apis for get_decimal. More... | |
typedef struct s_mysql_mysql_text_consumer_get_double_v1 | mysql_service_mysql_text_consumer_get_double_v1_t |
A service that provides the apis for get_double. More... | |
typedef struct s_mysql_mysql_text_consumer_get_date_time_v1 | mysql_service_mysql_text_consumer_get_date_time_v1_t |
A service that provides the apis for get_date, get_time and get_datatime. More... | |
typedef struct s_mysql_mysql_text_consumer_get_string_v1 | mysql_service_mysql_text_consumer_get_string_v1_t |
A service that provides the apis for get_string. More... | |
typedef struct s_mysql_mysql_text_consumer_client_capabilities_v1 | mysql_service_mysql_text_consumer_client_capabilities_v1_t |
A service that provides the apis for client_capabilities. More... | |
typedef struct s_mysql_mysql_command_factory | mysql_service_mysql_command_factory_t |
A service that provides the apis for mysql command init, info, connect, reset, close, commit, auto_commit and rollback. More... | |
typedef struct s_mysql_mysql_command_thread | mysql_service_mysql_command_thread_t |
A service that provides the apis for mysql command session thread init and thread end. More... | |
typedef struct s_mysql_mysql_command_options | mysql_service_mysql_command_options_t |
A service that provides the apis for mysql command get_option and set_option. More... | |
typedef struct s_mysql_mysql_command_query | mysql_service_mysql_command_query_t |
A service that provides the apis for mysql command query and affected_rows. More... | |
typedef struct s_mysql_mysql_command_query_result | mysql_service_mysql_command_query_result_t |
A service that provides the apis for mysql command, store_result, free_result, more_results, next_result, result_metadata and fetch_row. More... | |
typedef struct s_mysql_mysql_command_field_info | mysql_service_mysql_command_field_info_t |
A service that provides the apis for mysql command field info, fetch_field, num_fields, fetch_fields and field_count. More... | |
typedef struct s_mysql_mysql_command_field_metadata | mysql_service_mysql_command_field_metadata_t |
Fetch the metadata of a service. More... | |
typedef struct s_mysql_mysql_command_error_info | mysql_service_mysql_command_error_info_t |
A service that provides the apis for mysql command error info, mysql_errno, error, sqlstate. More... | |
typedef const char * | my_h_connection_attributes_iterator |
A service to read the connection attributes from the current session It provides a read-only iterator over the attributes. More... | |
typedef struct s_mysql_mysql_current_thread_reader | mysql_service_mysql_current_thread_reader_t |
A service to fetch the current thread id. More... | |
typedef struct s_mysql_mysql_keyring_native_key_id | mysql_service_mysql_keyring_native_key_id_t |
A service to read native keybackend id. More... | |
typedef struct s_mysql_mysql_query_attributes_iterator | mysql_service_mysql_query_attributes_iterator_t |
A service to fetch the query attributes for the current thread. More... | |
typedef struct s_mysql_mysql_query_attribute_string | mysql_service_mysql_query_attribute_string_t |
A service to fetch the query attribute value as a string. More... | |
typedef struct s_mysql_mysql_query_attribute_isnull | mysql_service_mysql_query_attribute_isnull_t |
A service to fetch the query attribute null flag. More... | |
typedef struct s_mysql_mysql_scheduler | mysql_service_mysql_scheduler_t |
The Scheduler queueing interface. More... | |
typedef struct s_mysql_mysql_scheduler_notify | mysql_service_mysql_scheduler_notify_t |
Notification service for the scheduler customers. More... | |
typedef struct s_mysql_mysql_status_variable_string | mysql_service_mysql_status_variable_string_t |
Service to read the value of a status variable as a string. More... | |
typedef struct s_mysql_mysql_system_variable_update_string | mysql_service_mysql_system_variable_update_string_t |
Service to set the value of system variables. More... | |
typedef struct s_mysql_mysql_system_variable_update_integer | mysql_service_mysql_system_variable_update_integer_t |
Service to set the value of integer system variables. More... | |
typedef struct s_mysql_mysql_system_variable_update_default | mysql_service_mysql_system_variable_update_default_t |
Service to set the default value of system variables. More... | |
typedef struct s_mysql_mysql_thd_attributes | mysql_service_mysql_thd_attributes_t |
THD Attributes service allows to obtain data associated with the THD object, which keeps various attributes of the user session. More... | |
typedef struct s_mysql_psi_tls_channel_v1 | mysql_service_psi_tls_channel_v1_t |
Service for instrumentation of TLS channel in performance schema. More... | |
typedef struct s_mysql_reference_caching_channel | mysql_service_reference_caching_channel_t |
A reference caching channel service. More... | |
typedef struct s_mysql_validate_password | mysql_service_validate_password_t |
Interfaces to enforce a password policy. More... | |
typedef struct s_mysql_validate_password_changed_characters | mysql_service_validate_password_changed_characters_t |
Service to enforce that new password contains N different characters compared to existing password. More... | |
This is a group of all component service APIs.
See A Service and a Service Implementation for explanation of what a component service is
typedef const char* my_h_connection_attributes_iterator |
A service to read the connection attributes from the current session It provides a read-only iterator over the attributes.
This is some example code to use the iterator:
typedef struct s_mysql_component_sys_variable_register mysql_service_component_sys_variable_register_t |
Service to register variable and get variable value.
typedef struct s_mysql_component_sys_variable_unregister mysql_service_component_sys_variable_unregister_t |
Service to unregister variable.
Make sure to call this for each variable registered.
typedef struct s_mysql_group_replication_message_service_send mysql_service_group_replication_message_service_send_t |
A service that sends content agnostic messages from a member to the group.
This only works if the component is on a server with group replication running and the member state is ONLINE. If server isn't ONLINE message won't be deliver.
After message sent to all members of the group, all components that have registered group_replication_message_service_recv service will be notified.
typedef struct s_mysql_group_replication_status_service_v1 mysql_service_group_replication_status_service_v1_t |
A service to get the status of a member of Group Replication.
This is only available if the component is on a server with Group Replication plugin installed.
A service to deliver a signal to host application.
Typically there'll be just one implementation of this by the main application.
Other parties interested in listening to shutdown may override the default implementation with a broadcast one and have multiple implementations receiving the shutdown signal. Or do message queueing to a set of background threads etc.
typedef struct s_mysql_mysql_admin_session mysql_service_mysql_admin_session_t |
A service to create an "admin" session that's not a subject to max connection count limits.
This service is an extension to the sessions plugin service suite. The MYSQL_SESSION references are compatible with the plugin service.
A service to generate Audit API events of the connection class (MYSQL_AUDIT_CONNECTION_CLASS).
The emit method generates the event in the synchronous way, causing all subscribers to receive it.
typedef struct s_mysql_mysql_audit_api_connection_with_error mysql_service_mysql_audit_api_connection_with_error_t |
A service to generate Audit API events of the connection class (MYSQL_AUDIT_CONNECTION_CLASS) with the explicitly specified error code value.
This service should ONLY be used if we cannot set the THD's Statement Diagnostic Area result code, which is passed along the audit notification chain. The preferred way of generating the event is to rely on THD's internal data as much as possible (mysql_audit_api_connection service)
The emit method generates the event in the synchronous way, causing all subscribers to receive it.
typedef struct s_mysql_mysql_audit_print_service_double_data_source mysql_service_mysql_audit_print_service_double_data_source_t |
Audit print service allows to obtain data of the double type associated with the THD object, which keeps various data of the user session.
It also allows to obtain data not necessarily bound with the user session.
Currently, following data is supported:
The service can be instantiated using the registry service with the "mysql_audit_print_service_double_data_source" name.
Query Time represents query execution time in seconds.
typedef struct s_mysql_mysql_audit_print_service_longlong_data_source mysql_service_mysql_audit_print_service_longlong_data_source_t |
Audit print service allows to obtain data of the long long type associated with the THD object, which keeps various data of the user session.
It also allows to obtain data not necessarily bound with the user session.
Currently, following data is supported:
The service can be instantiated using the registry service with the "mysql_audit_print_service_double_data_source" name.
Query Time represents query execution time in microseconds.
typedef struct s_mysql_mysql_authentication_registration mysql_service_mysql_authentication_registration_t |
A service to do registration of fido device.
A service that provides the apis for mysql command error info, mysql_errno, error, sqlstate.
A service that provides the apis for mysql command init, info, connect, reset, close, commit, auto_commit and rollback.
A service that provides the apis for mysql command field info, fetch_field, num_fields, fetch_fields and field_count.
Fetch the metadata of a service.
Usually used as follows:
A service that provides the apis for mysql command get_option and set_option.
A service that provides the apis for mysql command, store_result, free_result, more_results, next_result, result_metadata and fetch_row.
typedef struct s_mysql_mysql_command_query mysql_service_mysql_command_query_t |
A service that provides the apis for mysql command query and affected_rows.
typedef struct s_mysql_mysql_command_thread mysql_service_mysql_command_thread_t |
A service that provides the apis for mysql command session thread init and thread end.
A service to fetch the current thread id.
Use in conjunction with all the related services that operate on thread ids
Keyring iterator component service definition, which enables to iterate over items stored within currently used keyring.
A service to read native keybackend id.
Typically there'll be just one implementation of this by the main application.
A service to fetch the query attribute null flag.
Use in conjunction with mysql_query_atrributes_iterator service
A service to fetch the query attribute value as a string.
Use in conjunction with mysql_query_atrributes_iterator service
typedef struct s_mysql_mysql_query_attributes_iterator mysql_service_mysql_query_attributes_iterator_t |
A service to fetch the query attributes for the current thread.
Use in conjunction with all the related services that operate on thread ids
Notification service for the scheduler customers.
The scheduler will broadcast this at important events of its operation that may be of interest to customers. Currently only supports STARTED event: When the scheduler starts some of its "customers" may be already loaded and have allowed delayed initialization. To avoid polling for scheduler implementations, the scheduler will broadcast to all implementations of this service at its startup so they can register their scheduled tasks. This is useful for e.g. customers loading prior to the scheduler and willing to register their tasks when the scheduler is present.
typedef struct s_mysql_mysql_scheduler mysql_service_mysql_scheduler_t |
The Scheduler queueing interface.
This is a service that will allow registering a callback to be called every X seconds.
Each callback has a name. And a comment for the DBA to check.
A caller registers a callback together with its argument and gets a handle back. The callback will be put in rotation immediately and will be called after the defined interval. And it will keep being called until it's unregisterered using the handle.
Passing an argument is useful if you are to reuse the callback function to operate on many different states through registering it in multiple scheduled events. Having the argument passed down from the registering code to the callback saves the need of the callback to consult a global structure in a multi- thread safe fashion.
To use it one would do something like this:
Service to read the value of a status variable as a string.
Used approximately as follows:
typedef struct s_mysql_mysql_system_variable_update_default mysql_service_mysql_system_variable_update_default_t |
Service to set the default value of system variables.
This is an example of using the service:
typedef struct s_mysql_mysql_system_variable_update_integer mysql_service_mysql_system_variable_update_integer_t |
Service to set the value of integer system variables.
Passing non-NULL THD input to setter methods means that the operation will be executed within the scope of existing transaction, thus any operation side effects impacting transaction itself (for example it may generate an SQL error that it stores into the current THD). If using existing THD, security context of the thread is checked to make sure that required privileges exist. Passing NULL makes a temporary THD created as a execution context (and destroyed afterwards), i.e. no impacts on existing transactions. It doesn't make sense to change SESSION variable on a temporary THD, so this operation will generate error.
This is an example of using the service:
typedef struct s_mysql_mysql_system_variable_update_string mysql_service_mysql_system_variable_update_string_t |
Service to set the value of system variables.
This is an example of using the service:
typedef struct s_mysql_mysql_text_consumer_client_capabilities_v1 mysql_service_mysql_text_consumer_client_capabilities_v1_t |
A service that provides the apis for client_capabilities.
A service that provides the apis for handle_ok, handle_error and error.
typedef struct s_mysql_mysql_text_consumer_factory_v1 mysql_service_mysql_text_consumer_factory_v1_t |
An implementation of these services will be called as the data resulting from calling mysql_query() service are produced by the server.
Most often the default implementation of this service that will cache the data into a memory structure into the MYSQL handle will be used. But this will only work if the resultset expected is relatively small.
If one wants to avoid the memory caching and process the data SAX style as they are returned by the SQL execution define, they should provide their own implementation of this service that will process the data differently at the time of their production.
A service that provides the apis for start and end.
typedef struct s_mysql_mysql_text_consumer_get_date_time_v1 mysql_service_mysql_text_consumer_get_date_time_v1_t |
A service that provides the apis for get_date, get_time and get_datatime.
typedef struct s_mysql_mysql_text_consumer_get_decimal_v1 mysql_service_mysql_text_consumer_get_decimal_v1_t |
A service that provides the apis for get_decimal.
typedef struct s_mysql_mysql_text_consumer_get_double_v1 mysql_service_mysql_text_consumer_get_double_v1_t |
A service that provides the apis for get_double.
and error.
typedef struct s_mysql_mysql_text_consumer_get_integer_v1 mysql_service_mysql_text_consumer_get_integer_v1_t |
A service that provides the apis for get_integer.
typedef struct s_mysql_mysql_text_consumer_get_longlong_v1 mysql_service_mysql_text_consumer_get_longlong_v1_t |
A service that provides the apis for get_longlong.
typedef struct s_mysql_mysql_text_consumer_get_null_v1 mysql_service_mysql_text_consumer_get_null_v1_t |
A service that provides the apis for get_null.
typedef struct s_mysql_mysql_text_consumer_get_string_v1 mysql_service_mysql_text_consumer_get_string_v1_t |
A service that provides the apis for get_string.
typedef struct s_mysql_mysql_text_consumer_metadata_v1 mysql_service_mysql_text_consumer_metadata_v1_t |
A service that provides the apis for start_result_metadata, field_metadata, and end_result_metadata.
typedef struct s_mysql_mysql_text_consumer_row_factory_v1 mysql_service_mysql_text_consumer_row_factory_v1_t |
A service that provides the apis for start_row, abort_row and end_row.
typedef struct s_mysql_mysql_thd_attributes mysql_service_mysql_thd_attributes_t |
THD Attributes service allows to obtain data associated with the THD object, which keeps various attributes of the user session.
Currently, following attributes are supported:
The service can be instantiated using the registry service with the "mysql_thd_attributes" name.
Query Digest represents converted SQL statement to normalized form. The code below demonstrates how query digest can be obtained from the service.
The buffer can be fetched using the code below:
After the string content has been copied into another buffer, it must be destroyed:
Query text represents complete SQL text currently being executed within a given session. The example code is identical to the one for Query Digest, the only difference is that attribute name "sql_text" should be used in this case.
Host or IP text contains host or IP (if host unavailable) belonging to a client associated with a given session. The example code is identical to the one for Query Digest, the only difference is that attribute name "host_or_ip" should be used in this case.
Schema text contains a name of database currently in use by a client associated with a given session. The example code is identical to the one for Query Digest, the only difference is that attribute name "schema" should be used in this case.
typedef struct s_mysql_psi_tls_channel_v1 mysql_service_psi_tls_channel_v1_t |
Service for instrumentation of TLS channel in performance schema.
A reference caching channel service.
The goal of this service is to ensure that event producers spend a MINIMAL amount of time in the emitting code when there are no consumers of the produced events.
An event consumer is an implementation of a component service. An event producer is a piece of code that wants to inform all currently registered event consumers about an event. A channel is a device that serves as a singleton of all reference caches for all threads that are to produce events. A reference cache is something each thread producing events must maintain for its lifetime and use it to find the references to event consumers it needs to call.
At init time the event consumer will register implementations of any of the services it's interested in receiving notifications for.
Then optionally it might force a channel invalidation to make sure all existing event producers will start sending notifications to it immediately. Or it can just sit and wait for the natural producer's reference cache refresh cycles to kick in.
Now it is receiving notifications from all event producers as they come.
When it wishes to no longer receive notifications it needs to mark itself as invisible for reference cache fill-ins. In this way all reference cache flushes will not pick this implementation up even if it's still registered in the registry.
Eventually all active references will be removed by the natural producers flush cycles. The consumer may choose to expedite this by triggering a channel invalidation.
As with all service implementations, when all references to the services are released it can unload.
An event producer will usually start at init time by creating channel(s).
Then, for each thread wishing to produce events, a reference cache must be created and maintained until the thread will no longer be producing events.
Now the thread can produce events using the reference cache. This is done by calling the get method and then iterating over the resulting set of references and calling each one in turn as one would normally do for registry service references. It is assumed that the references are owned by the cache and thus they should not be released.
With some cyclical (e.g. at the end of each statement or something) the event producing thread needs to flush the cache. This is to ensure that references to event consumers are not held for very long and that new event consumers are picked up. However flushing the cache is a relatively expensive operation and thus a balance between the number of events produced and the cache being flushed must be achieved.
Channels are something each event producer must have to produce events. Channels are to be created by a single thread before the first event is ever produced. And, once created they are to be kept until after the last event is produced.
Channels serve as singletons for caches and you only need one channel instance per event producer component. There usually will be multiple caches (one per event producing thread) per channel.
Creating and destroying a channel is a relatively "expensive" operation that might involve some synchronization and should not be done frequently.
Channels exist to allow a non-related thread to trigger invalidation of all currently active caches on that channel. This is necessary when for example event consumers are registered and are about to be removed.
Invalidating a channel is a thread-safe operation that can be invoked without synchronization at any time.
Each channel is associated with a specific set of service names.
The names are stored and used in event caches to handle all implementations of that particular service.
typedef struct s_mysql_validate_password_changed_characters mysql_service_validate_password_changed_characters_t |
Service to enforce that new password contains N different characters compared to existing password.
typedef struct s_mysql_validate_password mysql_service_validate_password_t |
Interfaces to enforce a password policy.
The policy is enfoced through two methods 1) validate() that answers the question of whether this password is good enough or not.
2) get_strength() that can be used by password changing UIs to display a password strength meter in the range of [0-100] as the user enters a password.