MySQL 9.0.0
Source Code Documentation
plugin_connection_handler.h
Go to the documentation of this file.
1#ifndef PLUGIN_CONNECTION_HANDLER_INCLUDED
2#define PLUGIN_CONNECTION_HANDLER_INCLUDED
3
4/*
5 Copyright (c) 2013, 2024, Oracle and/or its affiliates.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License, version 2.0,
9 as published by the Free Software Foundation.
10
11 This program is designed to work with certain software (including
12 but not limited to OpenSSL) that is licensed under separate terms,
13 as designated in a particular file or component or in included license
14 documentation. The authors of MySQL hereby grant you an additional
15 permission to link the program and your derivative works with the
16 separately licensed software that they have either included with
17 the program or referenced in the documentation.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License, version 2.0, for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27*/
28
29#include "mysql/thread_pool_priv.h" // Plugin_connection_handler_functions
30#include "sql/conn_handler/connection_handler.h" // Connection_handler
31
32class THD;
33
34/**
35 This is a wrapper class around global free functions implemented
36 by connection handler plugins (e.g. thread pool). So instead of
37 plugins implementing a Connection_handler subclass, they supply
38 a set of function pointers to my_connection_handler_set() which
39 instantiates Plugin_connection_handler.
40
41 @see Connection_handler_functions struct.
42*/
43
46
49
50 public:
52 : m_functions(functions) {}
53
55
56 protected:
57 bool add_connection(Channel_info *channel_info) override {
58 return m_functions->add_connection(channel_info);
59 }
60
61 uint get_max_threads() const override { return m_functions->max_threads; }
62};
63
64#endif // PLUGIN_CONNECTION_HANDLER_INCLUDED
This abstract base class represents connection channel information about a new connection.
Definition: channel_info.h:47
This abstract base class represents how connections are processed, most importantly how they map to O...
Definition: connection_handler.h:37
This is a wrapper class around global free functions implemented by connection handler plugins (e....
Definition: plugin_connection_handler.h:44
~Plugin_connection_handler() override
Definition: plugin_connection_handler.h:54
uint get_max_threads() const override
Definition: plugin_connection_handler.h:61
Plugin_connection_handler(const Plugin_connection_handler &)
bool add_connection(Channel_info *channel_info) override
Add a connection.
Definition: plugin_connection_handler.h:57
Connection_handler_functions * m_functions
Definition: plugin_connection_handler.h:45
Plugin_connection_handler & operator=(const Plugin_connection_handler &)
Plugin_connection_handler(Connection_handler_functions *functions)
Definition: plugin_connection_handler.h:51
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
This structure must be populated by plugins which implement connection handlers and passed as an argu...
Definition: thread_pool_priv.h:64
uint max_threads
The maximum number of threads this connection handler will create.
Definition: thread_pool_priv.h:68
add_connection_t add_connection
Definition: thread_pool_priv.h:70
end_t end
Definition: thread_pool_priv.h:71
All accesses to THD variables and functions are defined in this header file.