MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
routing_guidelines::Routing_guidelines_engine::Route Struct Reference

Class representing routing guidelines route section entry. More...

#include <routing_guidelines.h>

Classes

struct  DestinationGroup
 

Public Member Functions

 Route (std::string name, std::unique_ptr< rpn::Expression > match, std::vector< DestinationGroup > destination_groups, const std::optional< bool > connection_sharing_allowed=std::nullopt, const bool enabled=true)
 
auto operator<=> (const Route &) const =default
 

Public Attributes

std::string name
 Name of the route. More...
 
std::unique_ptr< rpn::Expressionmatch
 Matching criterion for the given route. More...
 
std::vector< DestinationGroupdestination_groups
 Destination groups used by the route. More...
 
std::optional< bool > connection_sharing_allowed
 Connection sharing enabled flag. More...
 
bool enabled {true}
 Route enabled flag. More...
 

Detailed Description

Class representing routing guidelines route section entry.

Each route references destinations that are groupped by the destination class section in the routing guideline:

"destinations": [
{
"name": "secondary_dests",
"match": "$.server.memberRole = SECONDARY"
}
]

This example provides a destination class named "secondary_dests" which matches SECONDARY nodes. Given this route:

"routes": [
{
"name": "r1",
"enabled": true,
"match": "$.router.port.ro = 6447",
"connectionSharingAllowed": true,
"destinations": [
{
"classes": ["secondary_dests"],
"strategy" : "round-robin"
"priority": 0
}
}
]

Route named "r1" uses "secondary_dests" destination class. Each node classified in the "secondary_dests" will be used according to the 'round-robin' routing strategy.

If one route entry uses multiple destination classes then nodes from each destination classes are used. For example:

"destinations": [
{
"classes": ["secondary_dests", "other_dests"],
"strategy" : "round-robin"
"priority": 0
}

Such route will use destinations classified as "secondary_dests" as well as "other_dests".

One route may define multiple backup sinks which are used when no destinations from previous groups can be reached. They are groupped by the 'priority' setting, where lower value means higher priority, '0' means highest priority.

For example:

"routes": [
{
"name": "r1",
"enabled": true,
"match": "$.router.port.ro = 6447",
"connectionSharingAllowed": true,
"destinations": [
{
"classes": ["d1", "d2"],
"strategy" : "round-robin"
"priority": 0
},
{
"classes": ["d3"],
"strategy" : "round-robin"
"priority": 1
}
]
}

Route "r1" defines two destination groups that could be used, one containing destinations classified by "d1" or "d2" destination classes, and the other one containing destinations classified by "d3" destination class. Destinations classified by "d3" will be used if and only if no destination from "d1" and "d2" are reachable.

Constructor & Destructor Documentation

◆ Route()

routing_guidelines::Routing_guidelines_engine::Route::Route ( std::string  name,
std::unique_ptr< rpn::Expression match,
std::vector< DestinationGroup destination_groups,
const std::optional< bool >  connection_sharing_allowed = std::nullopt,
const bool  enabled = true 
)

Member Function Documentation

◆ operator<=>()

auto routing_guidelines::Routing_guidelines_engine::Route::operator<=> ( const Route ) const
default

Member Data Documentation

◆ connection_sharing_allowed

std::optional<bool> routing_guidelines::Routing_guidelines_engine::Route::connection_sharing_allowed

Connection sharing enabled flag.

◆ destination_groups

std::vector<DestinationGroup> routing_guidelines::Routing_guidelines_engine::Route::destination_groups

Destination groups used by the route.

◆ enabled

bool routing_guidelines::Routing_guidelines_engine::Route::enabled {true}

Route enabled flag.

◆ match

std::unique_ptr<rpn::Expression> routing_guidelines::Routing_guidelines_engine::Route::match

Matching criterion for the given route.

◆ name

std::string routing_guidelines::Routing_guidelines_engine::Route::name

Name of the route.


The documentation for this struct was generated from the following files: