2
-*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
3
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
5
* Definitions required for Configuration Variables plugin
7
* Copyright (C) 2008 Sun Microsystems
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; version 2 of the License.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
#ifndef DRIZZLED_PLUGIN_SCHEDULING_H
24
#define DRIZZLED_PLUGIN_SCHEDULING_H
35
Scheduler(uint32_t threads)
36
: max_threads(threads) {}
38
virtual ~Scheduler() {}
40
uint32_t get_max_threads()
45
virtual uint32_t count(void)= 0;
46
virtual bool add_connection(Session *session)= 0;
48
virtual bool end_thread(Session *, bool) {return false;}
49
virtual bool init_new_connection_thread(void)
56
virtual void post_kill_notification(Session *) {}
59
class SchedulerFactory
62
std::vector<std::string> aliases;
66
SchedulerFactory(std::string name_arg): name(name_arg), scheduler(NULL) {}
67
SchedulerFactory(const char *name_arg): name(name_arg), scheduler(NULL) {}
68
virtual ~SchedulerFactory() {}
69
virtual Scheduler *operator()(void)= 0;
70
std::string getName() {return name;}
71
const std::vector<std::string>& getAliases() {return aliases;}
72
void addAlias(std::string alias)
74
aliases.push_back(alias);
79
#endif /* DRIZZLED_PLUGIN_SCHEDULING_H */