OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
/home/jenkins-slave/workspace/core-os-doxygen/HeavyDB.cpp File Reference
#include "DataMgr/ForeignStorage/ForeignStorageInterface.h"
#include "ThriftHandler/DBHandler.h"
#include <thrift/concurrency/PlatformThreadFactory.h>
#include <thrift/concurrency/ThreadManager.h>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/server/TThreadedServer.h>
#include <thrift/transport/TBufferTransports.h>
#include <thrift/transport/THttpServer.h>
#include <thrift/transport/TSSLServerSocket.h>
#include <thrift/transport/TSSLSocket.h>
#include <thrift/transport/TServerSocket.h>
#include "Shared/ThriftJSONProtocolInclude.h"
#include "Logger/Logger.h"
#include "Shared/SystemParameters.h"
#include "Shared/file_delete.h"
#include "Shared/heavyai_shared_mutex.h"
#include "Shared/scope.h"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/filesystem.hpp>
#include <boost/locale/generator.hpp>
#include <boost/make_shared.hpp>
#include <boost/program_options.hpp>
#include <csignal>
#include <cstdlib>
#include <sstream>
#include <thread>
#include <vector>
#include "MapDRelease.h"
#include "MigrationMgr/MigrationMgr.h"
#include "Shared/Compressor.h"
#include "ThriftHandler/ForeignTableRefreshScheduler.h"
+ Include dependency graph for HeavyDB.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{HeavyDB.cpp}
 

Functions

void anonymous_namespace{HeavyDB.cpp}::register_signal_handler (int signum, void(*handler)(int))
 
void anonymous_namespace{HeavyDB.cpp}::heavydb_signal_handler (int signum)
 
void anonymous_namespace{HeavyDB.cpp}::register_signal_handlers ()
 
void start_server (std::shared_ptr< TThreadedServer > server, const int port)
 
void releaseWarmupSession (TSessionId &sessionId, std::ifstream &query_file) noexcept
 
void run_warmup_queries (std::shared_ptr< DBHandler > handler, std::string base_path, std::string query_file_path)
 
void thrift_stop ()
 
void heartbeat ()
 
int startHeavyDBServer (CommandLineOptions &prog_config_opts, bool start_http_server=true)
 
int main (int argc, char **argv)
 

Variables

bool g_enable_thrift_logs
 
std::atomic< bool > g_running {true}
 
bool g_enable_http_binary_server
 
std::atomic< int > anonymous_namespace{HeavyDB.cpp}::g_saw_signal {-1}
 
std::shared_ptr< TThreadedServer > anonymous_namespace{HeavyDB.cpp}::g_thrift_http_server
 
std::shared_ptr< TThreadedServer > anonymous_namespace{HeavyDB.cpp}::g_thrift_http_binary_server
 
std::shared_ptr< TThreadedServer > anonymous_namespace{HeavyDB.cpp}::g_thrift_tcp_server
 
std::shared_ptr< DBHandleranonymous_namespace{HeavyDB.cpp}::g_warmup_handler
 
std::shared_ptr< DBHandleranonymous_namespace{HeavyDB.cpp}::g_db_handler
 
bool g_enable_fsi
 

Function Documentation

void heartbeat ( )

Definition at line 310 of file HeavyDB.cpp.

References g_running, anonymous_namespace{HeavyDB.cpp}::g_saw_signal, logger::INFO, LOG, run_benchmark_import::result, logger::shutdown(), thrift_stop(), and VLOG.

Referenced by startHeavyDBServer().

