OmniSciDB  04ee39c94c
MapDProgramOptions.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 OmniSci Technologies, 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 /*
18  * @file MapDProgramOptions.h
19  * @author Kursat Uvez <kursat.uvez@omnisci.com>
20  *
21  */
22 
23 #ifndef MAPDPROGRAMOPTIONS_H
24 #define MAPDPROGRAMOPTIONS_H
25 
26 #include <boost/program_options.hpp>
27 #include "Catalog/AuthMetadata.h"
28 #include "LeafHostInfo.h"
29 
30 class MapDProgramOptions : public boost::program_options::options_description {
31  public:
33 
34  int http_port = 6278;
35  size_t reserved_gpu_mem = 1 << 27;
36  std::string base_path;
37  std::string config_file = {"mapd.conf"};
38  std::string cluster_file = {"cluster.conf"};
39  bool cpu_only = false;
40  bool flush_log = true;
41  bool verbose_logging = false;
42  bool jit_debug = false;
43  bool allow_multifrag = true;
44  bool read_only = false;
45  bool allow_loop_joins = false;
46  bool enable_legacy_syntax = true;
48 
50  bool enable_rendering = false;
51  bool enable_watchdog = true;
52  bool enable_dynamic_watchdog = false;
53  unsigned dynamic_watchdog_time_limit = 10000;
54 
55  size_t render_mem_bytes = 500000000;
56  size_t render_poly_cache_bytes = 300000000;
57  int num_gpus = -1; // Can be used to override number of gpus detected on system - -1
58  // means do not override
59  int start_gpu = 0;
60  size_t num_reader_threads = 0; // number of threads used when loading data
61  std::string db_query_file = {""}; // path to file containing warmup queries list
63  kMinsPerHour; // Inactive session tolerance in mins (60 mins)
65  kMinsPerMonth; // maximum session life in days (30 Days)
66  // (https://pages.nist.gov/800-63-3/sp800-63b.html#aal3reauth)
67  std::string udf_file_name = {""};
68 
69  private:
70  void fillOptions(boost::program_options::options_description& desc);
71  void fillAdvancedOptions(boost::program_options::options_description& desc_adv);
72 
73  boost::program_options::variables_map vm;
74 
75  public:
76  std::vector<LeafHostInfo> db_leaves;
77  std::vector<LeafHostInfo> string_leaves;
78 
79  bool parse_command_line(int argc, char** argv, int& return_code);
80 };
81 
82 #endif // MAPDPROGRAMOPTIONS_H
boost::optional< int > parse_command_line(int argc, char const *const *argv)
Definition: MapDServer.cpp:690
static constexpr int64_t kMinsPerHour
std::string udf_file_name
Definition: MapDServer.cpp:302
size_t render_poly_cache_bytes
Definition: MapDServer.cpp:271
static constexpr int64_t kMinsPerMonth
MapDParameters mapd_parameters
Definition: MapDServer.cpp:265
std::vector< LeafHostInfo > db_leaves
Definition: MapDServer.cpp:317
unsigned dynamic_watchdog_time_limit
Definition: MapDServer.cpp:277
std::string base_path
Definition: MapDServer.cpp:250
std::string config_file
Definition: MapDServer.cpp:251
boost::program_options::variables_map vm
void fillAdvancedOptions()
Definition: MapDServer.cpp:540
AuthMetadata authMetadata
Definition: MapDServer.cpp:263
std::string db_query_file
Definition: MapDServer.cpp:292
std::string cluster_file
Definition: MapDServer.cpp:252
std::vector< LeafHostInfo > string_leaves
Definition: MapDServer.cpp:318