OmniSciDB  0264ff685a
CommandLineOptions Class Reference

#include <CommandLineOptions.h>

+ Collaboration diagram for CommandLineOptions:

Public Member Functions

 CommandLineOptions (char const *argv0, bool dist_v5_=false)
 
void fillOptions ()
 
void fillAdvancedOptions ()
 
std::string getNodeIds ()
 
std::vector< std::string > getNodeIdsArray ()
 
boost::optional< int > parse_command_line (int argc, char const *const *argv, const bool should_init_logging=false)
 
void validate ()
 
void validate_base_path ()
 
void init_logging ()
 

Public Attributes

int http_port = 6278
 
size_t reserved_gpu_mem = 384 * 1024 * 1024
 
std::string base_path
 
DiskCacheConfig disk_cache_config
 
std::string cluster_file = {"cluster.conf"}
 
std::string cluster_topology_file = {"cluster_topology.conf"}
 
std::string license_path = {""}
 
std::string encryption_key_store_path = {}
 
bool cpu_only = false
 
bool verbose_logging = false
 
bool jit_debug = false
 
bool intel_jit_profile = false
 
bool allow_multifrag = true
 
bool read_only = false
 
bool allow_loop_joins = false
 
bool enable_legacy_syntax = true
 
bool log_user_origin = true
 
AuthMetadata authMetadata
 
SystemParameters system_parameters
 
bool enable_rendering = false
 
bool enable_auto_clear_render_mem = false
 
int render_oom_retry_threshold = 0
 
size_t render_mem_bytes = 1000000000
 
size_t max_concurrent_render_sessions = 500
 
bool render_compositor_use_last_gpu = true
 
bool renderer_use_vulkan_driver = false
 
bool enable_runtime_udf = false
 
bool enable_watchdog = true
 
bool enable_dynamic_watchdog = false
 
bool enable_runtime_query_interrupt = false
 
bool use_estimator_result_cache = true
 
double running_query_interrupt_freq = 0.5
 
unsigned pending_query_interrupt_freq = 1000
 
unsigned dynamic_watchdog_time_limit = 10000
 
std::string disk_cache_level = ""
 
int num_gpus = -1
 
int start_gpu = 0
 
size_t num_reader_threads = 0
 
std::string db_query_file = {""}
 
bool exit_after_warmup = false
 
int idle_session_duration = kMinsPerHour
 
int max_session_duration = kMinsPerMonth
 
std::string udf_file_name = {""}
 
std::string udf_compiler_path = {""}
 
std::vector< std::string > udf_compiler_options
 
std::string compressor = std::string(BLOSC_LZ4HC_COMPNAME)
 
po::options_description help_desc
 
po::options_description developer_desc
 
logger::LogOptions log_options_
 
po::positional_options_description positional_options
 
std::vector< LeafHostInfodb_leaves
 
std::vector< LeafHostInfostring_leaves
 
po::variables_map vm
 
std::string clusterIds_arg
 
const bool dist_v5_
 

Static Public Attributes

static const std::string nodeIds_token = {"node_id"}
 

Detailed Description

Definition at line 39 of file CommandLineOptions.h.

Constructor & Destructor Documentation

◆ CommandLineOptions()

CommandLineOptions::CommandLineOptions ( char const *  argv0,
bool  dist_v5_ = false 
)
inline

Definition at line 41 of file CommandLineOptions.h.

References fillAdvancedOptions(), and fillOptions().

42  : log_options_(argv0), dist_v5_(dist_v5_) {
43  fillOptions();
45  }
logger::LogOptions log_options_
+ Here is the call graph for this function:

Member Function Documentation

◆ fillAdvancedOptions()

void CommandLineOptions::fillAdvancedOptions ( )

Definition at line 396 of file CommandLineOptions.cpp.

References g_approx_quantile_buffer, g_approx_quantile_centroids, g_bitmap_memory_limit, g_enable_bump_allocator, g_enable_calcite_ddl_parser, g_enable_columnar_output, g_enable_direct_columnarization, g_enable_filter_function, g_enable_seconds_refresh, g_enable_smem_group_by, g_enable_smem_grouped_non_count_agg, g_enable_smem_non_grouped_agg, g_enable_table_functions, g_enable_window_functions, g_fraction_code_cache_to_evict, g_gpu_smem_threshold, g_large_ndv_multiplier, g_large_ndv_threshold, g_max_memory_allocation_size, g_min_memory_allocation_size, g_skip_intermediate_count, g_strip_join_covered_quals, g_use_table_device_offset, and g_use_tbb_pool.

Referenced by CommandLineOptions().