310  {
311 #ifndef _WIN32
312  // Block all signals for this heartbeat thread, only.
313  sigset_t set;
314  sigfillset(&set);
315  int result = pthread_sigmask(SIG_BLOCK, &set, NULL);
316  if (result != 0) {
317  throw std::runtime_error("heartbeat() thread startup failed");
318  }
319 #endif
320 
321  // Sleep until heavydb_signal_handler or anything clears the g_running flag.
322  VLOG(1) << "heartbeat thread starting";
323  while (::g_running) {
324  using namespace std::chrono;
325  std::this_thread::sleep_for(1s);
326  }
327  VLOG(1) << "heartbeat thread exiting";
328 
329  // Get the signal number if there was a signal.
330  int signum = g_saw_signal;
331  if (signum >= 1 && signum != SIGTERM) {
332  LOG(INFO) << "Interrupt signal (" << signum << ") received.";
333  }
334 
335  // If dumping core, try to do some quick stuff.
336  if (signum == SIGABRT || signum == SIGSEGV || signum == SIGFPE
337 #ifndef _WIN32
338  || signum == SIGQUIT
339 #endif
340  ) {
341  // Need to shut down calcite.
342  if (auto db_handler = g_db_handler; db_handler) {
343  db_handler->emergency_shutdown();
344  }
345  // Need to flush the logs for debugging.
347  return;
348  // Core dump should begin soon after this. See heavydb_signal_handler().
349  // We leave the rest of the server process as is for the core dump image.
350  }
351 
352  // Stopping the Thrift thread(s) will allow main() to return.
353  thrift_stop();
354 }
std::shared_ptr< DBHandler > g_db_handler
Definition: HeavyDB.cpp:94
#define LOG(tag)
Definition: Logger.h:285
std::atomic< int > g_saw_signal
Definition: HeavyDB.cpp:84
void shutdown()
Definition: Logger.cpp:397
std::atomic< bool > g_running
Definition: HeavyDB.cpp:78
#define VLOG(n)
Definition: Logger.h:387
void thrift_stop()
Definition: HeavyDB.cpp:292

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 619 of file HeavyDB.cpp.

References CommandLineOptions::parse_command_line(), startHeavyDBServer(), CommandLineOptions::validate(), and CommandLineOptions::validate_base_path().

619  {
620  bool has_clust_topo = false;
621 
622  CommandLineOptions prog_config_opts(argv[0], has_clust_topo);
623 
624  try {
625  if (auto return_code =
626  prog_config_opts.parse_command_line(argc, argv, !has_clust_topo)) {
627  return *return_code;
628  }
629 
630  if (!has_clust_topo) {
631  prog_config_opts.validate_base_path();
632  prog_config_opts.validate();
633  return (startHeavyDBServer(prog_config_opts));
634  }
635  } catch (std::runtime_error& e) {
636  std::cerr << "Server Error: " << e.what() << std::endl;
637  return 1;
638  } catch (boost::program_options::error& e) {
639  std::cerr << "Usage Error: " << e.what() << std::endl;
640  return 1;
641  }
642 }
int startHeavyDBServer(CommandLineOptions &prog_config_opts, bool start_http_server=true)
Definition: HeavyDB.cpp:380

+ Here is the call graph for this function:

void releaseWarmupSession ( TSessionId &  sessionId,
std::ifstream &  query_file 
)
noexcept

Definition at line 194 of file HeavyDB.cpp.

References logger::ERROR, and LOG.

Referenced by run_warmup_queries().

194  {
195  query_file.close();
196  if (sessionId != g_warmup_handler->getInvalidSessionId()) {
197  try {
198  g_warmup_handler->disconnect(sessionId);
199  } catch (...) {
200  LOG(ERROR) << "Failed to disconnect warmup session, possible failure to run warmup "
201  "queries.";
202  }
203  }
204 }
#define LOG(tag)
Definition: Logger.h:285
std::shared_ptr< DBHandler > g_warmup_handler
Definition: HeavyDB.cpp:90

+ Here is the caller graph for this function:

void run_warmup_queries ( std::shared_ptr< DBHandler handler,
std::string  base_path,
std::string  query_file_path 
)

Definition at line 206 of file HeavyDB.cpp.

References logger::INFO, LOG, releaseWarmupSession(), and logger::WARNING.

Referenced by startHeavyDBServer().

