1/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
3#ident "$Id$"
4/*======
5This file is part of TokuDB
6
7
8Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
9
10 TokuDBis is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License, version 2,
12 as published by the Free Software Foundation.
13
14 TokuDB is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with TokuDB. If not, see <http://www.gnu.org/licenses/>.
21
22======= */
23
24#ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."
25
26#ifndef _TOKUDB_SYSVARS_H
27#define _TOKUDB_SYSVARS_H
28
29#if TOKU_INCLUDE_OPTION_STRUCTS
30struct ha_table_option_struct {
31 uint row_format;
32};
33
34struct ha_index_option_struct {
35 bool clustering;
36};
37
38static inline bool key_is_clustering(const KEY *key) {
39 return (key->flags & HA_CLUSTERING) || (key->option_struct && key->option_struct->clustering);
40}
41
42#else
43
44static inline bool key_is_clustering(const KEY *key) {
45 return key->flags & HA_CLUSTERING;
46}
47#endif
48
49namespace tokudb {
50namespace sysvars {
51
52enum analyze_mode_t {
53 TOKUDB_ANALYZE_STANDARD = 0,
54 TOKUDB_ANALYZE_RECOUNT_ROWS = 1,
55 TOKUDB_ANALYZE_CANCEL = 2
56};
57
58enum empty_scan_mode_t {
59 TOKUDB_EMPTY_SCAN_DISABLED = 0,
60 TOKUDB_EMPTY_SCAN_LR = 1,
61 TOKUDB_EMPTY_SCAN_RL = 2,
62};
63
64enum row_format_t {
65 SRV_ROW_FORMAT_UNCOMPRESSED = 0,
66 SRV_ROW_FORMAT_ZLIB = 1,
67 SRV_ROW_FORMAT_SNAPPY = 2,
68 SRV_ROW_FORMAT_QUICKLZ = 3,
69 SRV_ROW_FORMAT_LZMA = 4,
70 SRV_ROW_FORMAT_FAST = 5,
71 SRV_ROW_FORMAT_SMALL = 6,
72 SRV_ROW_FORMAT_DEFAULT = 7
73};
74
75#define DEFAULT_TOKUDB_CLEANER_ITERATIONS 5
76#define DEFAULT_TOKUDB_CLEANER_PERIOD 1
77#define DEFAULT_TOKUDB_KILLED_TIME 4000 // milliseconds
78#define DEFAULT_TOKUDB_LOCK_TIMEOUT 4000 // milliseconds
79
80
81// globals
82extern ulonglong cache_size;
83extern uint cachetable_pool_threads;
84extern int cardinality_scale_percent;
85extern my_bool checkpoint_on_flush_logs;
86extern uint checkpoint_pool_threads;
87extern uint checkpointing_period;
88extern ulong cleaner_iterations;
89extern ulong cleaner_period;
90extern uint client_pool_threads;
91extern my_bool compress_buffers_before_eviction;
92extern char* data_dir;
93extern ulong debug;
94extern my_bool directio;
95extern my_bool enable_partial_eviction;
96extern int fs_reserve_percent;
97extern uint fsync_log_period;
98extern char* log_dir;
99extern ulonglong max_lock_memory;
100extern uint read_status_frequency;
101extern my_bool strip_frm_data;
102extern char* tmp_dir;
103extern uint write_status_frequency;
104extern my_bool dir_per_db;
105extern char* version;
106
107#if defined(TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL)
108extern char* gdb_path;
109extern my_bool gdb_on_fatal;
110#endif
111
112extern my_bool check_jemalloc;
113
114#if TOKUDB_DEBUG
115// used to control background job manager
116extern my_bool debug_pause_background_job_manager;
117#endif // TOKUDB_DEBUG
118
119// session/thread
120my_bool alter_print_error(THD* thd);
121double analyze_delete_fraction(THD* thd);
122my_bool analyze_in_background(THD* thd);
123analyze_mode_t analyze_mode(THD* thd);
124ulonglong analyze_throttle(THD* thd);
125ulonglong analyze_time(THD* thd);
126ulonglong auto_analyze(THD* thd);
127uint block_size(THD* thd);
128my_bool bulk_fetch(THD* thd);
129my_bool commit_sync(THD* thd);
130my_bool create_index_online(THD* thd);
131my_bool disable_hot_alter(THD* thd);
132my_bool disable_prefetching(THD* thd);
133my_bool disable_slow_alter(THD* thd);
134my_bool disable_slow_update(THD* thd);
135my_bool disable_slow_upsert(THD* thd);
136empty_scan_mode_t empty_scan(THD* thd);
137uint fanout(THD* thd);
138my_bool hide_default_row_format(THD* thd);
139ulonglong killed_time(THD* thd);
140my_bool load_save_space(THD* thd);
141char* last_lock_timeout(THD* thd);
142void set_last_lock_timeout(THD* thd, char* last);
143ulonglong loader_memory_size(THD* thd);
144ulonglong lock_timeout(THD* thd);
145uint lock_timeout_debug(THD* thd);
146double optimize_index_fraction(THD* thd);
147const char* optimize_index_name(THD* thd);
148ulonglong optimize_throttle(THD* thd);
149uint pk_insert_mode(THD* thd);
150void set_pk_insert_mode(THD* thd, uint mode);
151my_bool prelock_empty(THD* thd);
152uint read_block_size(THD* thd);
153uint read_buf_size(THD* thd);
154row_format_t row_format(THD *thd);
155my_bool rpl_check_readonly(THD* thd);
156my_bool rpl_lookup_rows(THD* thd);
157ulonglong rpl_lookup_rows_delay(THD* thd);
158my_bool rpl_unique_checks(THD* thd);
159ulonglong rpl_unique_checks_delay(THD* thd);
160my_bool support_xa(THD* thd);
161
162extern st_mysql_sys_var* system_variables[];
163
164#if TOKU_INCLUDE_OPTION_STRUCTS
165extern ha_create_table_option tokudb_table_options[];
166extern ha_create_table_option tokudb_index_options[];
167#endif
168
169} // namespace sysvars
170} // namespace tokudb
171
172#endif // _TOKUDB_SYSVARS_H
173