396  {
397  developer_desc.add_options()("dev-options", "Print internal developer options.");
398  developer_desc.add_options()(
399  "enable-calcite-view-optimize",
402  ->implicit_value(true),
403  "Enable additional calcite (query plan) optimizations when a view is part of the "
404  "query.");
405  developer_desc.add_options()(
406  "enable-columnar-output",
407  po::value<bool>(&g_enable_columnar_output)
408  ->default_value(g_enable_columnar_output)
409  ->implicit_value(true),
410  "Enable columnar output for intermediate/final query steps.");
411  developer_desc.add_options()("enable-legacy-syntax",
412  po::value<bool>(&enable_legacy_syntax)
413  ->default_value(enable_legacy_syntax)
414  ->implicit_value(true),
415  "Enable legacy syntax.");
416  developer_desc.add_options()(
417  "enable-multifrag",
418  po::value<bool>(&allow_multifrag)
419  ->default_value(allow_multifrag)
420  ->implicit_value(true),
421  "Enable execution over multiple fragments in a single round-trip to GPU.");
422  developer_desc.add_options()(
423  "enable-shared-mem-group-by",
424  po::value<bool>(&g_enable_smem_group_by)
425  ->default_value(g_enable_smem_group_by)
426  ->implicit_value(true),
427  "Enable using GPU shared memory for some GROUP BY queries.");
428  developer_desc.add_options()("num-executors",
429  po::value<int>(&system_parameters.num_executors)
430  ->default_value(system_parameters.num_executors),
431  "Number of executors to run in parallel.");
432  developer_desc.add_options()(
433  "gpu-shared-mem-threshold",
434  po::value<size_t>(&g_gpu_smem_threshold)->default_value(g_gpu_smem_threshold),
435  "GPU shared memory threshold (in bytes). If query requires larger buffers than "
436  "this threshold, we disable those optimizations. 0 (default) means no static cap.");
437  developer_desc.add_options()(
438  "enable-shared-mem-grouped-non-count-agg",
439  po::value<bool>(&g_enable_smem_grouped_non_count_agg)
440  ->default_value(g_enable_smem_grouped_non_count_agg)
441  ->implicit_value(true),
442  "Enable using GPU shared memory for grouped non-count aggregate queries.");
443  developer_desc.add_options()(
444  "enable-shared-mem-non-grouped-agg",
445  po::value<bool>(&g_enable_smem_non_grouped_agg)
446  ->default_value(g_enable_smem_non_grouped_agg)
447  ->implicit_value(true),
448  "Enable using GPU shared memory for non-grouped aggregate queries.");
449  developer_desc.add_options()("enable-direct-columnarization",
450  po::value<bool>(&g_enable_direct_columnarization)
451  ->default_value(g_enable_direct_columnarization)
452  ->implicit_value(true),
453  "Enables/disables a more optimized columnarization method "
454  "for intermediate steps in multi-step queries.");
455  developer_desc.add_options()(
456  "offset-device-by-table-id",
457  po::value<bool>(&g_use_table_device_offset)
458  ->default_value(g_use_table_device_offset)
459  ->implicit_value(true),
460  "Enables/disables offseting the chosen device ID by the table ID for a given "
461  "fragment. This improves balance of fragments across GPUs.");
462  developer_desc.add_options()("enable-window-functions",
463  po::value<bool>(&g_enable_window_functions)
464  ->default_value(g_enable_window_functions)
465  ->implicit_value(true),
466  "Enable experimental window function support.");
467  developer_desc.add_options()("enable-table-functions",
468  po::value<bool>(&g_enable_table_functions)
469  ->default_value(g_enable_table_functions)
470  ->implicit_value(true),
471  "Enable experimental table functions support.");
472  developer_desc.add_options()(
473  "jit-debug-ir",
474  po::value<bool>(&jit_debug)->default_value(jit_debug)->implicit_value(true),
475  "Enable runtime debugger support for the JIT. Note that this flag is "
476  "incompatible "
477  "with the `ENABLE_JIT_DEBUG` build flag. The generated code can be found at "
478  "`/tmp/mapdquery`.");
479  developer_desc.add_options()(
480  "intel-jit-profile",
481  po::value<bool>(&intel_jit_profile)
482  ->default_value(intel_jit_profile)
483  ->implicit_value(true),
484  "Enable runtime support for the JIT code profiling using Intel VTune.");
485  developer_desc.add_options()(
486  "enable-modern-thread-pool",
487  po::value<bool>(&g_use_tbb_pool)
488  ->default_value(g_use_tbb_pool)
489  ->implicit_value(true),
490  "Enable a new thread pool implementation for queuing kernels for execution.");
491  developer_desc.add_options()(
492  "skip-intermediate-count",
493  po::value<bool>(&g_skip_intermediate_count)
494  ->default_value(g_skip_intermediate_count)
495  ->implicit_value(true),
496  "Skip pre-flight counts for intermediate projections with no filters.");
497  developer_desc.add_options()(
498  "strip-join-covered-quals",
499  po::value<bool>(&g_strip_join_covered_quals)
500  ->default_value(g_strip_join_covered_quals)
501  ->implicit_value(true),
502  "Remove quals from the filtered count if they are covered by a "
503  "join condition (currently only ST_Contains).");
504 
505  developer_desc.add_options()(
506  "min-cpu-slab-size",
507  po::value<size_t>(&system_parameters.min_cpu_slab_size)
508  ->default_value(system_parameters.min_cpu_slab_size),
509  "Min slab size (size of memory allocations) for CPU buffer pool.");
510  developer_desc.add_options()(
511  "max-cpu-slab-size",
512  po::value<size_t>(&system_parameters.max_cpu_slab_size)
513  ->default_value(system_parameters.max_cpu_slab_size),
514  "Max CPU buffer pool slab size (size of memory allocations). Note if "
515  "there is not enough free memory to accomodate the target slab size, smaller "
516  "slabs will be allocated, down to the minimum size specified by "
517  "min-cpu-slab-size.");
518  developer_desc.add_options()(
519  "min-gpu-slab-size",
520  po::value<size_t>(&system_parameters.min_gpu_slab_size)
521  ->default_value(system_parameters.min_gpu_slab_size),
522  "Min slab size (size of memory allocations) for GPU buffer pools.");
523  developer_desc.add_options()(
524  "max-gpu-slab-size",
525  po::value<size_t>(&system_parameters.max_gpu_slab_size)
526  ->default_value(system_parameters.max_gpu_slab_size),
527  "Max GPU buffer pool slab size (size of memory allocations). Note if "
528  "there is not enough free memory to accomodate the target slab size, smaller "
529  "slabs will be allocated, down to the minimum size speified by "
530  "min-gpu-slab-size.");
531 
532  developer_desc.add_options()(
533  "max-output-projection-allocation-bytes",
534  po::value<size_t>(&g_max_memory_allocation_size)
535  ->default_value(g_max_memory_allocation_size),
536  "Maximum allocation size for a fixed output buffer allocation for projection "
537  "queries with no pre-flight count. Default is the maximum slab size (sizes "
538  "greater "
539  "than the maximum slab size have no affect). Requires bump allocator.");
540  developer_desc.add_options()(
541  "min-output-projection-allocation-bytes",
542  po::value<size_t>(&g_min_memory_allocation_size)
543  ->default_value(g_min_memory_allocation_size),
544  "Minimum allocation size for a fixed output buffer allocation for projection "
545  "queries with no pre-flight count. If an allocation of this size cannot be "
546  "obtained, the query will be retried with different execution parameters and/or "
547  "on "
548  "CPU (if allow-cpu-retry is enabled). Requires bump allocator.");
549  developer_desc.add_options()("enable-bump-allocator",
550  po::value<bool>(&g_enable_bump_allocator)
551  ->default_value(g_enable_bump_allocator)
552  ->implicit_value(true),
553  "Enable the bump allocator for projection queries on "
554  "GPU. The bump allocator will "
555  "allocate a fixed size buffer for each query, track the "
556  "number of rows passing the "
557  "kernel during query execution, and copy back only the "
558  "rows that passed the kernel "
559  "to CPU after execution. When disabled, pre-flight "
560  "count queries are used to size "
561  "the output buffer for projection queries.");
562  developer_desc.add_options()(
563  "code-cache-eviction-percent",
564  po::value<float>(&g_fraction_code_cache_to_evict)
565  ->default_value(g_fraction_code_cache_to_evict),
566  "Percentage of the GPU code cache to evict if an out of memory error is "
567  "encountered while attempting to place generated code on the GPU.");
568 
569  developer_desc.add_options()("ssl-cert",
570  po::value<std::string>(&system_parameters.ssl_cert_file)
571  ->default_value(std::string("")),
572  "SSL Validated public certficate.");
573 
574  developer_desc.add_options()("ssl-private-key",
575  po::value<std::string>(&system_parameters.ssl_key_file)
576  ->default_value(std::string("")),
577  "SSL private key file.");
578  // Note ssl_trust_store is passed through to Calcite via system_parameters
579  // todo(jack): add ensure ssl-trust-store exists if cert and private key in use
580  developer_desc.add_options()("ssl-trust-store",
581  po::value<std::string>(&system_parameters.ssl_trust_store)
582  ->default_value(std::string("")),
583  "SSL public CA certifcates (java trust store) to validate "
584  "TLS connections (passed through to the Calcite server).");
585 
586  developer_desc.add_options()(
587  "ssl-trust-password",
588  po::value<std::string>(&system_parameters.ssl_trust_password)
589  ->default_value(std::string("")),
590  "SSL password for java trust store provided via --ssl-trust-store parameter.");
591 
592  developer_desc.add_options()(
593  "ssl-trust-ca",
594  po::value<std::string>(&system_parameters.ssl_trust_ca_file)
595  ->default_value(std::string("")),
596  "SSL public CA certificates to validate TLS connection(as a client).");
597 
598  developer_desc.add_options()(
599  "ssl-trust-ca-server",
600  po::value<std::string>(&authMetadata.ca_file_name)->default_value(std::string("")),
601  "SSL public CA certificates to validate TLS connection(as a server).");
602 
603  developer_desc.add_options()("ssl-keystore",
604  po::value<std::string>(&system_parameters.ssl_keystore)
605  ->default_value(std::string("")),
606  "SSL server credentials as a java key store (passed "
607  "through to the Calcite server).");
608 
609  developer_desc.add_options()(
610  "ssl-keystore-password",
611  po::value<std::string>(&system_parameters.ssl_keystore_password)
612  ->default_value(std::string("")),
613  "SSL password for java keystore, provide by via --ssl-keystore.");
614 
615  developer_desc.add_options()(
616  "udf",
617  po::value<std::string>(&udf_file_name),
618  "Load user defined extension functions from this file at startup. The file is "
619  "expected to be a C/C++ file with extension .cpp.");
620 
621  developer_desc.add_options()(
622  "udf-compiler-path",
623  po::value<std::string>(&udf_compiler_path),
624  "Provide absolute path to clang++ used in udf compilation.");
625 
626  developer_desc.add_options()("udf-compiler-options",
627  po::value<std::vector<std::string>>(&udf_compiler_options),
628  "Specify compiler options to tailor udf compilation.");
629 
630 #ifdef ENABLE_GEOS
631  developer_desc.add_options()("libgeos-so-filename",
632  po::value<std::string>(&libgeos_so_filename),
633  "Specify libgeos shared object filename to be used for "
634  "geos-backed geo opertations.");
635 #endif
636  developer_desc.add_options()(
637  "large-ndv-threshold",
638  po::value<int64_t>(&g_large_ndv_threshold)->default_value(g_large_ndv_threshold));
639  developer_desc.add_options()(
640  "large-ndv-multiplier",
641  po::value<size_t>(&g_large_ndv_multiplier)->default_value(g_large_ndv_multiplier));
642  developer_desc.add_options()("approx_quantile_buffer",
643  po::value<size_t>(&g_approx_quantile_buffer)
644  ->default_value(g_approx_quantile_buffer));
645  developer_desc.add_options()("approx_quantile_centroids",
646  po::value<size_t>(&g_approx_quantile_centroids)
647  ->default_value(g_approx_quantile_centroids));
648  developer_desc.add_options()(
649  "bitmap-memory-limit",
650  po::value<int64_t>(&g_bitmap_memory_limit)->default_value(g_bitmap_memory_limit),
651  "Limit for count distinct bitmap memory use. The limit is computed by taking the "
652  "size of the group by buffer (entry count in Query Memory Descriptor) and "
653  "multiplying it by the number of count distinct expression and the size of bitmap "
654  "required for each. For approx_count_distinct this is typically 8192 bytes.");
655  developer_desc.add_options()(
656  "enable-filter-function",
657  po::value<bool>(&g_enable_filter_function)
658  ->default_value(g_enable_filter_function)
659  ->implicit_value(true),
660  "Enable the filter function protection feature for the SQL JIT compiler. "
661  "Normally should be on but techs might want to disable for troubleshooting.");
662  developer_desc.add_options()(
663  "enable-calcite-ddl",
664  po::value<bool>(&g_enable_calcite_ddl_parser)
665  ->default_value(g_enable_calcite_ddl_parser)
666  ->implicit_value(true),
667  "Enable using Calcite for supported DDL parsing when available.");
668  developer_desc.add_options()(
669  "enable-seconds-refresh-interval",
670  po::value<bool>(&g_enable_seconds_refresh)
671  ->default_value(g_enable_seconds_refresh)
672  ->implicit_value(true),
673  "Enable foreign table seconds refresh interval for testing purposes.");
674 }
bool g_enable_smem_group_by
bool g_enable_calcite_ddl_parser
Definition: ParserNode.cpp:72
bool g_strip_join_covered_quals
Definition: Execute.cpp:97
int64_t g_large_ndv_threshold
bool g_enable_direct_columnarization
Definition: Execute.cpp:108
std::string udf_compiler_path
bool g_skip_intermediate_count
bool enable_calcite_view_optimize
float g_fraction_code_cache_to_evict
bool g_enable_smem_non_grouped_agg
Definition: Execute.cpp:122
std::string ssl_trust_ca_file
size_t g_large_ndv_multiplier
bool g_enable_columnar_output
Definition: Execute.cpp:93
std::string ssl_trust_store
size_t g_max_memory_allocation_size
Definition: Execute.cpp:102
bool g_enable_seconds_refresh
std::string ca_file_name
Definition: AuthMetadata.h:31
std::string ssl_key_file
AuthMetadata authMetadata
bool g_enable_window_functions
Definition: Execute.cpp:100
size_t g_min_memory_allocation_size
Definition: Execute.cpp:103
bool g_enable_smem_grouped_non_count_agg
Definition: Execute.cpp:119
std::vector< std::string > udf_compiler_options
bool g_enable_filter_function
Definition: Execute.cpp:79
std::string ssl_keystore_password
std::string ssl_trust_password
bool g_enable_bump_allocator
Definition: Execute.cpp:106
bool g_use_table_device_offset
size_t g_approx_quantile_centroids
Definition: Execute.cpp:129
std::string ssl_keystore
po::options_description developer_desc
size_t g_approx_quantile_buffer
Definition: Execute.cpp:128
bool g_use_tbb_pool
Definition: Execute.cpp:78
int64_t g_bitmap_memory_limit
bool g_enable_table_functions
Definition: Execute.cpp:101
SystemParameters system_parameters
size_t g_gpu_smem_threshold
Definition: Execute.cpp:114
std::string ssl_cert_file
+ Here is the caller graph for this function:

