OmniSciDB
c1a53651b2
|
#include <DdlCommandExecutor.h>
Public Member Functions | |
DdlCommandExecutor (const std::string &ddl_statement, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr) | |
ExecutionResult | execute (bool read_only_mode) |
bool | isShowUserSessions () const |
bool | isShowQueries () const |
bool | isKillQuery () const |
bool | isAlterSystemClear () const |
bool | isAlterSessionSet () const |
std::string | returnCacheType () const |
const std::string | getTargetQuerySessionToKill () const |
DistributedExecutionDetails | getDistributedExecutionDetails () const |
const std::string | commandStr () const |
std::pair< std::string, std::string > | getSessionParameter () const |
Private Attributes | |
std::string | ddl_statement_ |
std::string | ddl_command_ |
std::unique_ptr< DdlCommandData > | ddl_data_ |
std::shared_ptr < Catalog_Namespace::SessionInfo const > | session_ptr_ |
Definition at line 313 of file DdlCommandExecutor.h.
DdlCommandExecutor::DdlCommandExecutor | ( | const std::string & | ddl_statement, |
std::shared_ptr< Catalog_Namespace::SessionInfo const > | session_ptr | ||
) |
Definition at line 310 of file DdlCommandExecutor.cpp.
References CHECK, ddl_command_, ddl_data_, ddl_statement_, and VLOG.
const std::string DdlCommandExecutor::commandStr | ( | ) | const |
Returns command string, can be useful for logging, conversion
Definition at line 629 of file DdlCommandExecutor.cpp.
References ddl_command_.
Referenced by DBHandler::executeDdl().
ExecutionResult DdlCommandExecutor::execute | ( | bool | read_only_mode | ) |
Parses given JSON string and routes resulting payload to appropriate DDL command class for execution.
return | ExecutionResult of DDL command execution (if applicable) |
Definition at line 334 of file DdlCommandExecutor.cpp.
References ddl_command_, ddl_data_, Parser::AlterTableStmt::delegate(), legacylockmgr::ExecutorOuterLock, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), legacylockmgr::LockMgr< MutexType, KeyType >::getMutex(), run_benchmark_import::result, session_ptr_, and UNREACHABLE.
Referenced by DBHandler::executeDdl(), heavydb.cursor.Cursor::executemany(), and QueryRunner::QueryRunner::runDDLStatement().
DistributedExecutionDetails DdlCommandExecutor::getDistributedExecutionDetails | ( | ) | const |
Returns an object indicating where command execution should take place and how results should be aggregated for distributed setups.
Definition at line 564 of file DdlCommandExecutor.cpp.
References DistributedExecutionDetails::aggregation_type, AGGREGATOR_ONLY, ALL_NODES, CHECK, ddl_command_, ddl_data_, DistributedExecutionDetails::execution_location, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), LEAVES_ONLY, NONE, and UNION.
std::pair< std::string, std::string > DdlCommandExecutor::getSessionParameter | ( | ) | const |
Returns name and value of a Session parameter
Definition at line 529 of file DdlCommandExecutor.cpp.
References CHECK, ddl_data_, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), and to_upper().
Referenced by DBHandler::executeDdl().
const std::string DdlCommandExecutor::getTargetQuerySessionToKill | ( | ) | const |
Returns target query session if this command is KILL QUERY
Definition at line 612 of file DdlCommandExecutor.cpp.
References CHECK, ddl_data_, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), and isKillQuery().
Referenced by DBHandler::executeDdl().
bool DdlCommandExecutor::isAlterSessionSet | ( | ) | const |
Returns true if this command is ALTER SESSION SET
Definition at line 525 of file DdlCommandExecutor.cpp.
References ddl_command_.
Referenced by DBHandler::executeDdl().
bool DdlCommandExecutor::isAlterSystemClear | ( | ) | const |
Returns true if this command is ALTER SYSTEM CLEAR
Definition at line 521 of file DdlCommandExecutor.cpp.
References ddl_command_.
Referenced by DBHandler::executeDdl().
bool DdlCommandExecutor::isKillQuery | ( | ) | const |
Returns true if this command is KILL QUERY
Definition at line 517 of file DdlCommandExecutor.cpp.
References ddl_command_.
Referenced by DBHandler::executeDdl(), and getTargetQuerySessionToKill().
bool DdlCommandExecutor::isShowQueries | ( | ) | const |
Returns true if this command is SHOW QUERIES
Definition at line 513 of file DdlCommandExecutor.cpp.
References ddl_command_.
Referenced by DBHandler::executeDdl().
bool DdlCommandExecutor::isShowUserSessions | ( | ) | const |
Returns true if this command is SHOW USER SESSIONS
Definition at line 509 of file DdlCommandExecutor.cpp.
References ddl_command_.
Referenced by DBHandler::executeDdl().
std::string DdlCommandExecutor::returnCacheType | ( | ) | const |
Returns which kind of caches to clear if ALTER SYSTEM CLEAR
Definition at line 556 of file DdlCommandExecutor.cpp.
References CHECK, ddl_command_, ddl_data_, and anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload().
Referenced by DBHandler::executeDdl().
|
private |
Definition at line 380 of file DdlCommandExecutor.h.
Referenced by commandStr(), DdlCommandExecutor(), execute(), getDistributedExecutionDetails(), isAlterSessionSet(), isAlterSystemClear(), isKillQuery(), isShowQueries(), isShowUserSessions(), and returnCacheType().
|
private |
Definition at line 381 of file DdlCommandExecutor.h.
Referenced by DdlCommandExecutor(), execute(), getDistributedExecutionDetails(), getSessionParameter(), getTargetQuerySessionToKill(), and returnCacheType().
|
private |
Definition at line 379 of file DdlCommandExecutor.h.
Referenced by DdlCommandExecutor().
|
private |
Definition at line 382 of file DdlCommandExecutor.h.
Referenced by execute().