208  {
209  // run warmup queries to load cache if requested
210  if (query_file_path.empty()) {
211  return;
212  }
213  if (handler->isAggregator()) {
214  LOG(INFO) << "Skipping warmup query execution on the aggregator, queries should be "
215  "run directly on the leaf nodes.";
216  return;
217  }
218 
219  LOG(INFO) << "Running DB warmup with queries from " << query_file_path;
220  try {
221  g_warmup_handler = handler;
222  std::string db_info;
223  std::string user_keyword, user_name, db_name;
224  std::ifstream query_file;
227  TSessionId sessionId = g_warmup_handler->getInvalidSessionId();
228 
229  ScopeGuard session_guard = [&] { releaseWarmupSession(sessionId, query_file); };
230  query_file.open(query_file_path);
231  while (std::getline(query_file, db_info)) {
232  if (db_info.length() == 0) {
233  continue;
234  }
235  std::istringstream iss(db_info);
236  iss >> user_keyword >> user_name >> db_name;
237  if (user_keyword.compare(0, 4, "USER") == 0) {
238  // connect to DB for given user_name/db_name with super_user_rights (without
239  // password), & start session
240  g_warmup_handler->super_user_rights_ = true;
241  g_warmup_handler->connect(sessionId, user_name, "", db_name);
242  g_warmup_handler->super_user_rights_ = false;
243 
244  // read and run one query at a time for the DB with the setup connection
245  TQueryResult ret;
246  std::string single_query;
247  while (std::getline(query_file, single_query)) {
248  boost::algorithm::trim(single_query);
249  if (single_query.length() == 0 || single_query[0] == '-') {
250  continue;
251  }
252  if (single_query[0] == '}') {
253  single_query.clear();
254  break;
255  }
256  if (single_query.find(';') == single_query.npos) {
257  std::string multiline_query;
258  std::getline(query_file, multiline_query, ';');
259  single_query += multiline_query;
260  }
261 
262  try {
263  g_warmup_handler->sql_execute(ret, sessionId, single_query, true, "", -1, -1);
264  } catch (...) {
265  LOG(WARNING) << "Exception while executing '" << single_query
266  << "', ignoring";
267  }
268  single_query.clear();
269  }
270 
271  // stop session and disconnect from the DB
272  g_warmup_handler->disconnect(sessionId);
273  sessionId = g_warmup_handler->getInvalidSessionId();
274  } else {
275  LOG(WARNING) << "\nSyntax error in the file: " << query_file_path.c_str()
276  << " Missing expected keyword USER. Following line will be ignored: "
277  << db_info.c_str() << std::endl;
278  }
279  db_info.clear();
280  }
281  } catch (const std::exception& e) {
282  LOG(WARNING)
283  << "Exception while executing warmup queries. "
284  << "Warmup may not be fully completed. Will proceed nevertheless.\nError was: "
285  << e.what();
286  }
287 }
#define LOG(tag)
Definition: Logger.h:285
std::shared_ptr< DBHandler > g_warmup_handler
Definition: HeavyDB.cpp:90
void releaseWarmupSession(TSessionId &sessionId, std::ifstream &query_file) noexcept
Definition: HeavyDB.cpp:194

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void start_server ( std::shared_ptr< TThreadedServer >  server,
const int  port 
)

Definition at line 182 of file HeavyDB.cpp.

References logger::ERROR, and LOG.

Referenced by startHeavyDBServer().

182  {
183  try {
184  server->serve();
185  if (errno != 0) {
186  throw std::runtime_error(std::string("Thrift server exited: ") +
187  std::strerror(errno));
188  }
189  } catch (std::exception& e) {
190  LOG(ERROR) << "Exception: " << e.what() << ": port " << port << std::endl;
191  }
192 }
#define LOG(tag)
Definition: Logger.h:285

+ Here is the caller graph for this function:

int startHeavyDBServer ( CommandLineOptions prog_config_opts,
bool  start_http_server = true 
)

Definition at line 380 of file HeavyDB.cpp.