◆ fillOptions()

void CommandLineOptions::fillOptions ( )

Definition at line 67 of file CommandLineOptions.cpp.

References g_allow_cpu_retry, g_bigint_count, g_cache_string_hash, g_enable_debug_timer, g_enable_experimental_string_functions, g_enable_filter_push_down, g_enable_fsi, g_enable_hashjoin_many_to_many, g_enable_interop, g_enable_overlaps_hashjoin, g_enable_stringdict_parallel, g_enable_thrift_logs, g_enable_union, g_filter_push_down_high_frac, g_filter_push_down_low_frac, g_filter_push_down_passing_row_ubound, g_from_table_reordering, g_hll_precision_bits, g_inner_join_fragment_skipping, Catalog_Namespace::g_log_user_id, g_max_import_threads, g_null_div_by_zero, g_overlaps_max_table_size_bytes, g_trivial_loop_join_threshold, and run_benchmark_import::required.

Referenced by CommandLineOptions().

67  {
68  help_desc.add_options()("help,h", "Show available options.");
69  help_desc.add_options()(
70  "allow-cpu-retry",
71  po::value<bool>(&g_allow_cpu_retry)
72  ->default_value(g_allow_cpu_retry)
73  ->implicit_value(true),
74  R"(Allow the queries which failed on GPU to retry on CPU, even when watchdog is enabled.)");
75  help_desc.add_options()("allow-loop-joins",
76  po::value<bool>(&allow_loop_joins)
77  ->default_value(allow_loop_joins)
78  ->implicit_value(true),
79  "Enable loop joins.");
80  help_desc.add_options()("bigint-count",
81  po::value<bool>(&g_bigint_count)
82  ->default_value(g_bigint_count)
83  ->implicit_value(true),
84  "Use 64-bit count.");
85  help_desc.add_options()("calcite-max-mem",
86  po::value<size_t>(&system_parameters.calcite_max_mem)
87  ->default_value(system_parameters.calcite_max_mem),
88  "Max memory available to calcite JVM.");
89  if (!dist_v5_) {
90  help_desc.add_options()("calcite-port",
91  po::value<int>(&system_parameters.calcite_port)
92  ->default_value(system_parameters.calcite_port),
93  "Calcite port number.");
94  }
95  help_desc.add_options()("config",
96  po::value<std::string>(&system_parameters.config_file),
97  "Path to server configuration file.");
98  help_desc.add_options()("cpu-buffer-mem-bytes",
99  po::value<size_t>(&system_parameters.cpu_buffer_mem_bytes)
100  ->default_value(system_parameters.cpu_buffer_mem_bytes),
101  "Size of memory reserved for CPU buffers, in bytes.");
102 
103  help_desc.add_options()(
104  "cpu-only",
105  po::value<bool>(&cpu_only)->default_value(cpu_only)->implicit_value(true),
106  "Run on CPU only, even if GPUs are available.");
107  help_desc.add_options()("cuda-block-size",
108  po::value<size_t>(&system_parameters.cuda_block_size)
109  ->default_value(system_parameters.cuda_block_size),
110  "Size of block to use on GPU.");
111  help_desc.add_options()("cuda-grid-size",
112  po::value<size_t>(&system_parameters.cuda_grid_size)
113  ->default_value(system_parameters.cuda_grid_size),
114  "Size of grid to use on GPU.");
115  if (!dist_v5_) {
116  help_desc.add_options()(
117  "data",
118  po::value<std::string>(&base_path)->required()->default_value("data"),
119  "Directory path to OmniSci data storage (catalogs, raw data, log files, etc).");
120  positional_options.add("data", 1);
121  }
122  help_desc.add_options()("db-query-list",
123  po::value<std::string>(&db_query_file),
124  "Path to file containing OmniSci warmup queries.");
125  help_desc.add_options()(
126  "exit-after-warmup",
127  po::value<bool>(&exit_after_warmup)->default_value(false)->implicit_value(true),
128  "Exit after OmniSci warmup queries.");
129  help_desc.add_options()("dynamic-watchdog-time-limit",
130  po::value<unsigned>(&dynamic_watchdog_time_limit)
131  ->default_value(dynamic_watchdog_time_limit)
132  ->implicit_value(10000),
133  "Dynamic watchdog time limit, in milliseconds.");
134  help_desc.add_options()("enable-debug-timer",
135  po::value<bool>(&g_enable_debug_timer)
136  ->default_value(g_enable_debug_timer)
137  ->implicit_value(true),
138  "Enable debug timer logging.");
139  help_desc.add_options()("enable-dynamic-watchdog",
140  po::value<bool>(&enable_dynamic_watchdog)
141  ->default_value(enable_dynamic_watchdog)
142  ->implicit_value(true),
143  "Enable dynamic watchdog.");
144  help_desc.add_options()("enable-filter-push-down",
145  po::value<bool>(&g_enable_filter_push_down)
146  ->default_value(g_enable_filter_push_down)
147  ->implicit_value(true),
148  "Enable filter push down through joins.");
149  help_desc.add_options()("enable-overlaps-hashjoin",
150  po::value<bool>(&g_enable_overlaps_hashjoin)
151  ->default_value(g_enable_overlaps_hashjoin)
152  ->implicit_value(true),
153  "Enable the overlaps hash join framework allowing for range "
154  "join (e.g. spatial overlaps) computation using a hash table.");
155  help_desc.add_options()("enable-hashjoin-many-to-many",
156  po::value<bool>(&g_enable_hashjoin_many_to_many)
157  ->default_value(g_enable_hashjoin_many_to_many)
158  ->implicit_value(true),
159  "Enable the overlaps hash join framework allowing for range "
160  "join (e.g. spatial overlaps) computation using a hash table.");
161  help_desc.add_options()("enable-runtime-query-interrupt",
162  po::value<bool>(&enable_runtime_query_interrupt)
163  ->default_value(enable_runtime_query_interrupt)
164  ->implicit_value(true),
165  "Enable runtime query interrupt.");
166  help_desc.add_options()("pending-query-interrupt-freq",
167  po::value<unsigned>(&pending_query_interrupt_freq)
168  ->default_value(pending_query_interrupt_freq)
169  ->implicit_value(1000),
170  "A frequency of checking the request of pending query "
171  "interrupt from user (in millisecond).");
172  help_desc.add_options()(
173  "running-query-interrupt-freq",
174  po::value<double>(&running_query_interrupt_freq)
175  ->default_value(running_query_interrupt_freq)
176  ->implicit_value(0.5),
177  "A frequency of checking the request of running query "
178  "interrupt from user (0.0 (less frequent) ~ (more frequent) 1.0).");
179  help_desc.add_options()("use-estimator-result-cache",
180  po::value<bool>(&use_estimator_result_cache)
181  ->default_value(use_estimator_result_cache)
182  ->implicit_value(true),
183  "Use estimator result cache.");
184  if (!dist_v5_) {
185  help_desc.add_options()(
186  "enable-string-dict-hash-cache",
187  po::value<bool>(&g_cache_string_hash)
188  ->default_value(g_cache_string_hash)
189  ->implicit_value(true),
190  "Cache string hash values in the string dictionary server during import.");
191  }
192  help_desc.add_options()(
193  "enable-thrift-logs",
194  po::value<bool>(&g_enable_thrift_logs)
195  ->default_value(g_enable_thrift_logs)
196  ->implicit_value(true),
197  "Enable writing messages directly from thrift to stdout/stderr.");
198  help_desc.add_options()("enable-watchdog",
199  po::value<bool>(&enable_watchdog)
200  ->default_value(enable_watchdog)
201  ->implicit_value(true),
202  "Enable watchdog.");
203  help_desc.add_options()(
204  "filter-push-down-low-frac",
205  po::value<float>(&g_filter_push_down_low_frac)
206  ->default_value(g_filter_push_down_low_frac)
207  ->implicit_value(g_filter_push_down_low_frac),
208  "Lower threshold for selectivity of filters that are pushed down.");
209  help_desc.add_options()(
210  "filter-push-down-high-frac",
211  po::value<float>(&g_filter_push_down_high_frac)
212  ->default_value(g_filter_push_down_high_frac)
213  ->implicit_value(g_filter_push_down_high_frac),
214  "Higher threshold for selectivity of filters that are pushed down.");
215  help_desc.add_options()("filter-push-down-passing-row-ubound",
216  po::value<size_t>(&g_filter_push_down_passing_row_ubound)
218  ->implicit_value(g_filter_push_down_passing_row_ubound),
219  "Upperbound on the number of rows that should pass the filter "
220  "if the selectivity is less than "
221  "the high fraction threshold.");
222  help_desc.add_options()("from-table-reordering",
223  po::value<bool>(&g_from_table_reordering)
224  ->default_value(g_from_table_reordering)
225  ->implicit_value(true),
226  "Enable automatic table reordering in FROM clause.");
227  help_desc.add_options()("gpu-buffer-mem-bytes",
228  po::value<size_t>(&system_parameters.gpu_buffer_mem_bytes)
229  ->default_value(system_parameters.gpu_buffer_mem_bytes),
230  "Size of memory reserved for GPU buffers, in bytes, per GPU.");
231  help_desc.add_options()("gpu-input-mem-limit",
232  po::value<double>(&system_parameters.gpu_input_mem_limit)
233  ->default_value(system_parameters.gpu_input_mem_limit),
234  "Force query to CPU when input data memory usage exceeds this "
235  "percentage of available GPU memory.");
236  help_desc.add_options()(
237  "hll-precision-bits",
238  po::value<int>(&g_hll_precision_bits)
239  ->default_value(g_hll_precision_bits)
240  ->implicit_value(g_hll_precision_bits),
241  "Number of bits used from the hash value used to specify the bucket number.");
242  if (!dist_v5_) {
243  help_desc.add_options()("http-port",
244  po::value<int>(&http_port)->default_value(http_port),
245  "HTTP port number.");
246  }
247  help_desc.add_options()(
248  "idle-session-duration",
249  po::value<int>(&idle_session_duration)->default_value(idle_session_duration),
250  "Maximum duration of idle session.");
251  help_desc.add_options()("inner-join-fragment-skipping",
252  po::value<bool>(&g_inner_join_fragment_skipping)
253  ->default_value(g_inner_join_fragment_skipping)
254  ->implicit_value(true),
255  "Enable/disable inner join fragment skipping. This feature is "
256  "considered stable and is enabled by default. This "
257  "parameter will be removed in a future release.");
258  help_desc.add_options()(
259  "max-session-duration",
260  po::value<int>(&max_session_duration)->default_value(max_session_duration),
261  "Maximum duration of active session.");
262  help_desc.add_options()(
263  "null-div-by-zero",
264  po::value<bool>(&g_null_div_by_zero)
265  ->default_value(g_null_div_by_zero)
266  ->implicit_value(true),
267  "Return null on division by zero instead of throwing an exception.");
268  help_desc.add_options()(
269  "num-reader-threads",
270  po::value<size_t>(&num_reader_threads)->default_value(num_reader_threads),
271  "Number of reader threads to use.");
272  help_desc.add_options()(
273  "max-import-threads",
274  po::value<size_t>(&g_max_import_threads)->default_value(g_max_import_threads),
275  "Max number of default import threads to use (num hardware threads will be used "
276  "instead if lower). Can be overriden with copy statement threads option).");
277  help_desc.add_options()(
278  "overlaps-max-table-size-bytes",
279  po::value<size_t>(&g_overlaps_max_table_size_bytes)
280  ->default_value(g_overlaps_max_table_size_bytes),
281  "The maximum size in bytes of the hash table for an overlaps hash join.");
282  if (!dist_v5_) {
283  help_desc.add_options()("port,p",
284  po::value<int>(&system_parameters.omnisci_server_port)
285  ->default_value(system_parameters.omnisci_server_port),
286  "TCP Port number.");
287  }
288  help_desc.add_options()("num-gpus",
289  po::value<int>(&num_gpus)->default_value(num_gpus),
290  "Number of gpus to use.");
291  help_desc.add_options()(
292  "read-only",
293  po::value<bool>(&read_only)->default_value(read_only)->implicit_value(true),
294  "Enable read-only mode.");
295 
296  help_desc.add_options()(
297  "res-gpu-mem",
298  po::value<size_t>(&reserved_gpu_mem)->default_value(reserved_gpu_mem),
299  "Reduces GPU memory available to the OmniSci allocator by this amount. Used for "
300  "compiled code cache and ancillary GPU functions and other processes that may also "
301  "be using the GPU concurrent with OmniSciDB.");
302 
303  help_desc.add_options()("start-gpu",
304  po::value<int>(&start_gpu)->default_value(start_gpu),
305  "First gpu to use.");
306  help_desc.add_options()("trivial-loop-join-threshold",
307  po::value<unsigned>(&g_trivial_loop_join_threshold)
308  ->default_value(g_trivial_loop_join_threshold)
309  ->implicit_value(1000),
310  "The maximum number of rows in the inner table of a loop join "
311  "considered to be trivially small.");
312  help_desc.add_options()("verbose",
313  po::value<bool>(&verbose_logging)
314  ->default_value(verbose_logging)
315  ->implicit_value(true),
316  "Write additional debug log messages to server logs.");
317  help_desc.add_options()(
318  "enable-runtime-udf",
319  po::value<bool>(&enable_runtime_udf)
320  ->default_value(enable_runtime_udf)
321  ->implicit_value(true),
322  "Enable runtime UDF registration by passing signatures and corresponding LLVM IR "
323  "to the `register_runtime_udf` endpoint. For use with the Python Remote Backend "
324  "Compiler server, packaged separately.");
325  help_desc.add_options()("version,v", "Print Version Number.");
326  help_desc.add_options()("enable-experimental-string-functions",
329  ->implicit_value(true),
330  "Enable experimental string functions.");
331  help_desc.add_options()(
332  "enable-fsi",
333  po::value<bool>(&g_enable_fsi)->default_value(g_enable_fsi)->implicit_value(true),
334  "Enable foreign storage interface.");
335  help_desc.add_options()("disk-cache-path",
336  po::value<std::string>(&disk_cache_config.path),
337  "Specify the path for the disk cache.");
338 
339 #ifdef ENABLE_GENERAL_DISK_CACHE
340  help_desc.add_options()(
341  "disk-cache-level",
342  po::value<std::string>(&(disk_cache_level))->default_value("foreign_tables"),
343  "Specify level of disk cache. Valid options are 'foreign_tables', "
344  "'local_tables', 'none', and 'all'.");
345 #else
346  help_desc.add_options()(
347  "disk-cache-level",
348  po::value<std::string>(&(disk_cache_level))->default_value("foreign_tables"),
349  "Specify level of disk cache. Valid options are 'foreign_tables' "
350  "and 'none'.");
351 #endif // ENABLE_GENERAL_DISK_CACHE
352 
353  help_desc.add_options()(
354  "enable-interoperability",
355  po::value<bool>(&g_enable_interop)
356  ->default_value(g_enable_interop)
357  ->implicit_value(true),
358  "Enable offloading of query portions to an external execution engine.");
359  help_desc.add_options()("enable-union",
360  po::value<bool>(&g_enable_union)
361  ->default_value(g_enable_union)
362  ->implicit_value(true),
363  "Enable UNION ALL SQL clause.");
364  help_desc.add_options()(
365  "calcite-service-timeout",
366  po::value<size_t>(&system_parameters.calcite_timeout)
367  ->default_value(system_parameters.calcite_timeout),
368  "Calcite server timeout (milliseconds). Increase this on systems with frequent "
369  "schema changes or when running large numbers of parallel queries.");
370  help_desc.add_options()("calcite-service-keepalive",
371  po::value<size_t>(&system_parameters.calcite_keepalive)
372  ->default_value(system_parameters.calcite_keepalive)
373  ->implicit_value(true),
374  "Enable keepalive on Calcite connections.");
375  help_desc.add_options()(
376  "stringdict-parallelizm",
377  po::value<bool>(&g_enable_stringdict_parallel)
378  ->default_value(g_enable_stringdict_parallel)
379  ->implicit_value(true),
380  "Allow StringDictionary to parallelize loads using multiple threads");
381  help_desc.add_options()(
382  "log-user-id",
383  po::value<bool>(&Catalog_Namespace::g_log_user_id)
384  ->default_value(Catalog_Namespace::g_log_user_id)
385  ->implicit_value(true),
386  "Log userId integer in place of the userName (when available).");
387  help_desc.add_options()("log-user-origin",
388  po::value<bool>(&log_user_origin)
389  ->default_value(log_user_origin)
390  ->implicit_value(true),
391  "Lookup the origin of inbound connections by IP address/DNS "
392  "name, and print this information as part of stdlog.");
394 }
float g_filter_push_down_low_frac
Definition: Execute.cpp:90
logger::LogOptions log_options_
bool g_cache_string_hash
po::options_description help_desc
bool g_enable_union
DiskCacheConfig disk_cache_config
bool g_enable_debug_timer
Definition: Logger.cpp:17
boost::program_options::options_description const & get_options() const
Definition: Logger.cpp:79
size_t g_filter_push_down_passing_row_ubound
Definition: Execute.cpp:92
unsigned g_trivial_loop_join_threshold
Definition: Execute.cpp:83
int g_hll_precision_bits
std::string config_file
bool g_enable_overlaps_hashjoin
Definition: Execute.cpp:94
bool g_inner_join_fragment_skipping
Definition: Execute.cpp:85
bool g_null_div_by_zero
Definition: Execute.cpp:82
bool g_enable_interop
bool g_from_table_reordering
Definition: Execute.cpp:84
bool g_enable_hashjoin_many_to_many
Definition: Execute.cpp:95
float g_filter_push_down_high_frac
Definition: Execute.cpp:91
bool g_bigint_count
size_t g_overlaps_max_table_size_bytes
Definition: Execute.cpp:96
bool g_enable_thrift_logs
unsigned pending_query_interrupt_freq
bool g_enable_experimental_string_functions
bool g_enable_filter_push_down
Definition: Execute.cpp:89
po::positional_options_description positional_options
bool g_allow_cpu_retry
Definition: Execute.cpp:81
bool g_enable_stringdict_parallel
std::string disk_cache_level
size_t g_max_import_threads
Definition: Importer.cpp:76
bool g_enable_fsi
Definition: Catalog.cpp:91
unsigned dynamic_watchdog_time_limit
SystemParameters system_parameters
+ Here is the caller graph for this function:

◆ getNodeIds()

std::string CommandLineOptions::getNodeIds ( )

◆ getNodeIdsArray()

std::vector<std::string> CommandLineOptions::getNodeIdsArray ( )

◆ init_logging()

void CommandLineOptions::init_logging ( )

Definition at line 58 of file CommandLineOptions.cpp.

References logger::DEBUG1, and logger::init().

58  {
61  }
65 }
logger::LogOptions log_options_
void init(LogOptions const &log_opts)
Definition: Logger.cpp:280
Severity severity_
Definition: Logger.h:118
void set_base_path(std::string const &base_path)
Definition: Logger.cpp:93
+ Here is the call graph for this function:

◆ parse_command_line()

boost::optional< int > CommandLineOptions::parse_command_line ( int  argc,
char const *const *  argv,
const bool  should_init_logging = false 
)

Definition at line 860 of file CommandLineOptions.cpp.

References logger::ERROR, g_dynamic_watchdog_time_limit, g_enable_dynamic_watchdog, g_enable_filter_push_down, g_enable_runtime_query_interrupt, g_enable_watchdog, g_from_table_reordering, g_max_import_threads, g_pending_query_interrupt_freq, g_running_query_interrupt_freq, g_use_estimator_result_cache, logger::INFO, LOG, MAPD_RELEASE, run, anonymous_namespace{CommandLineOptions.cpp}::sanitize_config_file(), and anonymous_namespace{CommandLineOptions.cpp}::trim_and_check_file_exists().

Referenced by main().

863  {
864  po::options_description all_desc("All options");
865  all_desc.add(help_desc).add(developer_desc);
866 
867  try {
868  po::store(po::command_line_parser(argc, argv)
869  .options(all_desc)
870  .positional(positional_options)
871  .run(),
872  vm);
873  po::notify(vm);
874 
875  if (vm.count("help")) {
876  std::cerr << "Usage: omnisci_server <data directory path> [-p <port number>] "
877  "[--http-port <http port number>] [--flush-log] [--version|-v]"
878  << std::endl
879  << std::endl;
880  std::cout << help_desc << std::endl;
881  return 0;
882  }
883  if (vm.count("dev-options")) {
884  std::cout << "Usage: omnisci_server <data directory path> [-p <port number>] "
885  "[--http-port <http port number>] [--flush-log] [--version|-v]"
886  << std::endl
887  << std::endl;
888  std::cout << developer_desc << std::endl;
889  return 0;
890  }
891  if (vm.count("version")) {
892  std::cout << "OmniSci Version: " << MAPD_RELEASE << std::endl;
893  return 0;
894  }
895 
896  if (vm.count("config")) {
897  std::ifstream settings_file(system_parameters.config_file);
898 
899  auto sanitized_settings = sanitize_config_file(settings_file);
900 
901  po::store(po::parse_config_file(sanitized_settings, all_desc, false), vm);
902  po::notify(vm);
903  settings_file.close();
904  }
905 
906  if (should_init_logging) {
907  init_logging();
908  }
909 
911  return 1;
912  }
913  if (!trim_and_check_file_exists(authMetadata.ca_file_name, "ca file name")) {
914  return 1;
915  }
917  "ssl trust store")) {
918  return 1;
919  }
921  return 1;
922  }
924  return 1;
925  }
927  return 1;
928  }
929 
937  } catch (po::error& e) {
938  std::cerr << "Usage Error: " << e.what() << std::endl;
939  return 1;
940  }
941 
942  if (g_hll_precision_bits < 1 || g_hll_precision_bits > 16) {
943  std::cerr << "hll-precision-bits must be between 1 and 16." << std::endl;
944  return 1;
945  }
946 
948  LOG(INFO) << " From clause table reordering is disabled";
949  }
950 
952  LOG(INFO) << " Filter push down for JOIN is enabled";
953  }
954 
955  if (vm.count("udf")) {
956  boost::algorithm::trim_if(udf_file_name, boost::is_any_of("\"'"));
957 
958  if (!boost::filesystem::exists(udf_file_name)) {
959  LOG(ERROR) << " User defined function file " << udf_file_name << " does not exist.";
960  return 1;
961  }
962 
963  LOG(INFO) << " User provided extension functions loaded from " << udf_file_name;
964  }
965 
966  if (vm.count("udf-compiler-path")) {
967  boost::algorithm::trim_if(udf_compiler_path, boost::is_any_of("\"'"));
968  }
969 
970  auto trim_string = [](std::string& s) {
971  boost::algorithm::trim_if(s, boost::is_any_of("\"'"));
972  };
973 
974  if (vm.count("udf-compiler-options")) {
975  std::for_each(udf_compiler_options.begin(), udf_compiler_options.end(), trim_string);
976  }
977 
978  if (enable_runtime_udf) {
979  LOG(INFO) << " Runtime user defined extension functions enabled globally.";
980  }
981 
982  boost::algorithm::trim_if(system_parameters.ha_brokers, boost::is_any_of("\"'"));
983  boost::algorithm::trim_if(system_parameters.ha_group_id, boost::is_any_of("\"'"));
984  boost::algorithm::trim_if(system_parameters.ha_shared_data, boost::is_any_of("\"'"));
985  boost::algorithm::trim_if(system_parameters.ha_unique_server_id,
986  boost::is_any_of("\"'"));
987 
988  if (!system_parameters.ha_group_id.empty()) {
989  LOG(INFO) << " HA group id " << system_parameters.ha_group_id;
991  LOG(ERROR) << "Starting server in HA mode --ha-unique-server-id must be set ";
992  return 5;
993  } else {
994  LOG(INFO) << " HA unique server id " << system_parameters.ha_unique_server_id;
995  }
996  if (system_parameters.ha_brokers.empty()) {
997  LOG(ERROR) << "Starting server in HA mode --ha-brokers must be set ";
998  return 6;
999  } else {
1000  LOG(INFO) << " HA brokers " << system_parameters.ha_brokers;
1001  }
1002  if (system_parameters.ha_shared_data.empty()) {
1003  LOG(ERROR) << "Starting server in HA mode --ha-shared-data must be set ";
1004  return 7;
1005  } else {
1006  LOG(INFO) << " HA shared data is " << system_parameters.ha_shared_data;
1007  }
1008  }
1009 
1010  if (g_max_import_threads < 1) {
1011  std::cerr << "max-import-threads must be >= 1 (was set to " << g_max_import_threads
1012  << ")." << std::endl;
1013  return 8;
1014  } else {
1015  LOG(INFO) << " Max import threads " << g_max_import_threads;
1016  }
1017 
1018  LOG(INFO) << " cuda block size " << system_parameters.cuda_block_size;
1019  LOG(INFO) << " cuda grid size " << system_parameters.cuda_grid_size;
1020  LOG(INFO) << " Min CPU buffer pool slab size " << system_parameters.min_cpu_slab_size;
1021  LOG(INFO) << " Max CPU buffer pool slab size " << system_parameters.max_cpu_slab_size;
1022  LOG(INFO) << " Min GPU buffer pool slab size " << system_parameters.min_gpu_slab_size;
1023  LOG(INFO) << " Max GPU buffer pool slab size " << system_parameters.max_gpu_slab_size;
1024  LOG(INFO) << " calcite JVM max memory " << system_parameters.calcite_max_mem;
1025  LOG(INFO) << " OmniSci Server Port " << system_parameters.omnisci_server_port;
1026  LOG(INFO) << " OmniSci Calcite Port " << system_parameters.calcite_port;
1027  LOG(INFO) << " Enable Calcite view optimize "
1029 
1030  LOG(INFO) << " Allow Local Auth Fallback: "
1031  << (authMetadata.allowLocalAuthFallback ? "enabled" : "disabled");
1032 
1033  boost::algorithm::trim_if(authMetadata.distinguishedName, boost::is_any_of("\"'"));
1034  boost::algorithm::trim_if(authMetadata.uri, boost::is_any_of("\"'"));
1035  boost::algorithm::trim_if(authMetadata.ldapQueryUrl, boost::is_any_of("\"'"));
1036  boost::algorithm::trim_if(authMetadata.ldapRoleRegex, boost::is_any_of("\"'"));
1037  boost::algorithm::trim_if(authMetadata.ldapSuperUserRole, boost::is_any_of("\"'"));
1038 
1039  return boost::none;
1040 }
std::string distinguishedName
Definition: AuthMetadata.h:25
double g_running_query_interrupt_freq
Definition: Execute.cpp:113
std::string ldapQueryUrl
Definition: AuthMetadata.h:26
bool trim_and_check_file_exists(std::string &filename, const std::string desc)
std::string ha_shared_data
std::string udf_compiler_path
unsigned g_pending_query_interrupt_freq
Definition: Execute.cpp:112
po::options_description help_desc
#define LOG(tag)
Definition: Logger.h:188
bool enable_calcite_view_optimize
std::string ldapRoleRegex
Definition: AuthMetadata.h:27
bool g_enable_dynamic_watchdog
Definition: Execute.cpp:77
std::string config_file
std::string ha_brokers
std::string ssl_trust_ca_file
std::string ssl_trust_store
bool g_from_table_reordering
Definition: Execute.cpp:84
std::string uri
Definition: AuthMetadata.h:24
std::string ha_unique_server_id
std::string ca_file_name
Definition: AuthMetadata.h:31
std::string ssl_key_file
AuthMetadata authMetadata
std::string ldapSuperUserRole
Definition: AuthMetadata.h:28
unsigned pending_query_interrupt_freq
std::stringstream sanitize_config_file(std::ifstream &in)
std::vector< std::string > udf_compiler_options
bool g_enable_filter_push_down
Definition: Execute.cpp:89
bool g_use_estimator_result_cache
Definition: Execute.cpp:111
bool allowLocalAuthFallback
Definition: AuthMetadata.h:32
po::positional_options_description positional_options
std::string ssl_keystore
bool g_enable_watchdog
Definition: Execute.cpp:76
po::options_description developer_desc
static const std::string MAPD_RELEASE
Definition: release.h:43
static bool run
po::variables_map vm
size_t g_max_import_threads
Definition: Importer.cpp:76
unsigned g_dynamic_watchdog_time_limit
Definition: Execute.cpp:80
std::string ha_group_id
bool g_enable_runtime_query_interrupt
Definition: Execute.cpp:110
unsigned dynamic_watchdog_time_limit
SystemParameters system_parameters
std::string ssl_cert_file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

