OmniSciDB
a5dc49c757
|
#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 |
bool | isAlterSystemControlExecutorQueue () const |
std::string | returnQueueAction () 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 420 of file DdlCommandExecutor.h.
DdlCommandExecutor::DdlCommandExecutor | ( | const std::string & | ddl_statement, |
std::shared_ptr< Catalog_Namespace::SessionInfo const > | session_ptr | ||
) |
Definition at line 502 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 838 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 526 of file DdlCommandExecutor.cpp.
References ddl_command_, ddl_data_, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), 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 773 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 726 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 821 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 722 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 718 of file DdlCommandExecutor.cpp.
References ddl_command_.
Referenced by DBHandler::executeDdl().
bool DdlCommandExecutor::isAlterSystemControlExecutorQueue | ( | ) | const |
Returns true if this command is ALTER SYSTEM PAUSE|RESUME EXECUTOR QUEUE
Definition at line 761 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 714 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 710 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 706 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 753 of file DdlCommandExecutor.cpp.
References CHECK, ddl_command_, ddl_data_, and anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload().
Referenced by DBHandler::executeDdl().
std::string DdlCommandExecutor::returnQueueAction | ( | ) | const |
Returns whether PAUSE or RESUME request has been delivered to ALTER SYSTEM <CONTROL> EXECUTOR qUEUE
Definition at line 765 of file DdlCommandExecutor.cpp.
References CHECK, ddl_command_, ddl_data_, and anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload().
Referenced by DBHandler::executeDdl().
|
private |
Definition at line 498 of file DdlCommandExecutor.h.
Referenced by commandStr(), DdlCommandExecutor(), execute(), getDistributedExecutionDetails(), isAlterSessionSet(), isAlterSystemClear(), isAlterSystemControlExecutorQueue(), isKillQuery(), isShowQueries(), isShowUserSessions(), returnCacheType(), and returnQueueAction().
|
private |
Definition at line 499 of file DdlCommandExecutor.h.
Referenced by DdlCommandExecutor(), execute(), getDistributedExecutionDetails(), getSessionParameter(), getTargetQuerySessionToKill(), returnCacheType(), and returnQueueAction().
|
private |
Definition at line 497 of file DdlCommandExecutor.h.
Referenced by DdlCommandExecutor().
|
private |
Definition at line 500 of file DdlCommandExecutor.h.
Referenced by execute().