References CommandLineOptions::allow_loop_joins, CommandLineOptions::allow_multifrag, CommandLineOptions::authMetadata, CommandLineOptions::base_path, cpu_threads(), CommandLineOptions::db_leaves, CommandLineOptions::db_query_file, CommandLineOptions::disk_cache_config, CommandLineOptions::enable_auto_clear_render_mem, CommandLineOptions::enable_legacy_syntax, CommandLineOptions::enable_rendering, CommandLineOptions::exit_after_warmup, logger::FATAL, file_delete(), anonymous_namespace{HeavyDB.cpp}::g_db_handler, g_enable_http_binary_server, g_running, anonymous_namespace{HeavyDB.cpp}::g_saw_signal, threading_tbb::g_tbb_arena, heartbeat(), CommandLineOptions::http_binary_port, CommandLineOptions::http_port, CommandLineOptions::idle_session_duration, logger::INFO, omnisci_aws_sdk::init_sdk(), CommandLineOptions::intel_jit_profile, CommandLineOptions::jit_debug, shared::kDataDirectoryName, LOG, CommandLineOptions::log_user_origin, SystemParameters::master_address, CommandLineOptions::max_concurrent_render_sessions, CommandLineOptions::max_session_duration, CommandLineOptions::num_reader_threads, SystemParameters::omnisci_server_port, CommandLineOptions::read_only, anonymous_namespace{HeavyDB.cpp}::register_signal_handlers(), CommandLineOptions::render_compositor_use_last_gpu, CommandLineOptions::render_mem_bytes, CommandLineOptions::render_oom_retry_threshold, CommandLineOptions::renderer_prefer_igpu, CommandLineOptions::renderer_use_parallel_executors, CommandLineOptions::renderer_use_ppll_polys, CommandLineOptions::renderer_vulkan_timeout_ms, CommandLineOptions::reserved_gpu_mem, run_warmup_queries(), logger::shutdown(), omnisci_aws_sdk::shutdown_sdk(), SystemParameters::ssl_cert_file, SystemParameters::ssl_key_file, SystemParameters::ssl_transport_client_auth, foreign_storage::ForeignTableRefreshScheduler::start(), start_server(), foreign_storage::ForeignTableRefreshScheduler::stop(), CommandLineOptions::string_leaves, CommandLineOptions::system_parameters, thrift_stop(), CommandLineOptions::udf_compiler_options, CommandLineOptions::udf_compiler_path, CommandLineOptions::udf_file_name, and logger::WARNING.

Referenced by main().