void CommandLineOptions::validate ( )

Definition at line 721 of file CommandLineOptions.cpp.

References anonymous_namespace{CommandLineOptions.cpp}::addOptionalFileToBlacklist(), ddl_utils::FilePathBlacklist::addToBlacklist(), all, omnisci::close(), fsi, g_enable_debug_timer, g_enable_fsi, g_enable_s3_fsi, Catalog_Namespace::g_log_user_id, logger::INFO, ddl_utils::FilePathWhitelist::initializeFromConfigFile(), LOG, non_fsi, none, OMNISCI_SYSTEM_CATALOG, omnisci::open(), to_string(), and File_Namespace::write().

Referenced by main().

721  {
722  boost::algorithm::trim_if(base_path, boost::is_any_of("\"'"));
723  const auto data_path = boost::filesystem::path(base_path) / "mapd_data";
724  if (!boost::filesystem::exists(data_path)) {
725  throw std::runtime_error("OmniSci data directory does not exist at '" + base_path +
726  "'");
727  }
728 
729  {
730  const auto lock_file = boost::filesystem::path(base_path) / "omnisci_server_pid.lck";
731  auto pid = std::to_string(getpid());
732 
733  int pid_fd = open(lock_file.c_str(), O_RDWR | O_CREAT, 0644);
734  if (pid_fd == -1) {
735  auto err = std::string("Failed to open PID file ") + lock_file.c_str() + ". " +
736  strerror(errno) + ".";
737  throw std::runtime_error(err);
738  }
739  if (lockf(pid_fd, F_TLOCK, 0) == -1) {
740  close(pid_fd);
741  auto err = std::string("Another OmniSci Server is using data directory ") +
742  base_path + ".";
743  throw std::runtime_error(err);
744  }
745  if (ftruncate(pid_fd, 0) == -1) {
746  close(pid_fd);
747  auto err = std::string("Failed to truncate PID file ") + lock_file.c_str() + ". " +
748  strerror(errno) + ".";
749  throw std::runtime_error(err);
750  }
751  if (write(pid_fd, pid.c_str(), pid.length()) == -1) {
752  close(pid_fd);
753  auto err = std::string("Failed to write PID file ") + lock_file.c_str() + ". " +
754  strerror(errno) + ".";
755  throw std::runtime_error(err);
756  }
757  }
758  boost::algorithm::trim_if(db_query_file, boost::is_any_of("\"'"));
759  if (db_query_file.length() > 0 && !boost::filesystem::exists(db_query_file)) {
760  throw std::runtime_error("File containing DB queries " + db_query_file +
761  " does not exist.");
762  }
763  const auto db_file =
764  boost::filesystem::path(base_path) / "mapd_catalogs" / OMNISCI_SYSTEM_CATALOG;
765  if (!boost::filesystem::exists(db_file)) {
766  { // check old system catalog existsense
767  const auto db_file = boost::filesystem::path(base_path) / "mapd_catalogs/mapd";
768  if (!boost::filesystem::exists(db_file)) {
769  throw std::runtime_error("OmniSci system catalog " + OMNISCI_SYSTEM_CATALOG +
770  " does not exist.");
771  }
772  }
773  }
774  if (license_path.length() == 0) {
775  license_path = base_path + "/omnisci.license";
776  }
777 
778  // add all parameters to be displayed on startup
779  LOG(INFO) << "OmniSci started with data directory at '" << base_path << "'";
780  if (vm.count("license-path")) {
781  LOG(INFO) << "License key path set to '" << license_path << "'";
782  }
783  LOG(INFO) << " Watchdog is set to " << enable_watchdog;
784  LOG(INFO) << " Dynamic Watchdog is set to " << enable_dynamic_watchdog;
786  LOG(INFO) << " Dynamic Watchdog timeout is set to " << dynamic_watchdog_time_limit;
787  }
788  LOG(INFO) << " Runtime query interrupt is set to " << enable_runtime_query_interrupt;
790  LOG(INFO) << " A frequency of checking pending query interrupt request is set to "
791  << pending_query_interrupt_freq << " (in ms.)";
792  LOG(INFO) << " A frequency of checking running query interrupt request is set to "
793  << running_query_interrupt_freq << " (0.0 ~ 1.0)";
794  }
795 
796  LOG(INFO) << " Debug Timer is set to " << g_enable_debug_timer;
797  LOG(INFO) << " LogUserId is set to " << Catalog_Namespace::g_log_user_id;
798  LOG(INFO) << " Maximum Idle session duration " << idle_session_duration;
799  LOG(INFO) << " Maximum active session duration " << max_session_duration;
800 
802 
806  g_enable_s3_fsi = false;
807 
808  if (disk_cache_level == "foreign_tables") {
809  if (g_enable_fsi) {
811  LOG(INFO) << "Disk cache enabled for foreign tables only";
812  } else {
813  LOG(INFO) << "Cannot enable disk cache for fsi when fsi is disabled. Defaulted to "
814  "disk cache disabled";
815  }
816 #ifdef ENABLE_GENERAL_DISK_CACHE
817  } else if (disk_cache_level == "all") {
819  LOG(INFO) << "Disk cache enabled for all tables";
820  } else if (disk_cache_level == "local_tables") {
822  LOG(INFO) << "Disk cache enabled for non-FSI tables";
823 #endif // ENABLE_GENERAL_DISK_CACHE
824  } else if (disk_cache_level == "none") {
826  LOG(INFO) << "Disk cache disabled";
827  } else {
828 #ifdef ENABLE_GENERAL_DISK_CACHE
829  throw std::runtime_error{
830  "Unexpected \"disk-cache-level\" value: " + disk_cache_level +
831  ". Valid options are 'foreign_tables', "
832  "'local_tables', 'none', and 'all'."};
833 #else
834  throw std::runtime_error{
835  "Unexpected \"disk-cache-level\" value: " + disk_cache_level +
836  ". Valid options are 'foreign_tables' and "
837  "'none'."};
838 #endif // ENABLE_GENERAL_DISK_CACHE
839  }
840 
841  if (disk_cache_config.path.empty()) {
842  disk_cache_config.path = base_path + "/omnisci_disk_cache";
843  }
845 
848 
849  // If passed in, blacklist all security config files
858 }
DiskCacheLevel enabled_level
int open(const char *path, int flags, int mode)
Definition: omnisci_fs.cpp:64
#define LOG(tag)
Definition: Logger.h:188
DiskCacheConfig disk_cache_config
bool g_enable_debug_timer
Definition: Logger.cpp:17
static void initializeFromConfigFile(const std::string &server_config_path)
Definition: DdlUtils.cpp:663
const std::string OMNISCI_SYSTEM_CATALOG
Definition: SysCatalog.h:57
void addOptionalFileToBlacklist(std::string &filename)
std::string config_file
std::string to_string(char const *&&v)
std::string ssl_trust_ca_file
void close(const int fd)
Definition: omnisci_fs.cpp:68
std::string ssl_trust_store
bool g_enable_s3_fsi
std::string ca_file_name
Definition: AuthMetadata.h:31
std::string ssl_key_file
AuthMetadata authMetadata
unsigned pending_query_interrupt_freq
size_t write(FILE *f, const size_t offset, const size_t size, int8_t *buf)
Writes the specified number of bytes to the offset position in file f from buf.
Definition: File.cpp:126
std::string ssl_keystore
static void addToBlacklist(const std::string &path)
Definition: DdlUtils.cpp:726
std::string disk_cache_level
po::variables_map vm
bool g_enable_fsi
Definition: Catalog.cpp:91
unsigned dynamic_watchdog_time_limit
SystemParameters system_parameters
std::string ssl_cert_file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate_base_path()

