summaryrefslogtreecommitdiff
path: root/sql/event_queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/event_queue.h')
-rw-r--r--sql/event_queue.h49
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_ */