OmniSciDB  8fa3bf436f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CommandLineOptions.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 OmniSci, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <blosc.h>
20 #include <cstddef>
21 
22 #include <boost/algorithm/string.hpp>
23 #include <boost/algorithm/string/trim.hpp>
24 #include <boost/filesystem.hpp>
25 #include <boost/locale/generator.hpp>
26 #include <boost/make_shared.hpp>
27 #include <boost/program_options.hpp>
28 
29 #include "Catalog/AuthMetadata.h"
34 
35 namespace po = boost::program_options;
36 
37 class LeafHostInfo;
38 
40  public:
41  CommandLineOptions(char const* argv0, bool dist_v5_ = false)
42  : log_options_(argv0), dist_v5_(dist_v5_) {
43  fillOptions();
45  }
46  int http_port = 6278;
47  size_t reserved_gpu_mem = 384 * 1024 * 1024;
48  std::string base_path;
50  std::string cluster_file = {"cluster.conf"};
51  std::string cluster_topology_file = {"cluster_topology.conf"};
52  std::string license_path = {""};
53  std::string encryption_key_store_path = {};
54  bool verbose_logging = false;
55  bool jit_debug = false;
56  bool intel_jit_profile = false;
57  bool allow_multifrag = true;
58  bool read_only = false;
59  bool allow_loop_joins = false;
60  bool enable_legacy_syntax = true;
61  bool log_user_origin = true;
63 
65  bool enable_rendering = false;
67  int render_oom_retry_threshold = 0; // in milliseconds
68  size_t render_mem_bytes = 1000000000;
72 
73  bool enable_runtime_udf = false;
74 
75  bool enable_watchdog = true;
80  double running_query_interrupt_freq = 0.5; // 0.0 ~ 1.0
81  unsigned pending_query_interrupt_freq = 1000; // in milliseconds
82  unsigned dynamic_watchdog_time_limit = 10000;
83  std::string disk_cache_level = "";
84 
88  size_t num_reader_threads = 0;
92  std::string db_query_file = {""};
96  bool exit_after_warmup = false;
106  std::string udf_file_name = {""};
107  std::string udf_compiler_path = {""};
108  std::vector<std::string> udf_compiler_options;
109 
110  std::string allowed_import_paths{};
111  std::string allowed_export_paths{};
112 
113 #ifdef ENABLE_GEOS
114  std::string libgeos_so_filename = {"libgeos_c.so"};
115 #endif
116 
117  void fillOptions();
118  void fillAdvancedOptions();
119 
120  std::string compressor = std::string(BLOSC_LZ4HC_COMPNAME);
121 
122  po::options_description help_desc;
123  po::options_description developer_desc;
125  po::positional_options_description positional_options;
126 
127  public:
128  std::vector<LeafHostInfo> db_leaves;
129  std::vector<LeafHostInfo> string_leaves;
130  po::variables_map vm;
131  std::string clusterIds_arg;
132 
133  std::string getNodeIds();
134  std::vector<std::string> getNodeIdsArray();
135  static const std::string nodeIds_token;
136 
137  boost::optional<int> parse_command_line(int argc,
138  char const* const* argv,
139  const bool should_init_logging = false);
140  void validate();
141  void validate_base_path();
142  void init_logging();
143  const bool dist_v5_;
144 };
145 
146 extern bool g_enable_watchdog;
147 extern bool g_enable_dynamic_watchdog;
148 extern unsigned g_dynamic_watchdog_time_limit;
149 extern unsigned g_trivial_loop_join_threshold;
150 extern bool g_from_table_reordering;
151 extern bool g_enable_filter_push_down;
152 extern bool g_allow_cpu_retry;
153 extern bool g_null_div_by_zero;
154 extern bool g_bigint_count;
156 extern float g_filter_push_down_low_frac;
157 extern float g_filter_push_down_high_frac;
159 extern bool g_enable_columnar_output;
161 extern bool g_enable_overlaps_hashjoin;
163 extern size_t g_overlaps_max_table_size_bytes;
165 extern bool g_strip_join_covered_quals;
166 extern size_t g_constrained_by_in_threshold;
167 extern size_t g_big_group_threshold;
168 extern bool g_enable_window_functions;
169 extern bool g_enable_table_functions;
170 extern size_t g_max_memory_allocation_size;
171 extern double g_bump_allocator_step_reduction;
174 extern unsigned g_pending_query_interrupt_freq;
175 extern double g_running_query_interrupt_freq;
177 extern size_t g_gpu_smem_threshold;
180 extern bool g_use_estimator_result_cache;
181 extern bool g_enable_lazy_fetch;
182 
183 extern int64_t g_omni_kafka_seek;
184 extern size_t g_leaf_count;
185 extern size_t g_compression_limit_bytes;
186 extern bool g_skip_intermediate_count;
187 extern bool g_enable_bump_allocator;
189 extern size_t g_min_memory_allocation_size;
192 extern bool g_enable_fsi;
193 extern bool g_enable_s3_fsi;
194 extern bool g_enable_interop;
195 extern bool g_enable_union;
196 extern bool g_use_tbb_pool;
197 extern bool g_enable_filter_function;
198 extern size_t g_max_import_threads;
200 extern float g_vacuum_min_selectivity;
201 extern bool g_read_only;
CommandLineOptions(char const *argv0, bool dist_v5_=false)
double g_running_query_interrupt_freq
Definition: Execute.cpp:118
float g_filter_push_down_low_frac
Definition: Execute.cpp:90
size_t g_constrained_by_in_threshold
Definition: Execute.cpp:101
bool g_enable_watchdog
double g_bump_allocator_step_reduction
Definition: Execute.cpp:110
logger::LogOptions log_options_
bool g_strip_join_covered_quals
Definition: Execute.cpp:100
std::vector< LeafHostInfo > string_leaves
bool g_enable_direct_columnarization
Definition: Execute.cpp:111
bool g_enable_lazy_fetch
Definition: Execute.cpp:113
std::string udf_compiler_path
bool g_skip_intermediate_count
unsigned g_pending_query_interrupt_freq
Definition: Execute.cpp:117
po::options_description help_desc
DiskCacheConfig disk_cache_config
static constexpr int64_t kMinsPerHour
bool g_enable_auto_metadata_update
size_t g_filter_push_down_passing_row_ubound
Definition: Execute.cpp:92
boost::optional< int > parse_command_line(int argc, char const *const *argv, const bool should_init_logging=false)
bool g_enable_dynamic_watchdog
Definition: Execute.cpp:77
unsigned g_trivial_loop_join_threshold
Definition: Execute.cpp:83
bool g_enable_non_kernel_time_query_interrupt
Definition: Execute.cpp:115
bool enable_non_kernel_time_query_interrupt
size_t g_compression_limit_bytes
Definition: Compressor.cpp:36
std::string encryption_key_store_path
bool g_enable_overlaps_hashjoin
Definition: Execute.cpp:96
bool g_inner_join_fragment_skipping
Definition: Execute.cpp:85
bool g_enable_smem_non_grouped_agg
Definition: Execute.cpp:127
static constexpr int64_t kMinsPerMonth
bool g_null_div_by_zero
Definition: Execute.cpp:82
bool g_enable_interop
bool g_enable_columnar_output
Definition: Execute.cpp:93
size_t max_concurrent_render_sessions
bool g_enable_s3_fsi
Definition: Catalog.cpp:93
bool g_from_table_reordering
Definition: Execute.cpp:84
std::string getNodeIds()
bool g_enable_hashjoin_many_to_many
Definition: Execute.cpp:97
std::vector< LeafHostInfo > db_leaves
std::vector< std::string > getNodeIdsArray()
size_t g_big_group_threshold
Definition: Execute.cpp:102
float g_filter_push_down_high_frac
Definition: Execute.cpp:91
bool g_bigint_count
size_t g_max_memory_allocation_size
Definition: Execute.cpp:105
double g_overlaps_target_entries_per_bin
Definition: Execute.cpp:99
std::string allowed_export_paths
size_t g_overlaps_max_table_size_bytes
Definition: Execute.cpp:98
AuthMetadata authMetadata
bool g_enable_window_functions
Definition: Execute.cpp:103
size_t g_min_memory_allocation_size
Definition: Execute.cpp:106
bool g_read_only
Definition: File.cpp:38
unsigned pending_query_interrupt_freq
bool g_enable_smem_grouped_non_count_agg
Definition: Execute.cpp:124
bool g_enable_experimental_string_functions
bool g_enable_automatic_ir_metadata
Definition: Execute.cpp:136
std::vector< std::string > udf_compiler_options
float g_vacuum_min_selectivity
static const std::string nodeIds_token
bool g_enable_filter_function
Definition: Execute.cpp:79
bool g_enable_filter_push_down
Definition: Execute.cpp:89
int64_t g_omni_kafka_seek
bool g_use_estimator_result_cache
Definition: Execute.cpp:116
bool g_enable_bump_allocator
Definition: Execute.cpp:109
po::positional_options_description positional_options
bool g_enable_union
Functions used to work with HyperLogLog records.
bool g_allow_cpu_retry
Definition: Execute.cpp:81
po::options_description developer_desc
std::string allowed_import_paths
std::string disk_cache_level
bool g_optimize_row_initialization
Definition: Execute.cpp:95
po::variables_map vm
size_t g_leaf_count
Definition: ParserNode.cpp:76
unsigned g_dynamic_watchdog_time_limit
Definition: Execute.cpp:80
bool g_enable_fsi
Definition: Catalog.cpp:92
bool g_use_tbb_pool
Definition: Execute.cpp:78
bool g_enable_runtime_query_interrupt
Definition: Execute.cpp:114
size_t g_max_import_threads
Definition: Importer.cpp:84
std::string cluster_topology_file
bool g_enable_table_functions
Definition: Execute.cpp:104
unsigned dynamic_watchdog_time_limit
SystemParameters system_parameters
size_t g_gpu_smem_threshold
Definition: Execute.cpp:119