OmniSciDB
a5dc49c757
|
#include <Calcite.h>
Public Member Functions | |
Calcite (const int db_port, const int port, const std::string &data_dir, const size_t calcite_max_mem, const size_t service_timeout, const bool service_keepalive, const std::string &udf_filename="") | |
Calcite (const SystemParameters &db_parameters, const std::string &data_dir, const std::string &udf_filename="") | |
Calcite () | |
TPlanResult | process (query_state::QueryStateProxy, std::string sql_string, const TQueryParsingOption &query_parsing_option, const TOptimizationOption &optimization_option, const std::string &calcite_session_id="") |
void | checkAccessedObjectsPrivileges (query_state::QueryStateProxy query_state_prox, TPlanResult plan) const |
std::vector< TCompletionHint > | getCompletionHints (const Catalog_Namespace::SessionInfo &session_info, const std::vector< std::string > &visible_tables, const std::string sql_string, const int cursor) |
std::string | getExtensionFunctionWhitelist () |
std::string | getUserDefinedFunctionWhitelist () |
virtual void | updateMetadata (std::string catalog, std::string table) |
void | close_calcite_server (bool log=true) |
virtual | ~Calcite () |
std::string | getRuntimeExtensionFunctionWhitelist () |
void | setRuntimeExtensionFunctions (const std::vector< TUserDefinedFunction > &udfs, const std::vector< TUserDefinedTableFunction > &udtfs, bool isruntime=true) |
TQueryParsingOption | getCalciteQueryParsingOption (bool legacy_syntax, bool is_explain, bool check_privileges, bool is_explain_detail) |
TOptimizationOption | getCalciteOptimizationOption (bool is_view_optimize, bool enable_watchdog, const std::vector< TFilterPushDownInfo > &filter_push_down_info, bool distributed_mode) |
Static Public Member Functions | |
static std::string const | getInternalSessionProxyUserName () |
static std::string const | getInternalSessionProxyPassword () |
Private Member Functions | |
void | init (const int db_port, const int port, const std::string &data_dir, const size_t calcite_max_mem, const std::string &udf_filename) |
void | runServer (const int db_port, const int port, const std::string &data_dir, const size_t calcite_max_mem, const std::string &udf_filename) |
TPlanResult | processImpl (query_state::QueryStateProxy, std::string sql_string, const TQueryParsingOption &query_parsing_option, const TOptimizationOption &optimization_option, const std::string &calcite_session_id) |
std::vector< std::string > | get_db_objects (const std::string ra) |
void | inner_close_calcite_server (bool log) |
std::pair< std::shared_ptr < CalciteServerClient > , std::shared_ptr< TTransport > > | getClient (int port) |
int | ping (int retry_num=0, int max_retry=50) |
Private Attributes | |
std::shared_ptr < ThriftClientConnection > | connMgr_ |
bool | server_available_ |
size_t | service_timeout_ |
bool | service_keepalive_ = true |
int | remote_calcite_port_ = -1 |
std::string | ssl_trust_store_ |
std::string | ssl_trust_password_ |
std::string | ssl_key_file_ |
std::string | ssl_keystore_ |
std::string | ssl_keystore_password_ |
std::string | ssl_ca_file_ |
std::string | db_config_file_ |
std::once_flag | shutdown_once_flag_ |
Calcite::Calcite | ( | const int | db_port, |
const int | port, | ||
const std::string & | data_dir, | ||
const size_t | calcite_max_mem, | ||
const size_t | service_timeout, | ||
const bool | service_keepalive, | ||
const std::string & | udf_filename = "" |
||
) |
Definition at line 355 of file Calcite.cpp.
References init().
Calcite::Calcite | ( | const SystemParameters & | db_parameters, |
const std::string & | data_dir, | ||
const std::string & | udf_filename = "" |
||
) |
Definition at line 390 of file Calcite.cpp.
References SystemParameters::calcite_max_mem, SystemParameters::calcite_port, init(), and SystemParameters::omnisci_server_port.
|
virtual |
Definition at line 686 of file Calcite.cpp.
References close_calcite_server().
void Calcite::checkAccessedObjectsPrivileges | ( | query_state::QueryStateProxy | query_state_prox, |
TPlanResult | plan | ||
) | const |
Definition at line 496 of file Calcite.cpp.
References anonymous_namespace{Calcite.cpp}::checkPermissionForTables(), AccessPrivileges::DELETE_FROM_TABLE, query_state::QueryState::getConstSessionInfo(), AccessPrivileges::INSERT_INTO_TABLE, AccessPrivileges::SELECT_FROM_TABLE, AccessPrivileges::SELECT_FROM_VIEW, and AccessPrivileges::UPDATE_IN_TABLE.
Referenced by process().
void Calcite::close_calcite_server | ( | bool | log = true | ) |
Definition at line 662 of file Calcite.cpp.
References inner_close_calcite_server(), and shutdown_once_flag_.
Referenced by ~Calcite().
|
private |
Definition at line 537 of file Calcite.cpp.
References CHECK.
TOptimizationOption Calcite::getCalciteOptimizationOption | ( | bool | is_view_optimize, |
bool | enable_watchdog, | ||
const std::vector< TFilterPushDownInfo > & | filter_push_down_info, | ||
bool | distributed_mode | ||
) |
Definition at line 734 of file Calcite.cpp.
TQueryParsingOption Calcite::getCalciteQueryParsingOption | ( | bool | legacy_syntax, |
bool | is_explain, | ||
bool | check_privileges, | ||
bool | is_explain_detail | ||
) |
|
private |
Definition at line 252 of file Calcite.cpp.
Referenced by getCompletionHints(), getExtensionFunctionWhitelist(), getRuntimeExtensionFunctionWhitelist(), getUserDefinedFunctionWhitelist(), inner_close_calcite_server(), processImpl(), setRuntimeExtensionFunctions(), and updateMetadata().
std::vector< TCompletionHint > Calcite::getCompletionHints | ( | const Catalog_Namespace::SessionInfo & | session_info, |
const std::vector< std::string > & | visible_tables, | ||
const std::string | sql_string, | ||
const int | cursor | ||
) |
Definition at line 521 of file Calcite.cpp.
References cat(), Catalog_Namespace::SessionInfo::get_currentUser(), Catalog_Namespace::SessionInfo::get_session_id(), Catalog_Namespace::SessionInfo::getCatalog(), getClient(), remote_calcite_port_, and Catalog_Namespace::UserMetadata::userName.
std::string Calcite::getExtensionFunctionWhitelist | ( | ) |
Definition at line 626 of file Calcite.cpp.
References CHECK, logger::FATAL, getClient(), LOG, remote_calcite_port_, server_available_, and VLOG.
|
inlinestatic |
Definition at line 98 of file Calcite.h.
References anonymous_namespace{Calcite.h}::kCalciteUserPassword.
|
inlinestatic |
Definition at line 97 of file Calcite.h.
References anonymous_namespace{Calcite.h}::kCalciteUserName.
Referenced by processImpl().
std::string Calcite::getRuntimeExtensionFunctionWhitelist | ( | ) |
Definition at line 690 of file Calcite.cpp.
References logger::FATAL, getClient(), LOG, remote_calcite_port_, server_available_, UNREACHABLE, and VLOG.
std::string Calcite::getUserDefinedFunctionWhitelist | ( | ) |
Definition at line 644 of file Calcite.cpp.
References logger::FATAL, getClient(), LOG, remote_calcite_port_, server_available_, UNREACHABLE, and VLOG.
|
private |
Definition at line 368 of file Calcite.cpp.
References CHECK, connMgr_, logger::INFO, LOG, remote_calcite_port_, runServer(), and server_available_.
Referenced by Calcite().
|
private |
Definition at line 667 of file Calcite.cpp.
References getClient(), logger::INFO, LOG_IF, remote_calcite_port_, and server_available_.
Referenced by close_calcite_server().
|
private |
Definition at line 338 of file Calcite.cpp.
References logger::ERROR, measure< TimeT >::execution(), and LOG.
TPlanResult Calcite::process | ( | query_state::QueryStateProxy | query_state_proxy, |
std::string | sql_string, | ||
const TQueryParsingOption & | query_parsing_option, | ||
const TOptimizationOption & | optimization_option, | ||
const std::string & | calcite_session_id = "" |
||
) |
Definition at line 480 of file Calcite.cpp.
References checkAccessedObjectsPrivileges(), processImpl(), and run_benchmark_import::result.
|
private |
Definition at line 556 of file Calcite.cpp.
References cat(), query_state::QueryStateProxy::createTimer(), measure< TimeT >::execution(), logger::EXECUTOR, logger::FATAL, getClient(), query_state::QueryState::getConstSessionInfo(), getInternalSessionProxyUserName(), hide_sensitive_data_from_query(), logger::INFO, logger::IR, LOG, logger::PTX, remote_calcite_port_, server_available_, and logger::WARNING.
Referenced by process().
|
private |
Definition at line 276 of file Calcite.cpp.
References logger::ERROR, logger::FATAL, logger::INFO, LOG, and start_calcite_server_as_daemon().
Referenced by init().
void Calcite::setRuntimeExtensionFunctions | ( | const std::vector< TUserDefinedFunction > & | udfs, |
const std::vector< TUserDefinedTableFunction > & | udtfs, | ||
bool | isruntime = true |
||
) |
Definition at line 707 of file Calcite.cpp.
References logger::FATAL, getClient(), LOG, remote_calcite_port_, and server_available_.
|
virtual |
Definition at line 409 of file Calcite.cpp.
References measure< TimeT >::execution(), getClient(), logger::INFO, LOG, remote_calcite_port_, and server_available_.
|
private |
|
private |
Definition at line 138 of file Calcite.h.
Referenced by getCompletionHints(), getExtensionFunctionWhitelist(), getRuntimeExtensionFunctionWhitelist(), getUserDefinedFunctionWhitelist(), init(), inner_close_calcite_server(), processImpl(), setRuntimeExtensionFunctions(), and updateMetadata().
|
private |
Definition at line 135 of file Calcite.h.
Referenced by getExtensionFunctionWhitelist(), getRuntimeExtensionFunctionWhitelist(), getUserDefinedFunctionWhitelist(), init(), inner_close_calcite_server(), processImpl(), setRuntimeExtensionFunctions(), and updateMetadata().
|
private |
Definition at line 146 of file Calcite.h.
Referenced by close_calcite_server().