![]() |
MySQL 9.3.0
Source Code Documentation
|
Registry of graal contexts to be used by each service. More...
#include <jit_executor_component.h>
Public Member Functions | |
~JitExecutorComponent () | |
JitExecutorComponent (JitExecutorComponent const &)=delete | |
void | operator= (JitExecutorComponent const &)=delete |
JitExecutorComponent (JitExecutorComponent &&)=delete | |
void | operator= (JitExecutorComponent &&)=delete |
void | stop_debug_context (const std::string &service_id) |
std::shared_ptr< IContextHandle > | get_context (const std::string &service_id, const ServiceHandlerConfig &config, const std::string &debug_port="", bool reset_context=false) |
void | update_global_config (const std::string &options) |
Static Public Member Functions | |
static JitExecutorComponent & | get_instance () |
Private Member Functions | |
JitExecutorComponent ()=default | |
void | update_active_contexts (const std::pair< std::string, std::shared_ptr< IServiceHandlers > > &replacement={}) |
Private Attributes | |
std::mutex | m_context_creation |
GlobalConfig | m_global_config |
std::unordered_map< std::string, std::shared_ptr< IServiceHandlers > > | m_service_context_handlers |
std::vector< std::shared_ptr< IServiceHandlers > > | m_inactive_context_handlers |
Registry of graal contexts to be used by each service.
NOTE: The original idea, was to have a pool of contexts on which the service module files would be loaded once and then shared across the contexts in the pool. The script end points would be getting a context from the pool use it and the release it. However, the main pre-requisite for that is that the context could be reset to the original state, which is NOT possible in Graal.
Suggestion from the Graal Team
By default, each context would internally create an engine which would hold the resources used in the context. However, it is possible to use a common engine to enable the sharing of the resources across contexts (i.e. including parsed source code). Following this approach the context pool is not needed since we would simply create/release the context on demand and it would use the shared resources from the engine.
Even this is the current implementation, expectation was that the module files would be loaded only ONCE but that's not the case, they get reloaded on every created context, even the shared engine is used.
This class holds a registry of service ids vs ContextHandlers (who keep the shared engine) and allows creating a context using the shared engine.
jit_executor::JitExecutorComponent::~JitExecutorComponent | ( | ) |
|
delete |
|
delete |
|
privatedefault |
std::shared_ptr< IContextHandle > jit_executor::JitExecutorComponent::get_context | ( | const std::string & | service_id, |
const ServiceHandlerConfig & | config, | ||
const std::string & | debug_port = "" , |
||
bool | reset_context = false |
||
) |
|
static |
|
delete |
|
delete |
void jit_executor::JitExecutorComponent::stop_debug_context | ( | const std::string & | service_id | ) |
|
private |
void jit_executor::JitExecutorComponent::update_global_config | ( | const std::string & | options | ) |
|
private |
|
private |
|
private |
|
private |