Drizzled Public API Documentation

data_dictionary.h
1 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3  *
4  * Copyright (C) 2010 Joseph Daly <skinny.moey@gmail.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #pragma once
22 
23 #include <drizzled/plugin/table_function.h>
24 #include <drizzled/field.h>
25 
26 #include "trx0i_s.h"
27 #include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */
28 #include "buf0buddy.h" /* for i_s_cmpmem */
29 #include "buf0buf.h" /* for buf_pool and PAGE_ZIP_MIN_SIZE */
30 #include "ha_prototypes.h" /* for innobase_convert_name() */
31 #include "srv0start.h" /* for srv_was_started */
32 #include "btr0pcur.h" /* for file sys_tables related info. */
33 #include "btr0types.h"
34 #include "dict0load.h" /* for file sys_tables related info. */
35 #include "dict0mem.h"
36 #include "dict0types.h"
37 
39 {
40 public:
43  {
44  public:
46 
47  bool populate();
48  private:
49  btr_pcur_t pcur;
50  const rec_t* rec;
51  mem_heap_t* heap;
52  mtr_t mtr;
53  };
54 
55  Generator *generator(drizzled::Field **arg)
56  {
57  return new Generator(arg);
58  }
59 };
60 
62 {
63 public:
66  {
67  public:
69 
70  bool populate();
71  private:
72  btr_pcur_t pcur;
73  const rec_t* rec;
74  mem_heap_t* heap;
75  mtr_t mtr;
76  };
77 
78  Generator *generator(drizzled::Field **arg)
79  {
80  return new Generator(arg);
81  }
82 };
83 
85 {
86 public:
89  {
90  public:
92 
93  bool populate();
94  private:
95  btr_pcur_t pcur;
96  const rec_t* rec;
97  mem_heap_t* heap;
98  mtr_t mtr;
99  };
100 
101  Generator *generator(drizzled::Field **arg)
102  {
103  return new Generator(arg);
104  }
105 };
106 
108 {
109 public:
112  {
113  public:
114  Generator(drizzled::Field **arg);
115 
116  bool populate();
117  private:
118  btr_pcur_t pcur;
119  const rec_t* rec;
120  mem_heap_t* heap;
121  mtr_t mtr;
122  };
123 
124  Generator *generator(drizzled::Field **arg)
125  {
126  return new Generator(arg);
127  }
128 };
129 
131 {
132 public:
135  {
136  public:
137  Generator(drizzled::Field **arg);
138 
139  bool populate();
140  private:
141  btr_pcur_t pcur;
142  const rec_t* rec;
143  mem_heap_t* heap;
144  index_id_t last_id;
145  mtr_t mtr;
146  };
147 
148  Generator *generator(drizzled::Field **arg)
149  {
150  return new Generator(arg);
151  }
152 };
153 
155 {
156 public:
159  {
160  public:
161  Generator(drizzled::Field **arg);
162 
163  bool populate();
164  private:
165  btr_pcur_t pcur;
166  const rec_t* rec;
167  mem_heap_t* heap;
168  mtr_t mtr;
169  };
170 
171  Generator *generator(drizzled::Field **arg)
172  {
173  return new Generator(arg);
174  }
175 };
176 
178 {
179 public:
182  {
183  public:
184  Generator(drizzled::Field **arg);
185 
186  bool populate();
187  private:
188  btr_pcur_t pcur;
189  const rec_t* rec;
190  mem_heap_t* heap;
191  mtr_t mtr;
192  };
193 
194  Generator *generator(drizzled::Field **arg)
195  {
196  return new Generator(arg);
197  }
198 };
199 
201 {
202 public:
203 
204  CmpTool(bool reset);
205 
207  {
208  public:
209  Generator(drizzled::Field **arg, bool outer_reset);
210 
211  bool populate();
212  private:
213  uint32_t record_number;
214  bool inner_reset;
215  };
216 
217  Generator *generator(drizzled::Field **arg)
218  {
219  return new Generator(arg, outer_reset);
220  }
221 private:
222  bool outer_reset;
223 };
224 
226 {
227 public:
228 
229  CmpmemTool(bool reset);
230 
232  {
233  public:
234  Generator(drizzled::Field **arg, bool outer_reset);
235 
236  ~Generator();
237 
238  bool populate();
239  private:
240  uint32_t record_number;
241  bool inner_reset;
242  };
243 
244  Generator *generator(drizzled::Field **arg)
245  {
246  return new Generator(arg, outer_reset);
247  }
248 private:
249  bool outer_reset;
250 };
251 
253 {
254 public:
255 
256  InnodbTrxTool(const char* in_table_name);
257 
259  {
260  public:
261  Generator(drizzled::Field **arg, const char* in_table_name);
262 
263  ~Generator();
264 
265  bool populate();
266  private:
267  void populate_innodb_trx();
268  void populate_innodb_locks();
269  void populate_innodb_lock_waits();
270 
271  private:
272  uint32_t record_number;
273  uint32_t number_rows;
274  const char* table_name;
275  };
276 
277  Generator *generator(drizzled::Field **arg)
278  {
279  return new Generator(arg, table_name);
280  }
281 private:
282  const char* table_name;
283 };
284