void CommandLineOptions::validate_base_path ( )

Definition at line 714 of file CommandLineOptions.cpp.

Referenced by main().

714  {
715  boost::algorithm::trim_if(base_path, boost::is_any_of("\"'"));
716  if (!boost::filesystem::exists(base_path)) {
717  throw std::runtime_error("OmniSci base directory does not exist at " + base_path);
718  }
719 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ allow_loop_joins

bool CommandLineOptions::allow_loop_joins = false

Definition at line 60 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ allow_multifrag

bool CommandLineOptions::allow_multifrag = true

Definition at line 58 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ authMetadata

AuthMetadata CommandLineOptions::authMetadata

Definition at line 63 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ base_path

std::string CommandLineOptions::base_path

Definition at line 48 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ cluster_file

std::string CommandLineOptions::cluster_file = {"cluster.conf"}

Definition at line 50 of file CommandLineOptions.h.

◆ cluster_topology_file

std::string CommandLineOptions::cluster_topology_file = {"cluster_topology.conf"}

Definition at line 51 of file CommandLineOptions.h.

◆ clusterIds_arg

std::string CommandLineOptions::clusterIds_arg

Definition at line 134 of file CommandLineOptions.h.

◆ compressor

std::string CommandLineOptions::compressor = std::string(BLOSC_LZ4HC_COMPNAME)

Definition at line 123 of file CommandLineOptions.h.

◆ cpu_only

bool CommandLineOptions::cpu_only = false

Definition at line 54 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ db_leaves

std::vector<LeafHostInfo> CommandLineOptions::db_leaves

Definition at line 131 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ db_query_file

std::string CommandLineOptions::db_query_file = {""}

path to file containing warmup queries list

Definition at line 98 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ developer_desc

po::options_description CommandLineOptions::developer_desc

Definition at line 126 of file CommandLineOptions.h.

◆ disk_cache_config

DiskCacheConfig CommandLineOptions::disk_cache_config

Definition at line 49 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ disk_cache_level

std::string CommandLineOptions::disk_cache_level = ""

Definition at line 83 of file CommandLineOptions.h.

◆ dist_v5_

const bool CommandLineOptions::dist_v5_

Definition at line 146 of file CommandLineOptions.h.

◆ dynamic_watchdog_time_limit

unsigned CommandLineOptions::dynamic_watchdog_time_limit = 10000

Definition at line 82 of file CommandLineOptions.h.

◆ enable_auto_clear_render_mem

bool CommandLineOptions::enable_auto_clear_render_mem = false

Definition at line 67 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ enable_dynamic_watchdog

bool CommandLineOptions::enable_dynamic_watchdog = false

Definition at line 77 of file CommandLineOptions.h.

◆ enable_legacy_syntax

bool CommandLineOptions::enable_legacy_syntax = true

Definition at line 61 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ enable_rendering

bool CommandLineOptions::enable_rendering = false

Definition at line 66 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ enable_runtime_query_interrupt

bool CommandLineOptions::enable_runtime_query_interrupt = false

Definition at line 78 of file CommandLineOptions.h.

◆ enable_runtime_udf

bool CommandLineOptions::enable_runtime_udf = false

Definition at line 74 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ enable_watchdog

bool CommandLineOptions::enable_watchdog = true

Definition at line 76 of file CommandLineOptions.h.

◆ encryption_key_store_path

std::string CommandLineOptions::encryption_key_store_path = {}

Definition at line 53 of file CommandLineOptions.h.

◆ exit_after_warmup

bool CommandLineOptions::exit_after_warmup = false

exit after warmup

Definition at line 102 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ help_desc

po::options_description CommandLineOptions::help_desc

Definition at line 125 of file CommandLineOptions.h.

◆ http_port

int CommandLineOptions::http_port = 6278

Definition at line 46 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ idle_session_duration

int CommandLineOptions::idle_session_duration = kMinsPerHour

Inactive session tolerance in mins (60 mins)

Definition at line 106 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ intel_jit_profile

bool CommandLineOptions::intel_jit_profile = false

Definition at line 57 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ jit_debug

bool CommandLineOptions::jit_debug = false

Definition at line 56 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ license_path

std::string CommandLineOptions::license_path = {""}

Definition at line 52 of file CommandLineOptions.h.

◆ log_options_

logger::LogOptions CommandLineOptions::log_options_

Definition at line 127 of file CommandLineOptions.h.

◆ log_user_origin

bool CommandLineOptions::log_user_origin = true

Definition at line 62 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ max_concurrent_render_sessions

size_t CommandLineOptions::max_concurrent_render_sessions = 500

Definition at line 70 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ max_session_duration

int CommandLineOptions::max_session_duration = kMinsPerMonth

Maximum session life in mins (43,200 mins == 30 Days) (https://pages.nist.gov/800-63-3/sp800-63b.html#aal3reauth)

Definition at line 111 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ nodeIds_token

const std::string CommandLineOptions::nodeIds_token = {"node_id"}
static

Definition at line 138 of file CommandLineOptions.h.

◆ num_gpus

int CommandLineOptions::num_gpus = -1

Can be used to override the number of gpus detected on the system -1 means do not override

Definition at line 89 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ num_reader_threads

size_t CommandLineOptions::num_reader_threads = 0

Number of threads used when loading data

Definition at line 94 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ pending_query_interrupt_freq

unsigned CommandLineOptions::pending_query_interrupt_freq = 1000

Definition at line 81 of file CommandLineOptions.h.

◆ positional_options

po::positional_options_description CommandLineOptions::positional_options

Definition at line 128 of file CommandLineOptions.h.

◆ read_only

bool CommandLineOptions::read_only = false

Definition at line 59 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ render_compositor_use_last_gpu

bool CommandLineOptions::render_compositor_use_last_gpu = true

Definition at line 71 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ render_mem_bytes

size_t CommandLineOptions::render_mem_bytes = 1000000000

Definition at line 69 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ render_oom_retry_threshold

int CommandLineOptions::render_oom_retry_threshold = 0

Definition at line 68 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ renderer_use_vulkan_driver

bool CommandLineOptions::renderer_use_vulkan_driver = false

Definition at line 72 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ reserved_gpu_mem

size_t CommandLineOptions::reserved_gpu_mem = 384 * 1024 * 1024

Definition at line 47 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ running_query_interrupt_freq

double CommandLineOptions::running_query_interrupt_freq = 0.5

Definition at line 80 of file CommandLineOptions.h.

◆ start_gpu

int CommandLineOptions::start_gpu = 0

Definition at line 90 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ string_leaves

std::vector<LeafHostInfo> CommandLineOptions::string_leaves

Definition at line 132 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ system_parameters

SystemParameters CommandLineOptions::system_parameters

Definition at line 65 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ udf_compiler_options

std::vector<std::string> CommandLineOptions::udf_compiler_options

Definition at line 114 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ udf_compiler_path

std::string CommandLineOptions::udf_compiler_path = {""}

Definition at line 113 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ udf_file_name

std::string CommandLineOptions::udf_file_name = {""}

Definition at line 112 of file CommandLineOptions.h.

Referenced by startMapdServer().

◆ use_estimator_result_cache

bool CommandLineOptions::use_estimator_result_cache = true

Definition at line 79 of file CommandLineOptions.h.

◆ verbose_logging

bool CommandLineOptions::verbose_logging = false

Definition at line 55 of file CommandLineOptions.h.

◆ vm

po::variables_map CommandLineOptions::vm

Definition at line 133 of file CommandLineOptions.h.


The documentation for this class was generated from the following files: