1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

WL #3337 (Event scheduler new architecture)

Cut Nr. 8.

All tests pass.

Separated Event_scheduler into Event_queue and Event_scheduler.
Added new Event_scheduler_ng which is the new scheduler and is used
system-wide. Will be moved to the event_scheduler.cc in the future.
Using Event_timed in Event_queue as well as cloned during execution.
Next step is to have Event_worker_data which will be used during execution
and will take ::compile()/::execute() out of Event_timed.
This commit is contained in:
andrey@lmy004.
2006-07-04 18:44:35 +02:00
parent 6dd9a3bb60
commit 2bdd872e5f
24 changed files with 1198 additions and 531 deletions

View File

@ -19,22 +19,23 @@
class sp_name;
class Event_timed;
class Event_db_repository;
class Event_job_data;
class THD;
typedef bool * (*event_timed_identifier_comparator)(Event_timed*, Event_timed*);
class Event_scheduler;
class Event_scheduler_ng;
class Event_queue
{
public:
Event_queue();
static void
void
init_mutexes();
static void
destroy_mutexes();
void
deinit_mutexes();
bool
init(Event_db_repository *db_repo);
@ -76,6 +77,18 @@ public:
void
empty_queue();
Event_timed *
get_top_for_execution_if_time(THD *thd, time_t now, struct timespec *abstime);
Event_timed*
get_top();
void
remove_top();
void
top_changed();
///////////////protected
Event_timed *
find_event(LEX_STRING db, LEX_STRING name, bool remove_from_q);
@ -92,9 +105,6 @@ public:
Event_db_repository *db_repository;
/* The MEM_ROOT of the object */
MEM_ROOT scheduler_root;
/* The sorted queue with the Event_timed objects */
QUEUE queue;
@ -111,11 +121,11 @@ public:
void
unlock_data(const char *func, uint line);
static void
void
on_queue_change();
Event_scheduler_ng *scheduler;
protected:
/* Singleton instance */
static Event_scheduler *singleton;
};