26#ifndef MYSQLSHDK_SCRIPTING_POLYGLOT_LANGUAGES_POLYGLOT_GARBAGE_COLLECTOR_H_
27#define MYSQLSHDK_SCRIPTING_POLYGLOT_LANGUAGES_POLYGLOT_GARBAGE_COLLECTOR_H_
31#include <condition_variable>
69 using Time_point = std::chrono::time_point<std::chrono::system_clock>;
92 void run(poly_isolate isolate);
The Garbage Collection logic is determined by the occurrence of events such as:
Definition: polyglot_garbage_collector.h:65
std::chrono::time_point< std::chrono::system_clock > Time_point
Definition: polyglot_garbage_collector.h:69
Garbage_collector & operator=(const Garbage_collector &other)=delete
void set_state(State state, const std::string &error="")
Definition: polyglot_garbage_collector.cc:80
Garbage_collector(const Garbage_collector &other)=delete
bool m_terminated
Definition: polyglot_garbage_collector.h:102
void run(poly_isolate isolate)
Definition: polyglot_garbage_collector.cc:86
std::mutex m_state_mutex
Definition: polyglot_garbage_collector.h:95
std::condition_variable m_condition
Definition: polyglot_garbage_collector.h:96
Garbage_collector & operator=(Garbage_collector &&other)=delete
Time_point m_last_gctime
Definition: polyglot_garbage_collector.h:106
Event
Definition: polyglot_garbage_collector.h:79
State
Definition: polyglot_garbage_collector.h:66
std::string m_error
Definition: polyglot_garbage_collector.h:100
void notify(Event event)
Definition: polyglot_garbage_collector.cc:55
Garbage_collector()=default
std::unique_ptr< std::thread > m_thread
Definition: polyglot_garbage_collector.h:97
void start(Config &&config, poly_isolate isolate)
Definition: polyglot_garbage_collector.cc:41
size_t m_language_count
Definition: polyglot_garbage_collector.h:104
Garbage_collector(Garbage_collector &&other)=delete
State m_state
Definition: polyglot_garbage_collector.h:99
~Garbage_collector()
Definition: polyglot_garbage_collector.cc:35
size_t m_statement_count
Definition: polyglot_garbage_collector.h:103
void stop()
Definition: polyglot_garbage_collector.cc:47
std::mutex m_mutex
Definition: polyglot_garbage_collector.h:94
Config m_config
Definition: polyglot_garbage_collector.h:101
Definition: file_system_exceptions.h:34
required string event
Definition: replication_group_member_actions.proto:32
Definition: polyglot_garbage_collector.h:81
std::optional< size_t > interval
Definition: polyglot_garbage_collector.h:82
std::optional< size_t > statements
Definition: polyglot_garbage_collector.h:83
std::optional< size_t > languages
Definition: polyglot_garbage_collector.h:84