![]() |
MySQL 9.3.0
Source Code Documentation
|
Helper class used to create routing guideline from Router configuration. More...
#include <routing_guidelines_adapter.h>
Classes | |
struct | Role_info |
Information about one routing section. More... | |
Public Member Functions | |
Guidelines_from_conf_adapter (const mysql_harness::Config::ConstSectionList §ions, net::io_context &io_ctx) | |
Guidelines configuration adapter constructor. More... | |
stdx::expected< std::string, std::error_code > | generate_guidelines_string () |
Generate routing guideline based on the internal state of Guidelines_from_conf_adapter. More... | |
Private Types | |
using | JsonValue = rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::CrtAllocator > |
using | JsonDocument = rapidjson::GenericDocument< rapidjson::UTF8<>, rapidjson::CrtAllocator > |
using | JsonStringBuffer = rapidjson::GenericStringBuffer< rapidjson::UTF8<>, rapidjson::CrtAllocator > |
Private Member Functions | |
stdx::expected< void, std::error_code > | fill_guidelines_doc () |
Fill the internal routing guidelines doc. More... | |
void | add_guidelines_name () |
Add routing guidelines name section. More... | |
void | add_guidelines_version () |
Add routing guidelines version section. More... | |
void | add_destinations (const std::string §ion_name, const Guidelines_from_conf_adapter::Role_info &role_info) |
Add routing guidelines destinations section. More... | |
stdx::expected< void, std::error_code > | add_routes (const std::string §ion_name, const mysql_harness::ConfigSection *section, const Guidelines_from_conf_adapter::Role_info &role_info) |
Add routing guidelines routes section. More... | |
std::optional< Role_info > | get_role_info (const mysql_harness::ConfigSection *section) const |
Get detail info from one section. More... | |
stdx::expected< std::string, std::error_code > | get_route_match (const mysql_harness::ConfigSection *section) const |
Create route match section. More... | |
std::optional< std::string > | get_fallback_destination (const Protocol::Type protocol, std::string_view host) const |
If round-robin-with-fallback strategy is used get destination class that could be used as a fallback. More... | |
Private Attributes | |
const std::string | kDefaultName |
bool | has_routes_ {false} |
std::optional< std::string > | fallback_src_ |
const mysql_harness::Config::ConstSectionList & | sections_ |
net::io_context & | io_ctx_ |
JsonDocument | json_guidelines_doc_ |
rapidjson::CrtAllocator | allocator_ |
JsonValue | destinations_ {rapidjson::kArrayType} |
JsonValue | routes_ {rapidjson::kArrayType} |
Helper class used to create routing guideline from Router configuration.
|
private |
|
private |
|
private |
Guidelines_from_conf_adapter::Guidelines_from_conf_adapter | ( | const mysql_harness::Config::ConstSectionList & | sections, |
net::io_context & | io_ctx | ||
) |
Guidelines configuration adapter constructor.
sections | Router configuration sections |
io_ctx | IO context |
|
private |
Add routing guidelines destinations section.
|
private |
Add routing guidelines name section.
|
private |
Add routing guidelines version section.
|
private |
Add routing guidelines routes section.
|
private |
Fill the internal routing guidelines doc.
stdx::expected< std::string, std::error_code > Guidelines_from_conf_adapter::generate_guidelines_string | ( | ) |
Generate routing guideline based on the internal state of Guidelines_from_conf_adapter.
In case when there are only static routing plugins running the guidelines document will be empty.
|
private |
If round-robin-with-fallback strategy is used get destination class that could be used as a fallback.
|
private |
Get detail info from one section.
|
private |
Create route match section.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |