MySQL  8.0.27
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, 2021, 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 also distributed 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 included with MySQL.
17 
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License, version 2.0, for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with this program; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 */
27 
28 #include "mysql/thread_pool_priv.h" // Plugin_connection_handler_functions
29 #include "sql/conn_handler/connection_handler.h" // Connection_handler
30 
31 class THD;
32 
33 /**
34  This is a wrapper class around global free functions implemented
35  by connection handler plugins (e.g. thread pool). So instead of
36  plugins implementing a Connection_handler subclass, they supply
37  a set of function pointers to my_connection_handler_set() which
38  instantiates Plugin_connection_handler.
39 
40  @see Connection_handler_functions struct.
41 */
42 
45 
48 
49  public:
51  : m_functions(functions) {}
52 
54 
55  protected:
56  bool add_connection(Channel_info *channel_info) override {
57  return m_functions->add_connection(channel_info);
58  }
59 
60  uint get_max_threads() const override { return m_functions->max_threads; }
61 };
62 
63 #endif // PLUGIN_CONNECTION_HANDLER_INCLUDED
This abstract base class represents connection channel information about a new connection.
Definition: channel_info.h:46
This abstract base class represents how connections are processed, most importantly how they map to O...
Definition: connection_handler.h:36
This is a wrapper class around global free functions implemented by connection handler plugins (e....
Definition: plugin_connection_handler.h:43
~Plugin_connection_handler() override
Definition: plugin_connection_handler.h:53
uint get_max_threads() const override
Definition: plugin_connection_handler.h:60
Plugin_connection_handler(const Plugin_connection_handler &)
Plugin_connection_handler & operator=(const Plugin_connection_handler &)
bool add_connection(Channel_info *channel_info) override
Add a connection.
Definition: plugin_connection_handler.h:56
Connection_handler_functions * m_functions
Definition: plugin_connection_handler.h:44
Plugin_connection_handler(Connection_handler_functions *functions)
Definition: plugin_connection_handler.h:50
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:821
This structure must be populated by plugins which implement connection handlers and passed as an argu...
Definition: thread_pool_priv.h:63
uint max_threads
The maximum number of threads this connection handler will create.
Definition: thread_pool_priv.h:67
add_connection_t add_connection
Definition: thread_pool_priv.h:69
end_t end
Definition: thread_pool_priv.h:70
All accesses to THD variables and functions are defined in this header file.
unsigned int uint
Definition: uca-dump.cc:29