381  {
382  // Prepare to launch the Thrift server.
383  LOG(INFO) << "HeavyDB starting up";
385 #ifdef ENABLE_TBB
386  LOG(INFO) << "Initializing TBB with " << cpu_threads() << " threads.";
388  const int32_t tbb_max_concurrency{threading_tbb::g_tbb_arena.max_concurrency()};
389  LOG(INFO) << "TBB max concurrency: " << tbb_max_concurrency << " threads.";
390 #endif // ENABLE_TBB
391 #ifdef HAVE_AWS_S3
393 #endif // HAVE_AWS_S3
394  std::set<std::unique_ptr<std::thread>> server_threads;
395  auto wait_for_server_threads = [&] {
396  for (auto& th : server_threads) {
397  try {
398  th->join();
399  } catch (const std::system_error& e) {
400  if (e.code() != std::errc::invalid_argument) {
401  LOG(WARNING) << "std::thread join failed: " << e.what();
402  }
403  } catch (const std::exception& e) {
404  LOG(WARNING) << "std::thread join failed: " << e.what();
405  } catch (...) {
406  LOG(WARNING) << "std::thread join failed";
407  }
408  }
409  };
410  ScopeGuard server_shutdown_guard = [&] {
411  // This function will never be called by exit(), but we shouldn't ever be calling
412  // exit(), we should be setting g_running to false instead.
413  LOG(INFO) << "HeavyDB shutting down";
414 
415  g_running = false;
416 
417  thrift_stop();
418 
419  if (g_enable_fsi) {
421  }
422 
423  g_db_handler.reset();
424 
425  wait_for_server_threads();
426 
427 #ifdef HAVE_AWS_S3
429 #endif // HAVE_AWS_S3
430 
431  // Flush the logs last to capture maximum debugging information.
433  };
434 
435  // start background thread to clean up _DELETE_ME files
436  const unsigned int wait_interval =
437  3; // wait time in secs after looking for deleted file before looking again
438  server_threads.insert(std::make_unique<std::thread>(
439  file_delete,
440  std::ref(g_running),
441  wait_interval,
442  prog_config_opts.base_path + "/" + shared::kDataDirectoryName));
443  server_threads.insert(std::make_unique<std::thread>(heartbeat));
444 
445  if (!g_enable_thrift_logs) {
446  apache::thrift::GlobalOutput.setOutputFunction([](const char* msg) {});
447  }
448 
449  // Thrift event handler for database server setup.
450  try {
451  if (prog_config_opts.system_parameters.master_address.empty()) {
452  // Handler for a single database server. (DBHandler)
453  g_db_handler =
454  std::make_shared<DBHandler>(prog_config_opts.db_leaves,
455  prog_config_opts.string_leaves,
456  prog_config_opts.base_path,
457  prog_config_opts.allow_multifrag,
458  prog_config_opts.jit_debug,
459  prog_config_opts.intel_jit_profile,
460  prog_config_opts.read_only,
461  prog_config_opts.allow_loop_joins,
462  prog_config_opts.enable_rendering,
463  prog_config_opts.renderer_use_ppll_polys,
464  prog_config_opts.renderer_prefer_igpu,
465  prog_config_opts.renderer_vulkan_timeout_ms,
466  prog_config_opts.renderer_use_parallel_executors,
467  prog_config_opts.enable_auto_clear_render_mem,
468  prog_config_opts.render_oom_retry_threshold,
469  prog_config_opts.render_mem_bytes,
470  prog_config_opts.max_concurrent_render_sessions,
471  prog_config_opts.reserved_gpu_mem,
472  prog_config_opts.render_compositor_use_last_gpu,
473  prog_config_opts.num_reader_threads,
474  prog_config_opts.authMetadata,
475  prog_config_opts.system_parameters,
476  prog_config_opts.enable_legacy_syntax,
477  prog_config_opts.idle_session_duration,
478  prog_config_opts.max_session_duration,
479  prog_config_opts.udf_file_name,
480  prog_config_opts.udf_compiler_path,
481  prog_config_opts.udf_compiler_options,
482 #ifdef ENABLE_GEOS
483  prog_config_opts.libgeos_so_filename,
484 #endif
485  prog_config_opts.disk_cache_config,
486  false);
487  } else { // running ha server
488  LOG(FATAL)
489  << "No High Availability module available, please contact OmniSci support";
490  }
491  } catch (const std::exception& e) {
492  LOG(FATAL) << "Failed to initialize service handler: " << e.what();
493  }
494 
495  if (g_enable_fsi) {
497  }
498 
499  // TCP port setup. We use Thrift both for a TCP socket and for an optional HTTP socket.
500  std::shared_ptr<TServerSocket> tcp_socket;
501  std::shared_ptr<TServerSocket> http_socket;
502  std::shared_ptr<TServerSocket> http_binary_socket;
503 
504  if (!prog_config_opts.system_parameters.ssl_cert_file.empty() &&
505  !prog_config_opts.system_parameters.ssl_key_file.empty()) {
506  // SSL port setup.
507  auto sslSocketFactory = std::make_shared<TSSLSocketFactory>(SSLProtocol::SSLTLS);
508  sslSocketFactory->loadCertificate(
509  prog_config_opts.system_parameters.ssl_cert_file.c_str());
510  sslSocketFactory->loadPrivateKey(
511  prog_config_opts.system_parameters.ssl_key_file.c_str());
512  if (prog_config_opts.system_parameters.ssl_transport_client_auth) {
513  sslSocketFactory->authenticate(true);
514  } else {
515  sslSocketFactory->authenticate(false);
516  }
517  sslSocketFactory->ciphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
518  tcp_socket = std::make_shared<TSSLServerSocket>(
519  prog_config_opts.system_parameters.omnisci_server_port, sslSocketFactory);
520  if (start_http_server) {
521  http_socket = std::make_shared<TSSLServerSocket>(prog_config_opts.http_port,
522  sslSocketFactory);
523  }
525  http_binary_socket = std::make_shared<TSSLServerSocket>(
526  prog_config_opts.http_binary_port, sslSocketFactory);
527  }
528  LOG(INFO) << " HeavyDB server using encrypted connection. Cert file ["
529  << prog_config_opts.system_parameters.ssl_cert_file << "], key file ["
530  << prog_config_opts.system_parameters.ssl_key_file << "]";
531 
532  } else {
533  // Non-SSL port setup.
534  LOG(INFO) << " HeavyDB server using unencrypted connection";
535  tcp_socket = std::make_shared<TServerSocket>(
536  prog_config_opts.system_parameters.omnisci_server_port);
537  if (start_http_server) {
538  http_socket = std::make_shared<TServerSocket>(prog_config_opts.http_port);
539  }
541  http_binary_socket =
542  std::make_shared<TServerSocket>(prog_config_opts.http_binary_port);
543  }
544  }
545 
546  // Thrift uses the same processor for both the TCP port and the HTTP port.
547  std::shared_ptr<TProcessor> processor{std::make_shared<TrackingProcessor>(
548  g_db_handler, prog_config_opts.log_user_origin)};
549 
550  // Thrift TCP server launch.
551  std::shared_ptr<TServerTransport> tcp_st = tcp_socket;
552 #ifdef HAVE_THRIFT_MESSAGE_LIMIT
553  std::shared_ptr<TTransportFactory> tcp_tf{
554  std::make_shared<UnboundedTBufferedTransportFactory>()};
555 #else
556  std::shared_ptr<TTransportFactory> tcp_tf{
557  std::make_shared<TBufferedTransportFactory>()};
558 #endif
559  std::shared_ptr<TProtocolFactory> tcp_pf{std::make_shared<TBinaryProtocolFactory>()};
560  g_thrift_tcp_server.reset(new TThreadedServer(processor, tcp_st, tcp_tf, tcp_pf));
561  server_threads.insert(std::make_unique<std::thread>(
562  start_server,
564  prog_config_opts.system_parameters.omnisci_server_port));
565 
566  // Thrift HTTP server launch.
567  if (start_http_server) {
568  std::shared_ptr<TServerTransport> http_st = http_socket;
569 #ifdef HAVE_THRIFT_MESSAGE_LIMIT
570  std::shared_ptr<TTransportFactory> http_tf{
571  std::make_shared<UnboundedTHttpServerTransportFactory>()};
572 #else
573  std::shared_ptr<TTransportFactory> http_tf{
574  std::make_shared<THttpServerTransportFactory>()};
575 #endif
576  std::shared_ptr<TProtocolFactory> http_pf{std::make_shared<TJSONProtocolFactory>()};
577  g_thrift_http_server.reset(new TThreadedServer(processor, http_st, http_tf, http_pf));
578  server_threads.insert(std::make_unique<std::thread>(
579  start_server, g_thrift_http_server, prog_config_opts.http_port));
580  }
581 
582  // Thrift HTTP binary protocol server launch.
584  std::shared_ptr<TServerTransport> http_binary_st = http_binary_socket;
585 #ifdef HAVE_THRIFT_MESSAGE_LIMIT
586  std::shared_ptr<TTransportFactory> http_binary_tf{
587  std::make_shared<UnboundedTHttpServerTransportFactory>()};
588 #else
589  std::shared_ptr<TTransportFactory> http_binary_tf{
590  std::make_shared<THttpServerTransportFactory>()};
591 #endif
592  std::shared_ptr<TProtocolFactory> http_binary_pf{
593  std::make_shared<TBinaryProtocolFactory>()};
595  new TThreadedServer(processor, http_binary_st, http_binary_tf, http_binary_pf));
596  server_threads.insert(std::make_unique<std::thread>(
598  }
599 
600  // Run warm up queries if any exist.
602  g_db_handler, prog_config_opts.base_path, prog_config_opts.db_query_file);
603  if (prog_config_opts.exit_after_warmup) {
604  g_running = false;
605  }
606 
607  // Main thread blocks for as long as the servers are running.
608  wait_for_server_threads();
609 
610  // Clean shutdown.
611  int signum = g_saw_signal;
612  if (signum <= 0 || signum == SIGTERM) {
613  return 0;
614  } else {
615  return signum;
616  }
617 }
const std::string kDataDirectoryName
void run_warmup_queries(std::shared_ptr< DBHandler > handler, std::string base_path, std::string query_file_path)
Definition: HeavyDB.cpp:206
unsigned renderer_vulkan_timeout_ms
std::vector< LeafHostInfo > string_leaves
std::string udf_compiler_path
std::shared_ptr< DBHandler > g_db_handler
Definition: HeavyDB.cpp:94
#define LOG(tag)
Definition: Logger.h:285
void heartbeat()
Definition: HeavyDB.cpp:310
void start_server(std::shared_ptr< TThreadedServer > server, const int port)
Definition: HeavyDB.cpp:182
std::shared_ptr< TThreadedServer > g_thrift_http_binary_server
Definition: HeavyDB.cpp:87
std::atomic< int > g_saw_signal
Definition: HeavyDB.cpp:84
size_t max_concurrent_render_sessions
tbb::task_arena g_tbb_arena
std::vector< LeafHostInfo > db_leaves
bool g_enable_http_binary_server
std::shared_ptr< TThreadedServer > g_thrift_http_server
Definition: HeavyDB.cpp:86
std::string ssl_key_file
AuthMetadata authMetadata
static void start(std::atomic< bool > &is_program_running)
void shutdown()
Definition: Logger.cpp:397
std::vector< std::string > udf_compiler_options
std::atomic< bool > g_running
Definition: HeavyDB.cpp:78
File_Namespace::DiskCacheConfig disk_cache_config
void file_delete(std::atomic< bool > &program_is_running, const unsigned int wait_interval_seconds, const std::string base_path)
Definition: File.cpp:304
bool g_enable_fsi
Definition: Catalog.cpp:96
int cpu_threads()
Definition: thread_count.h:25
bool g_enable_thrift_logs
Definition: HeavyDB.cpp:289
void thrift_stop()
Definition: HeavyDB.cpp:292
std::string master_address
std::shared_ptr< TThreadedServer > g_thrift_tcp_server
Definition: HeavyDB.cpp:88
SystemParameters system_parameters
std::string ssl_cert_file

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void thrift_stop ( )

