26#ifndef ROUTER_SRC_JIT_EXECUTOR_INCLUDE_MYSQLROUTER_JIT_EXECUTOR_COMPONENT_H_
27#define ROUTER_SRC_JIT_EXECUTOR_INCLUDE_MYSQLROUTER_JIT_EXECUTOR_COMPONENT_H_
38#include <unordered_map>
43#include "mysqlrouter/jit_executor_plugin_export.h"
61 std::shared_ptr<shcore::polyglot::IFile_system>
fs;
75 const std::string &debug_port =
"") = 0;
80 virtual std::string
error() = 0;
125 void stop_debug_context(
const std::string &service_id);
127 std::shared_ptr<IContextHandle> get_context(
129 const std::string &debug_port =
"",
bool reset_context =
false);
131 void delete_context(
const std::string &service_id);
133 void update_global_config(
const std::string &
options);
137 void update_active_contexts(
138 const std::pair<std::string, std::shared_ptr<IServiceHandlers>>
144 std::unordered_map<std::string, std::shared_ptr<IServiceHandlers>>
Interface defining central location for the handlers associated to a database service.
Definition: jit_executor_component.h:71
virtual void set_max_heap_size(uint64_t)=0
virtual std::string error()=0
virtual uint64_t memory_units() const =0
virtual ~IServiceHandlers()=default
virtual void teardown()=0
virtual std::shared_ptr< IContextHandle > get_context(const std::string &debug_port="")=0
virtual std::chrono::seconds idle_time() const =0
virtual void release_debug_context()=0
Registry of graal contexts to be used by each service.
Definition: jit_executor_component.h:114
JitExecutorComponent()=default
JitExecutorComponent(JitExecutorComponent &&)=delete
void operator=(JitExecutorComponent &&)=delete
void operator=(JitExecutorComponent const &)=delete
JitExecutorComponent(JitExecutorComponent const &)=delete
GlobalConfig m_global_config
Definition: jit_executor_component.h:142
std::unordered_map< std::string, std::string > m_handler_errors
Definition: jit_executor_component.h:147
std::unordered_map< std::string, std::shared_ptr< IServiceHandlers > > m_service_context_handlers
Definition: jit_executor_component.h:145
std::mutex m_context_creation
Definition: jit_executor_component.h:140
std::vector< std::shared_ptr< IServiceHandlers > > m_inactive_context_handlers
Definition: jit_executor_component.h:149
Definition: jit_executor_callbacks.h:36
static const uint64_t k_default_memory_units
Definition: jit_executor_component.h:49
std::chrono::seconds seconds
Definition: authorize_manager.cc:70
Definition: options.cc:57
Value::Map_type_ref Dictionary_t
Definition: jit_executor_value.h:431
Definition: jit_executor_component.h:50
std::optional< uint64_t > maximum_idle_time
Definition: jit_executor_component.h:57
std::optional< uint64_t > maximum_ram_size
Definition: jit_executor_component.h:56
bool operator==(const GlobalConfig &o) const
Definition: jit_executor_component.h:51
Definition: jit_executor_component.h:60
shcore::Dictionary_t globals
Definition: jit_executor_component.h:63
std::optional< uint64_t > memory_units
Definition: jit_executor_component.h:64
std::vector< std::string > module_files
Definition: jit_executor_component.h:62
std::shared_ptr< shcore::polyglot::IFile_system > fs
Definition: jit_executor_component.h:61
std::optional< uint64_t > max_heap_size
Definition: jit_executor_component.h:65