MySQL 9.3.0
Source Code Documentation
handler_db_object_table.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2021, 2025, 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 ROUTER_SRC_REST_MRS_SRC_MRS_ENDPOINT_HANDLER_HANDLER_DB_OBJECT_TABLE_H_
27#define ROUTER_SRC_REST_MRS_SRC_MRS_ENDPOINT_HANDLER_HANDLER_DB_OBJECT_TABLE_H_
28
29#include <memory>
30#include <optional>
31#include <string>
32#include <vector>
33
41#include "mrs/gtid_manager.h"
42#include "mrs/rest/handler.h"
44
45namespace mrs {
46namespace endpoint {
47namespace handler {
48
50 public:
54 using DbObjectPtr = std::shared_ptr<DbObject>;
55 using DbSchemaPtr = std::shared_ptr<DbSchema>;
56 using DbServicePtr = std::shared_ptr<DbService>;
59 std::shared_ptr<mrs::ItemEndpointResponseCache>;
61
62 public:
63 HandlerDbObjectTable(std::weak_ptr<DbObjectEndpoint> endpoint,
65 mrs::GtidManager *gtid_manager = nullptr,
66 collector::MysqlCacheManager *cache = nullptr,
67 mrs::ResponseCache *response_cache = nullptr,
68 mrs::database::SlowQueryMonitor *slow_monitor = nullptr);
69
71 UniversalId get_service_id() const override;
72 UniversalId get_db_object_id() const override;
73 UniversalId get_schema_id() const override;
74 const std::string &get_service_path() const override;
75 const std::string &get_db_object_path() const override;
76 const std::string &get_schema_path() const override;
77
78 void authorization(rest::RequestContext *ctxt) override;
79
82 const std::vector<uint8_t> &document) override;
85
86 uint32_t get_access_rights() const override;
87
88 protected:
93
94 uint64_t get_items_on_page() const;
97 std::shared_ptr<database::entry::Object> object) const;
98
99 uint64_t slow_query_timeout() const;
100
103 std::weak_ptr<DbObjectEndpoint> endpoint_;
111};
112
113} // namespace handler
114} // namespace endpoint
115} // namespace mrs
116
117#endif // ROUTER_SRC_REST_MRS_SRC_MRS_ENDPOINT_HANDLER_HANDLER_DB_OBJECT_TABLE_H_
Definition: cache_manager.h:41
Definition: mysql_cache_manager.h:87
MySqlCacheManager::CachedObject CachedObject
Definition: mysql_cache_manager.h:92
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4618
Definition: gtid_manager.h:50
Definition: response_cache.h:64
Definition: object_row_ownership.h:45
Definition: slow_query_monitor.h:47
Definition: db_object_endpoint.h:40
Definition: handler_db_object_table.h:49
HandlerDbObjectTable(std::weak_ptr< DbObjectEndpoint > endpoint, mrs::interface::AuthorizeManager *auth_manager, mrs::GtidManager *gtid_manager=nullptr, collector::MysqlCacheManager *cache=nullptr, mrs::ResponseCache *response_cache=nullptr, mrs::database::SlowQueryMonitor *slow_monitor=nullptr)
Definition: handler_db_object_table.cc:272
HttpResult handle_delete(rest::RequestContext *ctxt) override
Definition: handler_db_object_table.cc:558
std::shared_ptr< DbObject > DbObjectPtr
Definition: handler_db_object_table.h:54
uint32_t get_access_rights() const override
Definition: handler_db_object_table.cc:746
Authorization requires_authentication() const override
Definition: handler_db_object_table.cc:716
mrs::database::entry::DbObject DbObject
Definition: handler_db_object_table.h:51
void authorization(rest::RequestContext *ctxt) override
Definition: handler_db_object_table.cc:313
DbObjectPtr entry_
Definition: handler_db_object_table.h:104
std::weak_ptr< DbObjectEndpoint > endpoint_
Definition: handler_db_object_table.h:103
UniversalId get_schema_id() const override
Definition: handler_db_object_table.cc:726
EndpointResponseCachePtr response_cache_
Definition: handler_db_object_table.h:108
bool passthrough_db_user_
Definition: handler_db_object_table.h:110
std::shared_ptr< mrs::ItemEndpointResponseCache > EndpointResponseCachePtr
Definition: handler_db_object_table.h:59
mrs::database::entry::DbService DbService
Definition: handler_db_object_table.h:53
HttpResult handle_put(rest::RequestContext *ctxt) override
Definition: handler_db_object_table.cc:654
UniversalId get_service_id() const override
Definition: handler_db_object_table.cc:722
uint64_t get_items_on_page() const
Definition: handler_db_object_table.cc:750
collector::MysqlCacheManager * cache_
Definition: handler_db_object_table.h:102
CachedSession get_session(rest::RequestContext *ctxt, collector::MySQLConnection type=collector::MySQLConnection::kMySQLConnectionUserdataRO)
Definition: handler_db_object_table.cc:773
const std::string & get_service_path() const override
Definition: handler_db_object_table.cc:734
mrs::database::entry::RowUserOwnership ownership_
Definition: handler_db_object_table.h:107
mrs::database::SlowQueryMonitor * slow_monitor_
Definition: handler_db_object_table.h:109
HttpResult handle_post(rest::RequestContext *ctxt, const std::vector< uint8_t > &document) override
Post is insert.
Definition: handler_db_object_table.cc:493
const std::string & get_schema_path() const override
Definition: handler_db_object_table.cc:742
const std::string & get_db_object_path() const override
Definition: handler_db_object_table.cc:738
uint64_t slow_query_timeout() const
Definition: handler_db_object_table.cc:317
DbSchemaPtr schema_entry_
Definition: handler_db_object_table.h:105
mrs::database::entry::DbSchema DbSchema
Definition: handler_db_object_table.h:52
mrs::GtidManager * gtid_manager_
Definition: handler_db_object_table.h:101
DbServicePtr service_entry_
Definition: handler_db_object_table.h:106
mrs::database::ObjectRowOwnership row_ownership_info(rest::RequestContext *ctxt, std::shared_ptr< database::entry::Object > object) const
Definition: handler_db_object_table.cc:759
std::shared_ptr< DbService > DbServicePtr
Definition: handler_db_object_table.h:56
std::shared_ptr< DbSchema > DbSchemaPtr
Definition: handler_db_object_table.h:55
UniversalId get_db_object_id() const override
Definition: handler_db_object_table.cc:730
HttpResult handle_get(rest::RequestContext *ctxt) override
Definition: handler_db_object_table.cc:324
Definition: authorize_manager.h:58
Authorization
Definition: rest_handler.h:142
Definition: handler.h:42
MySQLConnection
Definition: mysql_cache_manager.h:41
@ kMySQLConnectionUserdataRO
Definition: mysql_cache_manager.h:43
DbSchemaEndpoint::DbSchema DbSchema
Definition: db_schema_endpoint.cc:37
DbObjectEndpoint::DbObject DbObject
Definition: db_object_endpoint.cc:35
ContentFileEndpoint::UniversalId UniversalId
Definition: content_file_endpoint.cc:39
DbServiceEndpoint::DbService DbService
Definition: db_service_endpoint.cc:45
Definition: authorize_manager.h:48
required string type
Definition: replication_group_member_actions.proto:34
Definition: row_user_ownership.h:35
Definition: http_result.h:37
Definition: request_context.h:47