Definition at line 292 of file HeavyDB.cpp.

Referenced by heartbeat(), and startHeavyDBServer().

292  {
293  if (auto thrift_http_server = g_thrift_http_server; thrift_http_server) {
294  thrift_http_server->stop();
295  }
296  g_thrift_http_server.reset();
297 
298  if (auto thrift_http_binary_server = g_thrift_http_binary_server;
299  thrift_http_binary_server) {
300  thrift_http_binary_server->stop();
301  }
303 
304  if (auto thrift_tcp_server = g_thrift_tcp_server; thrift_tcp_server) {
305  thrift_tcp_server->stop();
306  }
307  g_thrift_tcp_server.reset();
308 }
std::shared_ptr< TThreadedServer > g_thrift_http_binary_server
Definition: HeavyDB.cpp:87
std::shared_ptr< TThreadedServer > g_thrift_http_server
Definition: HeavyDB.cpp:86
std::shared_ptr< TThreadedServer > g_thrift_tcp_server
Definition: HeavyDB.cpp:88

+ Here is the caller graph for this function:

Variable Documentation

bool g_enable_fsi

Definition at line 96 of file Catalog.cpp.

bool g_enable_http_binary_server
bool g_enable_thrift_logs

Definition at line 289 of file HeavyDB.cpp.

std::atomic<bool> g_running {true}