~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/gearman_udf/gearman_udf.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2009 Sun Microsystems
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
15
 
 
16
#include "config.h"
 
17
#include "drizzled/plugin/function.h"
 
18
 
 
19
#include "gman_servers_set.h"
 
20
#include "gman_do.h"
 
21
 
 
22
using namespace std;
 
23
using namespace drizzled;
 
24
 
 
25
plugin::Create_function<Item_func_gman_servers_set> *gman_servers_set= NULL;
 
26
plugin::Create_function<Item_func_gman_do> *gman_do= NULL;
 
27
plugin::Create_function<Item_func_gman_do_high> *gman_do_high= NULL;
 
28
plugin::Create_function<Item_func_gman_do_low> *gman_do_low= NULL;
 
29
plugin::Create_function<Item_func_gman_do_background> *gman_do_background= NULL;
 
30
plugin::Create_function<Item_func_gman_do_high_background>
 
31
  *gman_do_high_background= NULL;
 
32
plugin::Create_function<Item_func_gman_do_low_background>
 
33
  *gman_do_low_background= NULL;
 
34
 
 
35
static int gearman_udf_plugin_init(drizzled::plugin::Registry &registry)
 
36
{
 
37
  gman_servers_set= new plugin::Create_function<Item_func_gman_servers_set>("gman_servers_set");
 
38
  gman_do= new plugin::Create_function<Item_func_gman_do>("gman_do");
 
39
  gman_do_high= new plugin::Create_function<Item_func_gman_do_high>("gman_do_high");
 
40
  gman_do_low= new plugin::Create_function<Item_func_gman_do_low>("gman_do_low");
 
41
  gman_do_background= new plugin::Create_function<Item_func_gman_do_background>("gman_do_background");
 
42
  gman_do_high_background= new plugin::Create_function<Item_func_gman_do_high_background>("gman_do_high_background");
 
43
  gman_do_low_background= new plugin::Create_function<Item_func_gman_do_low_background>("gman_do_low_background");
 
44
  registry.add(gman_servers_set);
 
45
  registry.add(gman_do);
 
46
  registry.add(gman_do_high);
 
47
  registry.add(gman_do_low);
 
48
  registry.add(gman_do_background);
 
49
  registry.add(gman_do_high_background);
 
50
  registry.add(gman_do_low_background);
 
51
  return 0;
 
52
}
 
53
 
 
54
static int gearman_udf_plugin_deinit(drizzled::plugin::Registry &registry)
 
55
{
 
56
  registry.remove(gman_do_low_background);
 
57
  registry.remove(gman_do_high_background);
 
58
  registry.remove(gman_do_background);
 
59
  registry.remove(gman_do_low);
 
60
  registry.remove(gman_do_high);
 
61
  registry.remove(gman_do);
 
62
  registry.remove(gman_servers_set);
 
63
  delete gman_do_low_background;
 
64
  delete gman_do_high_background;
 
65
  delete gman_do_background;
 
66
  delete gman_do_low;
 
67
  delete gman_do_high;
 
68
  delete gman_do;
 
69
  delete gman_servers_set;
 
70
  return 0;
 
71
}
 
72
 
 
73
DRIZZLE_DECLARE_PLUGIN
 
74
{
 
75
  DRIZZLE_VERSION_ID,
 
76
  "gearman_udf",
 
77
  "0.1",
 
78
  "Eric Day",
 
79
  "Gearman Client UDFs",
 
80
  PLUGIN_LICENSE_BSD,
 
81
  gearman_udf_plugin_init, /* Plugin Init */
 
82
  gearman_udf_plugin_deinit, /* Plugin Deinit */
 
83
  NULL,   /* system variables */
 
84
  NULL    /* config options */
 
85
}
 
86
DRIZZLE_DECLARE_PLUGIN_END;