diff options
author | andrey@lmy004. <> | 2006-07-10 13:44:43 +0200 |
---|---|---|
committer | andrey@lmy004. <> | 2006-07-10 13:44:43 +0200 |
commit | e3d0524bbd79f85d166e7ec369d6a1f612a8c3d1 (patch) | |
tree | 692560cb267120b449f56b1df9db9a918e5c7477 /sql/event_queue.h | |
parent | 3b840adee7817d141fa9f5935b1d05243e6a8df4 (diff) | |
download | mariadb-git-e3d0524bbd79f85d166e7ec369d6a1f612a8c3d1.tar.gz |
WL#3337 (Event scheduler new architecture)
This patch introduces specialized Event data objects
Event_basic as parent.
Event_queue_element used for queue storage
Event_timed used for SHOW EVENTS/ I_S.EVENTS / SHOW CREATE EVENT
Event_job_data using during execution.
Methods were moved out of Event_timed to other classes.
This patch also introduces Events::LOCK_event_metadata.
This patch gives new implementation of Events::dump_internal_status().
Now both the Event_scheduler and Event_queue return information during
their ::dump_internal_status().
Shortened a bit the runtime for executing events test cases.
Diffstat (limited to 'sql/event_queue.h')
-rw-r--r-- | sql/event_queue.h | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/sql/event_queue.h b/sql/event_queue.h index d253e3c7597..142a866e5ba 100644 --- a/sql/event_queue.h +++ b/sql/event_queue.h @@ -17,13 +17,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ class sp_name; -class Event_timed; +class Event_basic; class Event_db_repository; class Event_job_data; +class Event_queue_element; class THD; -typedef bool * (*event_timed_identifier_comparator)(Event_timed*, Event_timed*); - class Event_scheduler_ng; class Event_queue @@ -46,14 +45,14 @@ public: /* Methods for queue management follow */ int - create_event(THD *thd, Event_parse_data *et); + create_event(THD *thd, LEX_STRING dbname, LEX_STRING name); int - update_event(THD *thd, Event_parse_data *et, LEX_STRING *new_schema, - LEX_STRING *new_name); + update_event(THD *thd, LEX_STRING dbname, LEX_STRING name, + LEX_STRING *new_schema, LEX_STRING *new_name); - bool - drop_event(THD *thd, sp_name *name); + void + drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name); void drop_schema_events(THD *thd, LEX_STRING schema); @@ -61,32 +60,20 @@ public: uint events_count(); - uint - events_count_no_lock(); - static bool check_system_tables(THD *thd); void - recalculate_queue(THD *thd); - - void - empty_queue(); + recalculate_activation_times(THD *thd); - Event_timed * + Event_job_data * get_top_for_execution_if_time(THD *thd, time_t now, struct timespec *abstime); - - Event_timed* - get_top(); - - void - remove_top(); - - void - top_changed(); + + bool + dump_internal_status(THD *thd); protected: - Event_timed * + Event_queue_element * find_event(LEX_STRING db, LEX_STRING name, bool remove_from_q); int @@ -94,14 +81,16 @@ protected: void drop_matching_events(THD *thd, LEX_STRING pattern, - bool (*)(Event_timed *,LEX_STRING *)); + bool (*)(LEX_STRING *, Event_basic *)); + + void + empty_queue(); /* LOCK_event_queue is the mutex which protects the access to the queue. */ pthread_mutex_t LOCK_event_queue; Event_db_repository *db_repository; - uint mutex_last_locked_at_line; uint mutex_last_unlocked_at_line; const char* mutex_last_locked_in_func; @@ -123,10 +112,8 @@ protected: Event_scheduler_ng *scheduler; -//public: - /* The sorted queue with the Event_timed objects */ + /* The sorted queue with the Event_job_data objects */ QUEUE queue; - }; #endif /* _EVENT_QUEUE_H_ */ |