MySQL 9.1.0
Source Code Documentation
metadata_cache_ar.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2019, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef METADATA_CACHE_METADATA_CACHE_AR_INCLUDED
27#define METADATA_CACHE_METADATA_CACHE_AR_INCLUDED
28
30
31#include "metadata_cache.h"
32
34 public:
35 /**
36 * Initialize a connection to the MySQL Metadata server.
37 *
38 * @param router_id id of the router in the cluster metadata
39 * @param metadata_servers The servers that store the metadata
40 * @param cluster_metadata metadata of the cluster
41 * @param ttl_config metadata TTL configuration
42 * @param ssl_options SSL related options for connection
43 * @param target_cluster object identifying the Cluster this operation refers
44 * to
45 * @param router_attributes Router attributes to be registered in the metadata
46 * @param thread_stack_size The maximum memory allocated for thread's stack
47 */
49 const unsigned router_id,
50 const std::vector<mysql_harness::TCPAddress> &metadata_servers,
51 std::shared_ptr<MetaData> cluster_metadata,
53 const mysqlrouter::SSLOptions &ssl_options,
54 const mysqlrouter::TargetCluster &target_cluster,
55 const metadata_cache::RouterAttributes &router_attributes,
56 size_t thread_stack_size = mysql_harness::kDefaultStackSizeInKiloBytes)
57 : MetadataCache(router_id, "", metadata_servers, cluster_metadata,
58 ttl_config, ssl_options, target_cluster,
59 router_attributes, thread_stack_size, false) {}
60
61 bool refresh(bool needs_writable_node) override;
62
63 mysqlrouter::ClusterType cluster_type() const noexcept override {
65 }
66};
67
68#endif // METADATA_CACHE_METADATA_CACHE_AR_INCLUDED
Definition: metadata_cache_ar.h:33
ARMetadataCache(const unsigned router_id, const std::vector< mysql_harness::TCPAddress > &metadata_servers, std::shared_ptr< MetaData > cluster_metadata, const metadata_cache::MetadataCacheTTLConfig &ttl_config, const mysqlrouter::SSLOptions &ssl_options, const mysqlrouter::TargetCluster &target_cluster, const metadata_cache::RouterAttributes &router_attributes, size_t thread_stack_size=mysql_harness::kDefaultStackSizeInKiloBytes)
Initialize a connection to the MySQL Metadata server.
Definition: metadata_cache_ar.h:48
mysqlrouter::ClusterType cluster_type() const noexcept override
Definition: metadata_cache_ar.h:63
The MetadataCache manages cached information fetched from the MySQL Server.
Definition: metadata_cache.h:58
virtual bool refresh(bool needs_writable_node)=0
Refreshes the cache.
Definition: cluster_metadata.h:159
#define METADATA_CACHE_EXPORT
Definition: metadata_cache_export.h:15
static const size_t kDefaultStackSizeInKiloBytes
Definition: mysql_router_thread.h:44
ClusterType
Definition: cluster_metadata.h:140
Metadata TTL configuration.
Definition: metadata_cache.h:213
Definition: metadata_cache_datatypes.h:239
SSL connection related options.
Definition: datatypes.h:34