MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
innodb_engine.h
Go to the documentation of this file.
1 /***********************************************************************
2 
3 Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
12 Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
17 
18 ***********************************************************************/
19 /**************************************************/
25 #ifndef INNODB_ENGINE_H
26 #define INNODB_ENGINE_H
27 
28 #include "config.h"
29 
30 #include <pthread.h>
31 
32 #include <memcached/engine.h>
33 #include <memcached/util.h>
34 #include <memcached/visibility.h>
35 #include <innodb_utility.h>
36 #include <innodb_config.h>
37 
40 #define CONN_NUM_WRITE_COMMIT 1
41 
44 #define CONN_NUM_READ_COMMIT 1048510
45 
48 
57  bool in_use;
59  bool is_stale;
61  void* conn_cookie;
62  uint64_t n_total_reads;
63  uint64_t n_reads_since_commit;
66  uint64_t n_total_writes;
68  uint64_t n_writes_since_commit;
71  void* thd;
72  void* mysql_tbl;
75  pthread_mutex_t curr_conn_mutex;
78 };
79 
80 typedef UT_LIST_BASE_NODE_T(innodb_conn_data_t) conn_list_t;
81 
84 typedef struct innodb_engine {
85  /* members all common to Memcached Engines */
89  GET_SERVER_API get_server_api;
93  struct {
94  size_t nthreads;
96  bool cas_enabled;
97  } server_options;
98 
99  union {
101  char buffer[sizeof(engine_info)
102  * (LAST_REGISTERED_ENGINE_FEATURE + 1)];
105  } info;
106 
107  bool initialized;
109  bool connected;
111  bool clean_stale_conn;
115  /* following are InnoDB specific variables */
116  bool enable_binlog;
118  bool enable_mdl;
120  ib_trx_level_t trx_level;
122  ib_ulint_t bk_commit_interval;
126  meta_cfg_info_t* meta_info;
128  conn_list_t conn_data;
130  pthread_mutex_t conn_mutex;
132  pthread_mutex_t cas_mutex;
134  pthread_t bk_thd_for_commit;
137  ib_cb_t* innodb_cb;
139  uint64_t read_batch_size;
141  uint64_t write_batch_size;
145 
146 #endif /* INNODB_ENGINE_H */