MySQL 9.3.0
Source Code Documentation
jit_executor_service_handlers.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 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, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
19 * the GNU General Public License, version 2.0, 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 Foundation, Inc.,
23 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26#ifndef ROUTER_SRC_JIT_EXECUTOR_SRC_JIT_EXECUTOR_SERVICE_HANDLERS_H_
27#define ROUTER_SRC_JIT_EXECUTOR_SRC_JIT_EXECUTOR_SERVICE_HANDLERS_H_
28
32
33#include <chrono>
34#include <memory>
35#include <string>
36#include <vector>
37
38namespace jit_executor {
39
40/**
41 * Contains the handlers to be used to attend JavaScript processing requests for
42 * a specific service.
43 */
45 public:
47 ServiceHandlers(const ServiceHandlers &other);
48 ~ServiceHandlers() override;
49
50 std::shared_ptr<IContextHandle> get_context(
51 const std::string &debug_port = "") override;
52
53 void release_debug_context() override;
54
55 bool init() override;
56 void teardown() override;
57
58 std::chrono::seconds idle_time() const override;
59 uint64_t pool_size() const override;
60
61 void set_max_heap_size(uint64_t) override;
62 void set_default_pool_size(uint64_t) override;
63
64 private:
66 void do_tear_down();
68 std::unique_ptr<CommonContext> m_common_context;
69 std::shared_ptr<IContextHandle> m_debug_context;
70 std::shared_ptr<ContextPool> m_context_pool;
71 std::chrono::time_point<std::chrono::system_clock> m_last_used_time;
72
73 std::unique_ptr<std::thread> m_teardown_thread;
74};
75
76} // namespace jit_executor
77
78#endif // ROUTER_SRC_JIT_EXECUTOR_SRC_JIT_EXECUTOR_SERVICE_HANDLERS_H_
Interface defining central location for the handlers associated to a database service.
Definition: jit_executor_component.h:72
Contains the handlers to be used to attend JavaScript processing requests for a specific service.
Definition: jit_executor_service_handlers.h:44
~ServiceHandlers() override
Definition: jit_executor_service_handlers.cc:111
std::chrono::time_point< std::chrono::system_clock > m_last_used_time
Definition: jit_executor_service_handlers.h:71
ServiceHandlers(const ServiceHandlerConfig &config)
Definition: jit_executor_service_handlers.cc:40
std::chrono::seconds idle_time() const override
Definition: jit_executor_service_handlers.cc:134
void teardown() override
Definition: jit_executor_service_handlers.cc:120
std::shared_ptr< IContextHandle > m_debug_context
Definition: jit_executor_service_handlers.h:69
std::unique_ptr< CommonContext > m_common_context
Definition: jit_executor_service_handlers.h:68
void init_common_context()
Definition: jit_executor_service_handlers.cc:59
uint64_t pool_size() const override
Definition: jit_executor_service_handlers.cc:140
void set_default_pool_size(uint64_t) override
Definition: jit_executor_service_handlers.cc:148
ServiceHandlerConfig m_config
Definition: jit_executor_service_handlers.h:67
bool init() override
Definition: jit_executor_service_handlers.cc:46
std::unique_ptr< std::thread > m_teardown_thread
Definition: jit_executor_service_handlers.h:73
std::shared_ptr< IContextHandle > get_context(const std::string &debug_port="") override
Definition: jit_executor_service_handlers.cc:152
void set_max_heap_size(uint64_t) override
Definition: jit_executor_service_handlers.cc:144
void do_tear_down()
Definition: jit_executor_service_handlers.cc:125
std::shared_ptr< ContextPool > m_context_pool
Definition: jit_executor_service_handlers.h:70
void release_debug_context() override
Definition: jit_executor_service_handlers.cc:173
Definition: jit_executor_callbacks.h:36
std::chrono::seconds seconds
Definition: authorize_manager.cc:69
Definition: jit_executor_component.h:60