| 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 | /*====== |
| 5 | This file is part of TokuDB |
| 6 | |
| 7 | |
| 8 | Copyright (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 |
| 30 | struct ha_table_option_struct { |
| 31 | uint row_format; |
| 32 | }; |
| 33 | |
| 34 | struct ha_index_option_struct { |
| 35 | bool clustering; |
| 36 | }; |
| 37 | |
| 38 | static 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 | |
| 44 | static inline bool key_is_clustering(const KEY *key) { |
| 45 | return key->flags & HA_CLUSTERING; |
| 46 | } |
| 47 | #endif |
| 48 | |
| 49 | namespace tokudb { |
| 50 | namespace sysvars { |
| 51 | |
| 52 | enum analyze_mode_t { |
| 53 | TOKUDB_ANALYZE_STANDARD = 0, |
| 54 | TOKUDB_ANALYZE_RECOUNT_ROWS = 1, |
| 55 | TOKUDB_ANALYZE_CANCEL = 2 |
| 56 | }; |
| 57 | |
| 58 | enum empty_scan_mode_t { |
| 59 | TOKUDB_EMPTY_SCAN_DISABLED = 0, |
| 60 | TOKUDB_EMPTY_SCAN_LR = 1, |
| 61 | TOKUDB_EMPTY_SCAN_RL = 2, |
| 62 | }; |
| 63 | |
| 64 | enum 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 |
| 82 | extern ulonglong cache_size; |
| 83 | extern uint cachetable_pool_threads; |
| 84 | extern int cardinality_scale_percent; |
| 85 | extern my_bool checkpoint_on_flush_logs; |
| 86 | extern uint checkpoint_pool_threads; |
| 87 | extern uint checkpointing_period; |
| 88 | extern ulong cleaner_iterations; |
| 89 | extern ulong cleaner_period; |
| 90 | extern uint client_pool_threads; |
| 91 | extern my_bool compress_buffers_before_eviction; |
| 92 | extern char* data_dir; |
| 93 | extern ulong debug; |
| 94 | extern my_bool directio; |
| 95 | extern my_bool enable_partial_eviction; |
| 96 | extern int fs_reserve_percent; |
| 97 | extern uint fsync_log_period; |
| 98 | extern char* log_dir; |
| 99 | extern ulonglong max_lock_memory; |
| 100 | extern uint read_status_frequency; |
| 101 | extern my_bool strip_frm_data; |
| 102 | extern char* tmp_dir; |
| 103 | extern uint write_status_frequency; |
| 104 | extern my_bool dir_per_db; |
| 105 | extern char* version; |
| 106 | |
| 107 | #if defined(TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL) |
| 108 | extern char* gdb_path; |
| 109 | extern my_bool gdb_on_fatal; |
| 110 | #endif |
| 111 | |
| 112 | extern my_bool check_jemalloc; |
| 113 | |
| 114 | #if TOKUDB_DEBUG |
| 115 | // used to control background job manager |
| 116 | extern my_bool debug_pause_background_job_manager; |
| 117 | #endif // TOKUDB_DEBUG |
| 118 | |
| 119 | // session/thread |
| 120 | my_bool alter_print_error(THD* thd); |
| 121 | double analyze_delete_fraction(THD* thd); |
| 122 | my_bool analyze_in_background(THD* thd); |
| 123 | analyze_mode_t analyze_mode(THD* thd); |
| 124 | ulonglong analyze_throttle(THD* thd); |
| 125 | ulonglong analyze_time(THD* thd); |
| 126 | ulonglong auto_analyze(THD* thd); |
| 127 | uint block_size(THD* thd); |
| 128 | my_bool bulk_fetch(THD* thd); |
| 129 | my_bool commit_sync(THD* thd); |
| 130 | my_bool create_index_online(THD* thd); |
| 131 | my_bool disable_hot_alter(THD* thd); |
| 132 | my_bool disable_prefetching(THD* thd); |
| 133 | my_bool disable_slow_alter(THD* thd); |
| 134 | my_bool disable_slow_update(THD* thd); |
| 135 | my_bool disable_slow_upsert(THD* thd); |
| 136 | empty_scan_mode_t empty_scan(THD* thd); |
| 137 | uint fanout(THD* thd); |
| 138 | my_bool hide_default_row_format(THD* thd); |
| 139 | ulonglong killed_time(THD* thd); |
| 140 | my_bool load_save_space(THD* thd); |
| 141 | char* last_lock_timeout(THD* thd); |
| 142 | void set_last_lock_timeout(THD* thd, char* last); |
| 143 | ulonglong loader_memory_size(THD* thd); |
| 144 | ulonglong lock_timeout(THD* thd); |
| 145 | uint lock_timeout_debug(THD* thd); |
| 146 | double optimize_index_fraction(THD* thd); |
| 147 | const char* optimize_index_name(THD* thd); |
| 148 | ulonglong optimize_throttle(THD* thd); |
| 149 | uint pk_insert_mode(THD* thd); |
| 150 | void set_pk_insert_mode(THD* thd, uint mode); |
| 151 | my_bool prelock_empty(THD* thd); |
| 152 | uint read_block_size(THD* thd); |
| 153 | uint read_buf_size(THD* thd); |
| 154 | row_format_t row_format(THD *thd); |
| 155 | my_bool rpl_check_readonly(THD* thd); |
| 156 | my_bool rpl_lookup_rows(THD* thd); |
| 157 | ulonglong rpl_lookup_rows_delay(THD* thd); |
| 158 | my_bool rpl_unique_checks(THD* thd); |
| 159 | ulonglong rpl_unique_checks_delay(THD* thd); |
| 160 | my_bool support_xa(THD* thd); |
| 161 | |
| 162 | extern st_mysql_sys_var* system_variables[]; |
| 163 | |
| 164 | #if TOKU_INCLUDE_OPTION_STRUCTS |
| 165 | extern ha_create_table_option tokudb_table_options[]; |
| 166 | extern ha_create_table_option tokudb_index_options[]; |
| 167 | #endif |
| 168 | |
| 169 | } // namespace sysvars |
| 170 | } // namespace tokudb |
| 171 | |
| 172 | #endif // _TOKUDB_SYSVARS_H |
| 173 | |