OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBHandler.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, 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 
23 #pragma once
24 
25 #include "LeafAggregator.h"
26 
27 #ifdef HAVE_PROFILER
28 #include <gperftools/heap-profiler.h>
29 #endif // HAVE_PROFILER
30 
31 #include "Calcite/Calcite.h"
32 #include "Catalog/Catalog.h"
33 #include "Catalog/SessionsStore.h"
35 #include "Geospatial/Transforms.h"
36 #include "ImportExport/Importer.h"
38 #include "LockMgr/LockMgr.h"
39 #include "Logger/Logger.h"
40 #include "Parser/ParserNode.h"
41 #include "Parser/ParserWrapper.h"
45 #include "QueryEngine/Execute.h"
52 #include "Shared/StringTransform.h"
56 #include "Shared/measure.h"
57 #include "Shared/scope.h"
63 
64 #include <sys/types.h>
65 #include <thrift/server/TServer.h>
66 #include <thrift/transport/THttpClient.h>
67 #include <thrift/transport/TSocket.h>
68 #include <thrift/transport/TTransport.h>
69 #include <atomic>
70 #include <boost/algorithm/string.hpp>
71 #include <boost/algorithm/string/replace.hpp>
72 #include <boost/algorithm/string/trim.hpp>
73 #include <boost/filesystem.hpp>
74 #include <boost/make_shared.hpp>
75 #include <boost/noncopyable.hpp>
76 #include <boost/none_t.hpp>
77 #include <boost/optional.hpp>
78 #include <boost/program_options.hpp>
79 #include <boost/tokenizer.hpp>
80 #include <cmath>
81 #include <csignal>
82 #include <fstream>
83 #include <list>
84 #include <map>
85 #include <memory>
86 #include <mutex>
87 #include <random>
88 #include <string>
89 #include <thread>
90 #include <typeinfo>
91 #include <unordered_map>
92 
93 #include "gen-cpp/Heavy.h"
94 #include "gen-cpp/extension_functions_types.h"
95 
96 using namespace std::string_literals;
97 
98 class HeavyDBAggHandler;
99 class HeavyDBLeafHandler;
100 
101 // Multiple concurrent requests for the same session can occur. For that reason, each
102 // request briefly takes a lock to make a copy of the appropriate SessionInfo object. Then
103 // it releases the lock and uses the copy for the remainder of the request.
104 using SessionMap = std::map<TSessionId, std::shared_ptr<Catalog_Namespace::SessionInfo>>;
105 using PermissionFuncPtr = bool (*)(const AccessPrivileges&, const TDBObjectPermissions&);
107 
108 namespace dbhandler {
109 bool is_info_schema_db(const std::string& db_name);
110 
111 void check_not_info_schema_db(const std::string& db_name,
112  bool throw_db_exception = false);
113 } // namespace dbhandler
114 
115 class TrackingProcessor : public HeavyProcessor {
116  public:
117  TrackingProcessor(std::shared_ptr<HeavyIf> handler, const bool check_origin)
118  : HeavyProcessor(handler), check_origin_(check_origin) {}
119 
120  bool process(std::shared_ptr<::apache::thrift::protocol::TProtocol> in,
121  std::shared_ptr<::apache::thrift::protocol::TProtocol> out,
122  void* connectionContext) override {
123  using namespace ::apache::thrift;
124 
125  auto transport = in->getTransport();
126  if (transport && check_origin_) {
127  static std::mutex processor_mutex;
128  std::lock_guard lock(processor_mutex);
129  const auto origin_str = transport->getOrigin();
130  std::vector<std::string> origins;
131  boost::split(origins, origin_str, boost::is_any_of(","));
132  if (origins.empty()) {
134  } else {
135  // Take the first origin, which should be the client IP before any intermediate
136  // servers (e.g. the web server)
137  auto trimmed_origin = origins.front();
138  boost::algorithm::trim(trimmed_origin);
139  TrackingProcessor::client_address = trimmed_origin;
140  }
141  if (dynamic_cast<transport::THttpTransport*>(transport.get())) {
143  } else if (dynamic_cast<transport::TBufferedTransport*>(transport.get())) {
145  } else {
147  }
148  } else {
150  }
151 
152  return HeavyProcessor::process(in, out, connectionContext);
153  }
154 
155  static thread_local std::string client_address;
156  static thread_local ClientProtocol client_protocol;
157 
158  private:
159  const bool check_origin_;
160 };
161 
162 namespace File_Namespace {
163 struct DiskCacheConfig;
164 }
165 
166 class DBHandler : public HeavyIf {
167  public:
168  DBHandler(const std::vector<LeafHostInfo>& db_leaves,
169  const std::vector<LeafHostInfo>& string_leaves,
170  const std::string& base_data_path,
171  const bool allow_multifrag,
172  const bool jit_debug,
173  const bool intel_jit_profile,
174  const bool read_only,
175  const bool allow_loop_joins,
176  const bool enable_rendering,
177  const bool renderer_use_ppll_polys,
178  const bool renderer_prefer_igpu,
179  const unsigned renderer_vulkan_timeout_ms,
180  const bool renderer_use_parallel_executors,
181  const bool enable_auto_clear_render_mem,
182  const int render_oom_retry_threshold,
183  const size_t render_mem_bytes,
184  const size_t max_concurrent_render_sessions,
185  const size_t reserved_gpu_mem,
186  const bool render_compositor_use_last_gpu,
187  const size_t num_reader_threads,
188  const AuthMetadata& authMetadata,
189  SystemParameters& system_parameters,
190  const bool legacy_syntax,
191  const int idle_session_duration,
192  const int max_session_duration,
193  const std::string& udf_filename,
194  const std::string& clang_path,
195  const std::vector<std::string>& clang_options,
196 #ifdef ENABLE_GEOS
197  const std::string& libgeos_so_filename,
198 #endif
199  const File_Namespace::DiskCacheConfig& disk_cache_config,
200  const bool is_new_db);
201  void initialize(const bool is_new_db);
202  ~DBHandler() override;
203 
204  static inline size_t max_bytes_for_thrift() { return 2 * 1000 * 1000 * 1000LL; }
205 
206  // Important ****
207  // This block must be keep in sync with mapd.thrift and HAHandler.h
208  // Please keep in same order for easy check and cut and paste
209  // Important ****
210 
211  void krb5_connect(TKrb5Session& session,
212  const std::string& token,
213  const std::string& dbname) override;
214  // connection, admin
215  void connect(TSessionId& session,
216  const std::string& username,
217  const std::string& passwd,
218  const std::string& dbname) override;
219  void disconnect(const TSessionId& session) override;
220  void switch_database(const TSessionId& session, const std::string& dbname) override;
221  void clone_session(TSessionId& session2, const TSessionId& session1) override;
222  void get_server_status(TServerStatus& _return, const TSessionId& session) override;
223  void get_status(std::vector<TServerStatus>& _return,
224  const TSessionId& session) override;
225  void get_hardware_info(TClusterHardwareInfo& _return,
226  const TSessionId& session) override;
227 
228  bool hasTableAccessPrivileges(const TableDescriptor* td,
229  const Catalog_Namespace::SessionInfo& session_info);
230  void get_tables(std::vector<std::string>& _return, const TSessionId& session) override;
231  void get_tables_for_database(std::vector<std::string>& _return,
232  const TSessionId& session,
233  const std::string& database_name) override;
234  void get_physical_tables(std::vector<std::string>& _return,
235  const TSessionId& session) override;
236  void get_views(std::vector<std::string>& _return, const TSessionId& session) override;
237  void get_tables_meta(std::vector<TTableMeta>& _return,
238  const TSessionId& session) override;
239  void get_table_details(TTableDetails& _return,
240  const TSessionId& session,
241  const std::string& table_name) override;
242  void get_table_details_for_database(TTableDetails& _return,
243  const TSessionId& session,
244  const std::string& table_name,
245  const std::string& database_name) override;
246  void get_internal_table_details(TTableDetails& _return,
247  const TSessionId& session,
248  const std::string& table_name,
249  const bool include_system_columns) override;
250  void get_internal_table_details_for_database(TTableDetails& _return,
251  const TSessionId& session,
252  const std::string& table_name,
253  const std::string& database_name) override;
254  void get_users(std::vector<std::string>& _return, const TSessionId& session) override;
255  void get_databases(std::vector<TDBInfo>& _return, const TSessionId& session) override;
256 
257  void get_version(std::string& _return) override;
258  void start_heap_profile(const TSessionId& session) override;
259  void stop_heap_profile(const TSessionId& session) override;
260  void get_heap_profile(std::string& _return, const TSessionId& session) override;
261  void get_memory(std::vector<TNodeMemoryInfo>& _return,
262  const TSessionId& session,
263  const std::string& memory_level) override;
264  void clear_cpu_memory(const TSessionId& session) override;
265  void clear_gpu_memory(const TSessionId& session) override;
266  void clearRenderMemory(const TSessionId& session); // it's not declared on thrifth
267  // and on persisten leaf client
268  void set_cur_session(const TSessionId& parent_session,
269  const TSessionId& leaf_session,
270  const std::string& start_time_str,
271  const std::string& label,
272  bool for_running_query_kernel) override;
273  void invalidate_cur_session(const TSessionId& parent_session,
274  const TSessionId& leaf_session,
275  const std::string& start_time_str,
276  const std::string& label,
277  bool for_running_query_kernel) override;
278  void set_table_epoch(const TSessionId& session,
279  const int db_id,
280  const int table_id,
281  const int new_epoch) override;
282  void set_table_epoch_by_name(const TSessionId& session,
283  const std::string& table_name,
284  const int new_epoch) override;
285  int32_t get_table_epoch(const TSessionId& session,
286  const int32_t db_id,
287  const int32_t table_id) override;
288  int32_t get_table_epoch_by_name(const TSessionId& session,
289  const std::string& table_name) override;
290  void get_table_epochs(std::vector<TTableEpochInfo>& _return,
291  const TSessionId& session,
292  const int32_t db_id,
293  const int32_t table_id) override;
294  void set_table_epochs(const TSessionId& session,
295  const int32_t db_id,
296  const std::vector<TTableEpochInfo>& table_epochs) override;
297 
298  void get_session_info(TSessionInfo& _return, const TSessionId& session) override;
299 
300  void set_leaf_info(const TSessionId& session, const TLeafInfo& info) override;
301 
302  void sql_execute(ExecutionResult& _return,
303  const TSessionId& session,
304  const std::string& query,
305  const bool column_format,
306  const int32_t first_n,
307  const int32_t at_most_n,
309  // query, render
310  void sql_execute(TQueryResult& _return,
311  const TSessionId& session,
312  const std::string& query,
313  const bool column_format,
314  const std::string& nonce,
315  const int32_t first_n,
316  const int32_t at_most_n) override;
317  void get_completion_hints(std::vector<TCompletionHint>& hints,
318  const TSessionId& session,
319  const std::string& sql,
320  const int cursor) override;
321  // TODO(miyu): merge the following two data frame APIs.
322  void sql_execute_df(TDataFrame& _return,
323  const TSessionId& session,
324  const std::string& query,
325  const TDeviceType::type device_type,
326  const int32_t device_id,
327  const int32_t first_n,
328  const TArrowTransport::type transport_method) override;
329  void sql_execute_gdf(TDataFrame& _return,
330  const TSessionId& session,
331  const std::string& query,
332  const int32_t device_id,
333  const int32_t first_n) override;
334  void deallocate_df(const TSessionId& session,
335  const TDataFrame& df,
336  const TDeviceType::type device_type,
337  const int32_t device_id) override;
338  void interrupt(const TSessionId& query_session,
339  const TSessionId& interrupt_session) override;
340  void sql_validate(TRowDescriptor& _return,
341  const TSessionId& session,
342  const std::string& query) override;
343  TExecuteMode::type getExecutionMode(const TSessionId& session);
344  void set_execution_mode(const TSessionId& session,
345  const TExecuteMode::type mode) override;
346  void render_vega(TRenderResult& _return,
347  const TSessionId& session,
348  const int64_t widget_id,
349  const std::string& vega_json,
350  const int32_t compression_level,
351  const std::string& nonce) override;
352  void get_result_row_for_pixel(
353  TPixelTableRowResult& _return,
354  const TSessionId& session,
355  const int64_t widget_id,
356  const TPixel& pixel,
357  const std::map<std::string, std::vector<std::string>>& table_col_names,
358  const bool column_format,
359  const int32_t pixel_radius,
360  const std::string& nonce) override;
361 
362  // custom expressions
363  int32_t create_custom_expression(const TSessionId& session,
364  const TCustomExpression& custom_expression) override;
365  void get_custom_expressions(std::vector<TCustomExpression>& _return,
366  const TSessionId& session) override;
367  void update_custom_expression(const TSessionId& session,
368  const int32_t id,
369  const std::string& expression_json) override;
370  void delete_custom_expressions(const TSessionId& session,
371  const std::vector<int32_t>& custom_expression_ids,
372  const bool do_soft_delete) override;
373 
374  // dashboards
375  void get_dashboard(TDashboard& _return,
376  const TSessionId& session,
377  const int32_t dashboard_id) override;
378  void get_dashboards(std::vector<TDashboard>& _return,
379  const TSessionId& session) override;
380  int32_t create_dashboard(const TSessionId& session,
381  const std::string& dashboard_name,
382  const std::string& dashboard_state,
383  const std::string& image_hash,
384  const std::string& dashboard_metadata) override;
385  void replace_dashboard(const TSessionId& session,
386  const int32_t dashboard_id,
387  const std::string& dashboard_name,
388  const std::string& dashboard_owner,
389  const std::string& dashboard_state,
390  const std::string& image_hash,
391  const std::string& dashboard_metadata) override;
392  void delete_dashboard(const TSessionId& session, const int32_t dashboard_id) override;
393  void share_dashboards(const TSessionId& session,
394  const std::vector<int32_t>& dashboard_ids,
395  const std::vector<std::string>& groups,
396  const TDashboardPermissions& permissions) override;
397  void delete_dashboards(const TSessionId& session,
398  const std::vector<int32_t>& dashboard_ids) override;
399  void share_dashboard(const TSessionId& session,
400  const int32_t dashboard_id,
401  const std::vector<std::string>& groups,
402  const std::vector<std::string>& objects,
403  const TDashboardPermissions& permissions,
404  const bool grant_role) override;
405  void unshare_dashboards(const TSessionId& session,
406  const std::vector<int32_t>& dashboard_ids,
407  const std::vector<std::string>& groups,
408  const TDashboardPermissions& permissions) override;
409  void unshare_dashboard(const TSessionId& session,
410  const int32_t dashboard_id,
411  const std::vector<std::string>& groups,
412  const std::vector<std::string>& objects,
413  const TDashboardPermissions& permissions) override;
414  void get_dashboard_grantees(std::vector<TDashboardGrantees>& _return,
415  const TSessionId& session,
416  const int32_t dashboard_id) override;
417 
418  void get_link_view(TFrontendView& _return,
419  const TSessionId& session,
420  const std::string& link) override;
421  void create_link(std::string& _return,
422  const TSessionId& session,
423  const std::string& view_state,
424  const std::string& view_metadata) override;
425  // import
426  void load_table_binary(const TSessionId& session,
427  const std::string& table_name,
428  const std::vector<TRow>& rows,
429  const std::vector<std::string>& column_names) override;
430 
431  void load_table_binary_columnar(const TSessionId& session,
432  const std::string& table_name,
433  const std::vector<TColumn>& cols,
434  const std::vector<std::string>& column_names) override;
435  void load_table_binary_columnar_polys(const TSessionId& session,
436  const std::string& table_name,
437  const std::vector<TColumn>& cols,
438  const std::vector<std::string>& column_names,
439  const bool assign_render_groups) override;
440  void load_table_binary_arrow(const TSessionId& session,
441  const std::string& table_name,
442  const std::string& arrow_stream,
443  const bool use_column_names) override;
444 
445  void load_table(const TSessionId& session,
446  const std::string& table_name,
447  const std::vector<TStringRow>& rows,
448  const std::vector<std::string>& column_names) override;
449  void detect_column_types(TDetectResult& _return,
450  const TSessionId& session,
451  const std::string& file_name,
452  const TCopyParams& copy_params) override;
453  void create_table(const TSessionId& session,
454  const std::string& table_name,
455  const TRowDescriptor& row_desc,
456  const TCreateParams& create_params) override;
457  void import_table(const TSessionId& session,
458  const std::string& table_name,
459  const std::string& file_name,
460  const TCopyParams& copy_params) override;
461  void import_geo_table(const TSessionId& session,
462  const std::string& table_name,
463  const std::string& file_name,
464  const TCopyParams& copy_params,
465  const TRowDescriptor& row_desc,
466  const TCreateParams& create_params) override;
467  void import_table_status(TImportStatus& _return,
468  const TSessionId& session,
469  const std::string& import_id) override;
470  void get_first_geo_file_in_archive(std::string& _return,
471  const TSessionId& session,
472  const std::string& archive_path,
473  const TCopyParams& copy_params) override;
474  void get_all_files_in_archive(std::vector<std::string>& _return,
475  const TSessionId& session,
476  const std::string& archive_path,
477  const TCopyParams& copy_params) override;
478  void get_layers_in_geo_file(std::vector<TGeoFileLayerInfo>& _return,
479  const TSessionId& session,
480  const std::string& file_name,
481  const TCopyParams& copy_params) override;
482  // distributed
483  int64_t query_get_outer_fragment_count(const TSessionId& session,
484  const std::string& select_query) override;
485 
486  void check_table_consistency(TTableMeta& _return,
487  const TSessionId& session,
488  const int32_t table_id) override;
489  void start_query(TPendingQuery& _return,
490  const TSessionId& leaf_session,
491  const TSessionId& parent_session,
492  const std::string& serialized_rel_alg_dag,
493  const std::string& start_time_str,
494  const bool just_explain,
495  const std::vector<int64_t>& outer_fragment_indices) override;
496  void execute_query_step(TStepResult& _return,
497  const TPendingQuery& pending_query,
498  const TSubqueryId subquery_id,
499  const std::string& start_time_str) override;
500  void broadcast_serialized_rows(const TSerializedRows& serialized_rows,
501  const TRowDescriptor& row_desc,
502  const TQueryId query_id,
503  const TSubqueryId subquery_id,
504  const bool is_final_subquery_result) override;
505 
506  void start_render_query(TPendingRenderQuery& _return,
507  const TSessionId& session,
508  const int64_t widget_id,
509  const int16_t node_idx,
510  const std::string& vega_json) override;
511  void execute_next_render_step(TRenderStepResult& _return,
512  const TPendingRenderQuery& pending_render,
513  const TRenderAggDataMap& merged_data) override;
514 
515  void insert_data(const TSessionId& session, const TInsertData& insert_data) override;
516  void insert_chunks(const TSessionId& session,
517  const TInsertChunks& insert_chunks) override;
518  void checkpoint(const TSessionId& session, const int32_t table_id) override;
519  // DB Object Privileges
520  void get_roles(std::vector<std::string>& _return, const TSessionId& session) override;
521  bool has_role(const TSessionId& sessionId,
522  const std::string& granteeName,
523  const std::string& roleName) override;
524  bool has_object_privilege(const TSessionId& sessionId,
525  const std::string& granteeName,
526  const std::string& objectName,
527  const TDBObjectType::type object_type,
528  const TDBObjectPermissions& permissions) override;
529  void get_db_objects_for_grantee(std::vector<TDBObject>& _return,
530  const TSessionId& session,
531  const std::string& roleName) override;
532  void get_db_object_privs(std::vector<TDBObject>& _return,
533  const TSessionId& session,
534  const std::string& objectName,
535  const TDBObjectType::type type) override;
536  void get_all_roles_for_user(std::vector<std::string>& _return,
537  const TSessionId& session,
538  const std::string& granteeName) override;
539  void get_all_effective_roles_for_user(std::vector<std::string>& _return,
540  const TSessionId& session,
541  const std::string& granteeName) override;
542  std::vector<std::string> get_valid_groups(const TSessionId& session,
543  int32_t dashboard_id,
544  std::vector<std::string> groups);
545  // licensing
546  void set_license_key(TLicenseInfo& _return,
547  const TSessionId& session,
548  const std::string& key,
549  const std::string& nonce) override;
550  void get_license_claims(TLicenseInfo& _return,
551  const TSessionId& session,
552  const std::string& nonce) override;
553  // user-defined functions
554  /*
555  Returns a mapping of device (CPU, GPU) parameters (name, LLVM IR
556  triplet, features, etc)
557  */
558  void get_device_parameters(std::map<std::string, std::string>& _return,
559  const TSessionId& session) override;
560 
561  /*
562  Register Runtime Extension Functions (UDFs, UDTFs) with given
563  signatures. The extension functions implementations are given in a
564  mapping of a device and the corresponding LLVM/NVVM IR string.
565  */
566 
567  void register_runtime_extension_functions(
568  const TSessionId& session,
569  const std::vector<TUserDefinedFunction>& udfs,
570  const std::vector<TUserDefinedTableFunction>& udtfs,
571  const std::map<std::string, std::string>& device_ir_map) override;
572 
573  /*
574  Returns a list of User-Defined Function names available
575  */
576  void get_function_names(std::vector<std::string>& _return,
577  const TSessionId& session) override;
578 
579  /*
580  Returns a list of runtime User-Defined Function names available
581  */
582  void get_runtime_function_names(std::vector<std::string>& _return,
583  const TSessionId& session) override;
584 
585  /*
586  Returns a list of runtime User-Defined Function names available
587  */
588  void get_function_details(std::vector<TUserDefinedFunction>& _return,
589  const TSessionId& session,
590  const std::vector<std::string>& udf_names) override;
591 
592  /*
593  Returns a list of User-Defined Table Function names available
594  */
595  void get_table_function_names(std::vector<std::string>& _return,
596  const TSessionId& session) override;
597 
598  /*
599  Returns a list of runtime User-Defined Table Function names available
600  */
601  void get_runtime_table_function_names(std::vector<std::string>& _return,
602  const TSessionId& session) override;
603 
604  /*
605  Returns a list of User-Defined Table Function details
606  */
607  void get_table_function_details(std::vector<TUserDefinedTableFunction>& _return,
608  const TSessionId& session,
609  const std::vector<std::string>& udtf_names) override;
610 
611  // end of sync block for HAHandler and mapd.thrift
612 
613  void shutdown();
614  void emergency_shutdown();
615 
616  TSessionId getInvalidSessionId() const;
617 
618  void internal_connect(TSessionId& session,
619  const std::string& username,
620  const std::string& dbname);
621 
622  bool isAggregator() const;
623 
624  bool checkInMemorySystemTableQuery(
625  const std::unordered_set<shared::TableKey>& tables_selected_from) const;
626 
627  std::shared_ptr<Data_Namespace::DataMgr> data_mgr_;
628 
630  std::vector<LeafHostInfo> db_leaves_;
631  std::vector<LeafHostInfo> string_leaves_;
632  const std::string base_data_path_;
633  boost::filesystem::path import_path_;
635  std::default_random_engine random_gen_;
636  std::uniform_int_distribution<int64_t> session_id_dist_;
637  const bool jit_debug_;
638  const bool intel_jit_profile_;
640  const bool read_only_;
641  const bool allow_loop_joins_;
644  std::mutex render_mutex_;
645  int64_t start_time_;
648  std::shared_ptr<QueryEngine> query_engine_;
649  std::unique_ptr<RenderHandler> render_handler_;
650  std::unique_ptr<HeavyDBAggHandler> agg_handler_;
651  std::unique_ptr<HeavyDBLeafHandler> leaf_handler_;
652  std::shared_ptr<Calcite> calcite_;
653  const bool legacy_syntax_;
654 
655  std::unique_ptr<QueryDispatchQueue> dispatch_queue_;
656 
657  template <typename... ARGS>
658  std::shared_ptr<query_state::QueryState> create_query_state(ARGS&&... args) {
659  return query_states_.create(std::forward<ARGS>(args)...);
660  }
661 
662  // Exactly one immutable SessionInfo copy should be taken by a typical request.
663  Catalog_Namespace::SessionInfo get_session_copy(const TSessionId& session_id);
664 
665  void get_tables_meta_impl(std::vector<TTableMeta>& _return,
666  QueryStateProxy query_state_proxy,
667  const Catalog_Namespace::SessionInfo& session_info,
668  const bool with_table_locks = true);
669 
670  // Visible for use in tests.
671  void resizeDispatchQueue(size_t queue_size);
672 
673  protected:
674  // Returns empty std::shared_ptr if session.empty().
675  std::shared_ptr<Catalog_Namespace::SessionInfo> get_session_ptr(
676  const TSessionId& session_id);
677 
678  ConnectionInfo getConnectionInfo() const;
679 
680  private:
681  std::atomic<bool> initialized_{false};
682  std::shared_ptr<Catalog_Namespace::SessionInfo> create_new_session(
683  TSessionId& session,
684  const std::string& dbname,
685  const Catalog_Namespace::UserMetadata& user_meta,
686  std::shared_ptr<Catalog_Namespace::Catalog> cat);
687  void connect_impl(TSessionId& session,
688  const std::string& passwd,
689  const std::string& dbname,
690  const Catalog_Namespace::UserMetadata& user_meta,
691  std::shared_ptr<Catalog_Namespace::Catalog> cat,
692  query_state::StdLog& stdlog);
693  void disconnect_impl(Catalog_Namespace::SessionInfoPtr& session_ptr);
694  void check_table_load_privileges(const Catalog_Namespace::SessionInfo& session_info,
695  const std::string& table_name);
696  void get_tables_impl(std::vector<std::string>& table_names,
698  const GetTablesType get_tables_type,
699  const std::string& database_name = {});
700  void get_table_details_impl(TTableDetails& _return,
701  query_state::StdLog& stdlog,
702  const std::string& table_name,
703  const bool get_system,
704  const bool get_physical,
705  const std::string& database_name = {});
706  void getAllRolesForUserImpl(
707  std::shared_ptr<Catalog_Namespace::SessionInfo const> session_ptr,
708  std::vector<std::string>& roles,
709  const std::string& granteeName,
710  bool effective);
711  void check_read_only(const std::string& str);
712  void validateGroups(const std::vector<std::string>& groups);
713  void validateDashboardIdsForSharing(const Catalog_Namespace::SessionInfo& session_info,
714  const std::vector<int32_t>& dashboard_ids);
715  void shareOrUnshareDashboards(const TSessionId& session,
716  const std::vector<int32_t>& dashboard_ids,
717  const std::vector<std::string>& groups,
718  const TDashboardPermissions& permissions,
719  const bool do_share);
720 
721  static void value_to_thrift_column(const TargetValue& tv,
722  const SQLTypeInfo& ti,
723  TColumn& column);
724  static TDatum value_to_thrift(const TargetValue& tv, const SQLTypeInfo& ti);
725 
726  std::pair<TPlanResult, lockmgr::LockedTableDescriptors> parse_to_ra(
728  const std::string& query_str,
729  const std::vector<TFilterPushDownInfo>& filter_push_down_info,
730  const bool acquire_locks,
731  const SystemParameters& system_parameters,
732  bool check_privileges = true);
733 
734  void sql_execute_local(
735  TQueryResult& _return,
736  const QueryStateProxy& query_state_proxy,
737  const std::shared_ptr<Catalog_Namespace::SessionInfo> session_ptr,
738  const std::string& query_str,
739  const bool column_format,
740  const std::string& nonce,
741  const int32_t first_n,
742  const int32_t at_most_n,
743  const bool use_calcite);
744 
745  int64_t process_deferred_copy_from(const TSessionId& session_id);
746 
747  static void convertData(TQueryResult& _return,
749  const QueryStateProxy& query_state_proxy,
750  const bool column_format,
751  const int32_t first_n,
752  const int32_t at_most_n);
753 
754  void sql_execute_impl(ExecutionResult& _return,
756  const bool column_format,
757  const ExecutorDeviceType executor_device_type,
758  const int32_t first_n,
759  const int32_t at_most_n,
760  const bool use_calcite,
762 
764  const TableDescriptor* td,
765  const AccessPrivileges acess_priv);
766 
767  void execute_distributed_copy_statement(
769  const Catalog_Namespace::SessionInfo& session_info);
770 
771  TPlanResult processCalciteRequest(
773  const std::shared_ptr<Catalog_Namespace::Catalog>& cat,
774  const std::string& query_str,
775  const std::vector<TFilterPushDownInfo>& filter_push_down_info,
776  const SystemParameters& system_parameters,
777  const bool check_privileges);
778 
779  TQueryResult validate_rel_alg(const std::string& query_ra, QueryStateProxy);
780 
781  void dispatch_query_task(std::shared_ptr<QueryDispatchQueue::Task> query_task,
782  const bool is_update_delete);
783 
784  std::vector<PushedDownFilterInfo> execute_rel_alg(
785  ExecutionResult& _return,
787  const std::string& query_ra,
788  const bool column_format,
789  const ExecutorDeviceType executor_device_type,
790  const int32_t first_n,
791  const int32_t at_most_n,
792  const bool just_validate,
793  const bool find_push_down_candidates,
794  const ExplainInfo& explain_info,
795  const std::optional<size_t> executor_index = std::nullopt) const;
796 
797  void execute_rel_alg_with_filter_push_down(
798  ExecutionResult& _return,
800  std::string& query_ra,
801  const bool column_format,
802  const ExecutorDeviceType executor_device_type,
803  const int32_t first_n,
804  const int32_t at_most_n,
805  const bool just_explain,
806  const bool just_calcite_explain,
807  const std::vector<PushedDownFilterInfo>& filter_push_down_requests);
808 
809  void executeDdl(TQueryResult& _return,
810  const std::string& query_ra,
811  std::shared_ptr<Catalog_Namespace::SessionInfo const> session_ptr);
812 
813  void executeDdl(ExecutionResult& _return,
814  const std::string& query_ra,
815  std::shared_ptr<Catalog_Namespace::SessionInfo const> session_ptr);
816 
817  TColumnType populateThriftColumnType(const Catalog_Namespace::Catalog* cat,
818  const ColumnDescriptor* cd);
819  TRowDescriptor fixup_row_descriptor(const TRowDescriptor& row_desc,
821  void set_execution_mode_nolock(Catalog_Namespace::SessionInfo* session_ptr,
822  const TExecuteMode::type mode);
823  char unescape_char(std::string str);
824  import_export::CopyParams thrift_to_copyparams(const TCopyParams& cp);
825  TCopyParams copyparams_to_thrift(const import_export::CopyParams& cp);
826  void check_geospatial_files(const boost::filesystem::path file_path,
827  const import_export::CopyParams& copy_params);
828  void render_rel_alg(TRenderResult& _return,
829  const std::string& query_ra,
830  const std::string& query_str,
831  const Catalog_Namespace::SessionInfo& session_info,
832  const std::string& render_type,
833  const bool is_projection_query);
834 
835  TColumnType create_geo_column(const TDatumType::type type,
836  const std::string& name,
837  const bool is_array);
838 
839  static void convertExplain(TQueryResult& _return,
840  const ResultSet& results,
841  const bool column_format);
842  static void convertResult(TQueryResult& _return,
843  const ResultSet& results,
844  const bool column_format);
845 
846  static void convertRows(TQueryResult& _return,
847  QueryStateProxy query_state_proxy,
848  const std::vector<TargetMetaInfo>& targets,
849  const ResultSet& results,
850  const bool column_format,
851  const int32_t first_n,
852  const int32_t at_most_n);
853 
854  // Use ExecutionResult to populate a TQueryResult
855  // calls convertRows, but after some setup using session_info
856  void convertResultSet(ExecutionResult& result,
857  const Catalog_Namespace::SessionInfo& session_info,
858  const std::string& query_state_str,
859  TQueryResult& _return);
860 
861  static void createSimpleResult(TQueryResult& _return,
862  const ResultSet& results,
863  const bool column_format,
864  const std::string label);
865 
866  std::vector<TargetMetaInfo> getTargetMetaInfo(
867  const std::vector<std::shared_ptr<Analyzer::TargetEntry>>& targets) const;
868 
869  std::vector<std::string> getTargetNames(
870  const std::vector<TargetMetaInfo>& targets) const;
871 
872  std::vector<std::string> getTargetNames(
873  const std::vector<std::shared_ptr<Analyzer::TargetEntry>>& targets) const;
874 
875  void get_completion_hints_unsorted(std::vector<TCompletionHint>& hints,
876  std::vector<std::string>& visible_tables,
877  query_state::StdLog& stdlog,
878  const std::string& sql,
879  const int cursor);
880  void get_token_based_completions(std::vector<TCompletionHint>& hints,
881  query_state::StdLog& stdlog,
882  std::vector<std::string>& visible_tables,
883  const std::string& sql,
884  const int cursor);
885 
886  std::unordered_map<std::string, std::unordered_set<std::string>>
887  fill_column_names_by_table(std::vector<std::string>& table_names,
888  query_state::StdLog& stdlog);
889 
890  TDashboard get_dashboard_impl(
891  const std::shared_ptr<Catalog_Namespace::SessionInfo const>& session_ptr,
893  const DashboardDescriptor* dash,
894  const bool populate_state = true);
895 
896  static bool has_database_permission(const AccessPrivileges& privs,
897  const TDBObjectPermissions& permissions);
898  static bool has_table_permission(const AccessPrivileges& privs,
899  const TDBObjectPermissions& permission);
900  static bool has_dashboard_permission(const AccessPrivileges& privs,
901  const TDBObjectPermissions& permissions);
902  static bool has_view_permission(const AccessPrivileges& privs,
903  const TDBObjectPermissions& permissions);
904  static bool has_server_permission(const AccessPrivileges& privs,
905  const TDBObjectPermissions& permissions);
906  // For the provided upper case column names `uc_column_names`, return
907  // the tables from `table_names` which contain at least one of them.
908  // Used to rank the TABLE auto-completion hints by the columns
909  // specified in the projection.
910  std::unordered_set<std::string> get_uc_compatible_table_names_by_column(
911  const std::unordered_set<std::string>& uc_column_names,
912  std::vector<std::string>& table_names,
913  query_state::StdLog& stdlog);
914 
915  std::unique_ptr<lockmgr::AbstractLockContainer<const TableDescriptor*>>
916  prepare_loader_generic(
917  const Catalog_Namespace::SessionInfo& session_info,
918  const std::string& table_name,
919  size_t num_cols,
920  std::unique_ptr<import_export::Loader>* loader,
921  std::vector<std::unique_ptr<import_export::TypedImportBuffer>>* import_buffers,
922  const std::vector<std::string>& column_names,
923  std::string load_type);
924 
925  void fillGeoColumns(
926  const TSessionId& session,
927  const Catalog_Namespace::Catalog& catalog,
928  std::vector<std::unique_ptr<import_export::TypedImportBuffer>>& import_buffers,
929  const ColumnDescriptor* cd,
930  size_t& col_idx,
931  size_t num_rows,
932  const std::string& table_name,
933  bool assign_render_groups);
934 
935  void fillMissingBuffers(
936  const TSessionId& session,
937  const Catalog_Namespace::Catalog& catalog,
938  std::vector<std::unique_ptr<import_export::TypedImportBuffer>>& import_buffers,
939  const std::list<const ColumnDescriptor*>& cds,
940  const std::vector<int>& desc_id_to_column_id,
941  size_t num_rows,
942  const std::string& table_name,
943  bool assign_render_groups);
944 
946  std::unordered_map<std::string, Catalog_Namespace::SessionInfoPtr> calcite_sessions_;
948 
949  Catalog_Namespace::SessionInfoPtr findCalciteSession(TSessionId const&) const;
950 
951  bool super_user_rights_; // default is "false"; setting to "true"
952  // ignores passwd checks in "connect(..)"
953  // method
954  const int idle_session_duration_; // max duration of idle session
955  const int max_session_duration_; // max duration of session
956 
957  const bool enable_rendering_;
960  const unsigned renderer_vulkan_timeout_;
965  const size_t reserved_gpu_mem_;
967  const size_t render_mem_bytes_;
968  const size_t num_reader_threads_;
969 #ifdef ENABLE_GEOS
970  const std::string& libgeos_so_filename_;
971 #endif
973  const std::string& udf_filename_;
974  const std::string& clang_path_;
975  const std::vector<std::string>& clang_options_;
976  int32_t max_num_sessions_{-1};
977  std::unique_ptr<Catalog_Namespace::SessionsStore> sessions_store_;
978 
980  std::string table;
981  std::string file_name;
983  std::string partitions;
984  };
985 
987  std::unordered_map<std::string, DeferredCopyFromState> was_deferred_copy_from;
989 
990  std::optional<DeferredCopyFromState> operator()(const std::string& session_id) {
991  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
992  auto itr = was_deferred_copy_from.find(session_id);
993  if (itr == was_deferred_copy_from.end()) {
994  return std::nullopt;
995  }
996  return itr->second;
997  }
998 
999  void add(const std::string& session_id, const DeferredCopyFromState& state) {
1000  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
1001  const auto ret = was_deferred_copy_from.insert(std::make_pair(session_id, state));
1002  CHECK(ret.second);
1003  }
1004 
1005  void remove(const std::string& session_id) {
1006  std::lock_guard<std::mutex> map_lock(deferred_copy_from_mutex);
1007  was_deferred_copy_from.erase(session_id);
1008  }
1009  };
1011 
1012  // Only for IPC device memory deallocation
1013  mutable std::mutex handle_to_dev_ptr_mutex_;
1014  mutable std::unordered_map<std::string, std::string> ipc_handle_to_dev_ptr_;
1015 
1016  friend void run_warmup_queries(std::shared_ptr<DBHandler> handler,
1017  std::string base_path,
1018  std::string query_file_path);
1019 
1020  friend class RenderHandler::Impl;
1021  friend class HeavyDBAggHandler;
1022  friend class HeavyDBLeafHandler;
1023 
1024  std::map<const std::string, const PermissionFuncPtr> permissionFuncMap_ = {
1025  {"database"s, has_database_permission},
1026  {"dashboard"s, has_dashboard_permission},
1027  {"table"s, has_table_permission},
1028  {"view"s, has_view_permission},
1029  {"server"s, has_server_permission}};
1030 
1031  void check_and_invalidate_sessions(Parser::DDLStmt* ddl);
1032 
1033  std::string const createInMemoryCalciteSession(
1034  const std::shared_ptr<Catalog_Namespace::Catalog>& catalog_ptr);
1035  void removeInMemoryCalciteSession(const std::string& session_id);
1036 
1037  ExecutionResult getUserSessions(
1038  std::shared_ptr<Catalog_Namespace::SessionInfo const> session_ptr);
1039 
1040  // getQueries returns a set of queries queued in the DB
1041  // that belongs to the same DB in the caller's session
1042 
1043  ExecutionResult getQueries(
1044  std::shared_ptr<Catalog_Namespace::SessionInfo const> session_ptr);
1045 
1046  void get_queries_info(std::vector<TQueryInfo>& _return,
1047  const TSessionId& session) override;
1048 
1049  // this function passes the interrupt request to the DB executor
1050  void interruptQuery(const Catalog_Namespace::SessionInfo& session_info,
1051  const std::string& target_session);
1052 
1053  void alterSystemClear(const std::string& sesson_id,
1055  const std::string& cache_type,
1056  int64_t& execution_time_ms);
1057 
1058  void alterSession(const std::string& sesson_id,
1060  const std::pair<std::string, std::string>& session_parameter,
1061  int64_t& execution_time_ms);
1062 
1063  // render group assignment
1064 
1065  enum class AssignRenderGroupsMode { kNone, kAssign, kCleanUp };
1066 
1067  void loadTableBinaryColumnarInternal(
1068  const TSessionId& session,
1069  const std::string& table_name,
1070  const std::vector<TColumn>& cols,
1071  const std::vector<std::string>& column_names,
1072  const AssignRenderGroupsMode assign_render_groups_mode);
1073 
1074  TRole::type getServerRole() const;
1075 
1076  using RenderGroupAssignmentColumnMap =
1077  std::unordered_map<std::string,
1078  std::unique_ptr<import_export::RenderGroupAnalyzer>>;
1080  std::unordered_map<std::string, RenderGroupAssignmentColumnMap>;
1082  std::unordered_map<TSessionId, RenderGroupAssignmentTableMap>;
1086 
1087  void importGeoTableGlobFilterSort(const TSessionId& session,
1088  const std::string& table_name,
1089  const std::string& file_name,
1090  const import_export::CopyParams& copy_params,
1091  const TRowDescriptor& row_desc,
1092  const TCreateParams& create_params);
1093 
1094  void importGeoTableSingle(const TSessionId& session,
1095  const std::string& table_name,
1096  const std::string& file_name,
1097  const import_export::CopyParams& copy_params,
1098  const TRowDescriptor& row_desc,
1099  const TCreateParams& create_params);
1100 
1101  void resetSessionsStore();
1102 };
std::lock_guard< T > lock_guard
Classes used to wrap parser calls for calcite redirection.
AssignRenderGroupsMode
Definition: DBHandler.h:1065
std::vector< LeafHostInfo > string_leaves_
Definition: DBHandler.h:631
auto get_users(SysCatalog &syscat, std::unique_ptr< SqliteConnector > &sqliteConnector, const int32_t dbId=-1)
const std::vector< std::string > & clang_options_
Definition: DBHandler.h:975
boost::filesystem::path import_path_
Definition: DBHandler.h:633
std::unique_ptr< QueryDispatchQueue > dispatch_queue_
Definition: DBHandler.h:655
std::vector< std::unique_ptr< lockmgr::AbstractLockContainer< const TableDescriptor * >>> LockedTableDescriptors
Definition: LockMgr.h:271
std::unordered_map< std::string, RenderGroupAssignmentColumnMap > RenderGroupAssignmentTableMap
Definition: DBHandler.h:1080
ClientProtocol
const bool renderer_use_parallel_executors_
Definition: DBHandler.h:961
const std::string & udf_filename_
Definition: DBHandler.h:973
std::string cat(Ts &&...args)
const int render_oom_retry_threshold_
Definition: DBHandler.h:963
class for a per-database catalog. also includes metadata for the current database and the current use...
Definition: Catalog.h:132
void run_warmup_queries(std::shared_ptr< DBHandler > handler, std::string base_path, std::string query_file_path)
Definition: HeavyDB.cpp:206
std::mutex handle_to_dev_ptr_mutex_
Definition: DBHandler.h:1013
std::shared_ptr< query_state::QueryState > create_query_state(ARGS &&...args)
Definition: DBHandler.h:658
static thread_local std::string client_address
Definition: DBHandler.h:155
ExecutorDeviceType
std::mutex render_group_assignment_mutex_
Definition: DBHandler.h:1084
void add(const std::string &session_id, const DeferredCopyFromState &state)
Definition: DBHandler.h:999
bool user_can_access_table(const Catalog_Namespace::SessionInfo &session_info, const TableDescriptor *td, const AccessPrivileges access_priv)
bool(*)(const AccessPrivileges &, const TDBObjectPermissions &) PermissionFuncPtr
Definition: DBHandler.h:105
static thread_local ClientProtocol client_protocol
Definition: DBHandler.h:156
LeafAggregator leaf_aggregator_
Definition: DBHandler.h:629
std::unordered_map< TSessionId, RenderGroupAssignmentTableMap > RenderGroupAnalyzerSessionMap
Definition: DBHandler.h:1082
const unsigned renderer_vulkan_timeout_
Definition: DBHandler.h:960
const std::string base_data_path_
Definition: DBHandler.h:632
const bool jit_debug_
Definition: DBHandler.h:637
const bool check_origin_
Definition: DBHandler.h:159
const size_t render_mem_bytes_
Definition: DBHandler.h:967
std::map< TSessionId, std::shared_ptr< Catalog_Namespace::SessionInfo >> SessionMap
Definition: DBHandler.h:104
DeferredCopyFromSessions deferred_copy_from_sessions
Definition: DBHandler.h:1010
std::vector< std::string > split(std::string_view str, std::string_view delim, std::optional< size_t > maxsplit)
split apart a string into a vector of substrings
int64_t start_time_
Definition: DBHandler.h:645
const bool renderer_use_ppll_polys_
Definition: DBHandler.h:958
import_export::CopyParams copy_params
Definition: DBHandler.h:982
std::unordered_map< std::string, Catalog_Namespace::SessionInfoPtr > calcite_sessions_
Definition: DBHandler.h:946
This file contains the class specification and related data structures for Catalog.
std::mutex render_mutex_
Definition: DBHandler.h:644
static size_t max_bytes_for_thrift()
Definition: DBHandler.h:204
query_state::QueryStates query_states_
Definition: DBHandler.h:945
Supported runtime functions management and retrieval.
const size_t reserved_gpu_mem_
Definition: DBHandler.h:965
std::optional< DeferredCopyFromState > operator()(const std::string &session_id)
Definition: DBHandler.h:990
Classes representing a parse tree.
const bool render_compositor_use_last_gpu_
Definition: DBHandler.h:966
void check_not_info_schema_db(const std::string &db_name, bool throw_db_exception)
Definition: DBHandler.cpp:4602
GetTablesType
Definition: Catalog.h:63
const int max_session_duration_
Definition: DBHandler.h:955
ExecutorDeviceType executor_device_type_
Definition: DBHandler.h:634
std::vector< LeafHostInfo > db_leaves_
Definition: DBHandler.h:630
const File_Namespace::DiskCacheConfig & disk_cache_config_
Definition: DBHandler.h:972
const std::string & clang_path_
Definition: DBHandler.h:974
std::unique_ptr< RenderHandler > render_handler_
Definition: DBHandler.h:649
Checked json field retrieval.
std::shared_ptr< QueryEngine > query_engine_
Definition: DBHandler.h:648
SystemParameters & system_parameters_
Definition: DBHandler.h:647
const size_t num_reader_threads_
Definition: DBHandler.h:968
specifies the content in-memory of a row in the column metadata table
const bool enable_auto_clear_render_mem_
Definition: DBHandler.h:962
const bool renderer_prefer_igpu_
Definition: DBHandler.h:959
heavyai::shared_mutex calcite_sessions_mtx_
Definition: DBHandler.h:947
std::map< std::string, std::string > get_device_parameters(bool cpu_only)
bool is_info_schema_db(const std::string &db_name)
Definition: DBHandler.cpp:4597
const bool allow_loop_joins_
Definition: DBHandler.h:641
heavyai::shared_mutex sessions_mutex_
Definition: DBHandler.h:643
std::unique_ptr< HeavyDBAggHandler > agg_handler_
Definition: DBHandler.h:650
heavyai::shared_mutex custom_expressions_mutex_
Definition: DBHandler.h:1085
const bool enable_rendering_
Definition: DBHandler.h:957
std::unordered_map< std::string, DeferredCopyFromState > was_deferred_copy_from
Definition: DBHandler.h:987
const bool intel_jit_profile_
Definition: DBHandler.h:638
bool super_user_rights_
Definition: DBHandler.h:951
std::unique_ptr< Catalog_Namespace::SessionsStore > sessions_store_
Definition: DBHandler.h:977
std::shared_ptr< Calcite > calcite_
Definition: DBHandler.h:652
void shutdown()
Definition: Logger.cpp:397
std::shared_ptr< Data_Namespace::DataMgr > data_mgr_
Definition: DBHandler.h:627
const bool read_only_
Definition: DBHandler.h:640
bool process(std::shared_ptr<::apache::thrift::protocol::TProtocol > in, std::shared_ptr<::apache::thrift::protocol::TProtocol > out, void *connectionContext) override
Definition: DBHandler.h:120
const bool legacy_syntax_
Definition: DBHandler.h:653
std::unique_ptr< HeavyDBLeafHandler > leaf_handler_
Definition: DBHandler.h:651
#define CHECK(condition)
Definition: Logger.h:291
const int idle_session_duration_
Definition: DBHandler.h:954
std::unordered_map< std::string, std::string > ipc_handle_to_dev_ptr_
Definition: DBHandler.h:1014
RenderGroupAnalyzerSessionMap render_group_assignment_map_
Definition: DBHandler.h:1083
const size_t max_concurrent_render_sessions_
Definition: DBHandler.h:964
boost::variant< ScalarTargetValue, ArrayTargetValue, GeoTargetValue, GeoTargetValuePtr > TargetValue
Definition: TargetValue.h:195
bool allow_multifrag_
Definition: DBHandler.h:639
string name
Definition: setup.in.py:72
std::shared_timed_mutex shared_mutex
const AuthMetadata & authMetadata_
Definition: DBHandler.h:646
TrackingProcessor(std::shared_ptr< HeavyIf > handler, const bool check_origin)
Definition: DBHandler.h:117
bool cpu_mode_only_
Definition: DBHandler.h:642
std::default_random_engine random_gen_
Definition: DBHandler.h:635
std::uniform_int_distribution< int64_t > session_id_dist_
Definition: DBHandler.h:636
std::shared_ptr< SessionInfo > SessionInfoPtr
Definition: SessionsStore.h:27