Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <query-exec-state.h>
Public Member Functions | |
QueryExecState (const TQueryCtx &query_ctx, ExecEnv *exec_env, Frontend *frontend, ImpalaServer *server, boost::shared_ptr< ImpalaServer::SessionState > session) | |
~QueryExecState () | |
Status | Exec (TExecRequest *exec_request) |
Status | Exec (const TMetadataOpRequest &exec_request) |
void | Wait () |
void | WaitAsync () |
Calls Wait() asynchronously in a thread and returns immediately. More... | |
void | BlockOnWait () |
Status | FetchRows (const int32_t max_rows, QueryResultSet *fetched_rows) |
Status | RestartFetch () |
void | UpdateQueryState (beeswax::QueryState::type query_state) |
Status | UpdateQueryStatus (const Status &status) |
void | Cancel (const Status *cause=NULL) |
void | Done () |
Status | SetResultCache (QueryResultSet *cache, int64_t max_size) |
ImpalaServer::SessionState * | session () const |
const std::string & | effective_user () const |
const std::string & | connected_user () const |
const std::string & | do_as_user () const |
TSessionType::type | session_type () const |
const TUniqueId & | session_id () const |
const std::string & | default_db () const |
bool | eos () const |
Coordinator * | coord () const |
QuerySchedule * | schedule () |
int | num_rows_fetched () const |
void | set_fetched_rows () |
bool | fetched_rows () const |
bool | returns_result_set () |
const TResultSetMetadata * | result_metadata () |
const TUniqueId & | query_id () const |
const TExecRequest & | exec_request () const |
TStmtType::type | stmt_type () const |
TCatalogOpType::type | catalog_op_type () const |
TDdlType::type | ddl_type () const |
boost::mutex * | lock () |
boost::mutex * | fetch_rows_lock () |
const beeswax::QueryState::type | query_state () const |
void | set_query_state (beeswax::QueryState::type state) |
const Status & | query_status () const |
void | set_result_metadata (const TResultSetMetadata &md) |
const RuntimeProfile & | profile () const |
const RuntimeProfile & | summary_profile () const |
const TimestampValue & | start_time () const |
const TimestampValue & | end_time () const |
const std::string & | sql_stmt () const |
const TQueryOptions & | query_options () const |
TUniqueId | parent_query_id () const |
Returns 0:0 if this is a root query. More... | |
const std::vector< std::string > & | GetAnalysisWarnings () const |
int64_t | last_active () const |
bool | is_active () const |
Returns true if Impala is actively processing this query. More... | |
RuntimeProfile::EventSequence * | query_events () const |
RuntimeProfile * | summary_profile () |
Private Member Functions | |
Status | ExecLocalCatalogOp (const TCatalogOpRequest &catalog_op) |
void | MarkInactive () |
void | MarkActive () |
Status | ExecQueryOrDmlRequest (const TQueryExecRequest &query_exec_request) |
Status | ExecDdlRequest () |
Status | ExecLoadDataRequest () |
Executes a LOAD DATA. More... | |
Status | WaitInternal () |
Core logic of Wait(). Does not update query_state_/status_. More... | |
Status | FetchRowsInternal (const int32_t max_rows, QueryResultSet *fetched_rows) |
Status | FetchNextBatch () |
Status | GetRowValue (TupleRow *row, std::vector< void * > *result, std::vector< int > *scales) |
Status | UpdateCatalog () |
Gather and publish all required updates to the metastore. More... | |
void | SetResultSet (const std::vector< std::string > &results) |
void | SetResultSet (const std::vector< std::string > &col1, const std::vector< std::string > &col2) |
void | SetResultSet (const std::vector< std::string > &col1, const std::vector< std::string > &col2, const std::vector< std::string > &col3, const std::vector< std::string > &col4) |
void | SetCreateTableAsSelectResultSet () |
Status | UpdateTableAndColumnStats () |
void | ExecChildQueriesAsync () |
void | ExecChildQueries () |
Status | WaitForChildQueries () |
void | ClearResultCache () |
Private Attributes | |
const TQueryCtx | query_ctx_ |
boost::mutex | fetch_rows_lock_ |
boost::mutex | expiration_data_lock_ |
int64_t | last_active_time_ |
uint32_t | ref_count_ |
boost::scoped_ptr< Thread > | wait_thread_ |
Thread for asynchronously running Wait(). More... | |
boost::mutex | lock_ |
ExecEnv * | exec_env_ |
boost::shared_ptr< SessionState > | session_ |
Session that this query is from. More... | |
boost::scoped_ptr< QuerySchedule > | schedule_ |
Resource assignment determined by scheduler. Owned by obj_pool_. More... | |
boost::scoped_ptr< Coordinator > | coord_ |
not set for ddl queries, or queries with "limit 0" More... | |
boost::scoped_ptr < CatalogOpExecutor > | catalog_op_executor_ |
Runs statements that query or modify the catalog via the CatalogService. More... | |
boost::scoped_ptr< std::vector < TResultRow > > | request_result_set_ |
boost::scoped_ptr< QueryResultSet > | result_cache_ |
int64_t | result_cache_max_size_ |
Max size of the result_cache_ in number of rows. A value <= 0 means no caching. More... | |
boost::scoped_ptr< RuntimeState > | local_runtime_state_ |
local runtime_state_ in case we don't have a coord_ More... | |
ObjectPool | profile_pool_ |
RuntimeProfile | profile_ |
RuntimeProfile | server_profile_ |
RuntimeProfile | summary_profile_ |
RuntimeProfile::Counter * | row_materialization_timer_ |
RuntimeProfile::Counter * | client_wait_timer_ |
Tracks how long we are idle waiting for a client to fetch rows. More... | |
MonotonicStopWatch | client_wait_sw_ |
Timer to track idle time for the above counter. More... | |
RuntimeProfile::EventSequence * | query_events_ |
std::vector< ExprContext * > | output_expr_ctxs_ |
bool | eos_ |
beeswax::QueryState::type | query_state_ |
Status | query_status_ |
TExecRequest | exec_request_ |
TResultSetMetadata | result_metadata_ |
RowBatch * | current_batch_ |
int | current_batch_row_ |
int | num_rows_fetched_ |
bool | fetched_rows_ |
Frontend * | frontend_ |
To get access to UpdateCatalog, LOAD, and DDL methods. Not owned. More... | |
ImpalaServer * | parent_server_ |
TimestampValue | start_time_ |
Start/end time of the query. More... | |
TimestampValue | end_time_ |
std::vector< ChildQuery > | child_queries_ |
List of child queries to be executed on behalf of this query. More... | |
Status | child_queries_status_ |
boost::scoped_ptr< Thread > | child_queries_thread_ |
Execution state of a query. This captures everything necessary to convert row batches received by the coordinator into results we can return to the client. It also captures all state required for servicing query-related requests from the client. Thread safety: this class is generally not thread-safe, callers need to synchronize access explicitly via lock(). To avoid deadlocks, the caller must not acquire query_exec_state_map_lock_ while holding the exec state's lock. TODO: Consider renaming to RequestExecState for consistency. TODO: Compute stats is the only stmt that requires child queries. Once the CatalogService performs background stats gathering the concept of child queries will likely become obsolete. Remove all child-query related code from this class.
Definition at line 55 of file query-exec-state.h.
impala::ImpalaServer::QueryExecState::QueryExecState | ( | const TQueryCtx & | query_ctx, |
ExecEnv * | exec_env, | ||
Frontend * | frontend, | ||
ImpalaServer * | server, | ||
boost::shared_ptr< ImpalaServer::SessionState > | session | ||
) |
Definition at line 57 of file query-exec-state.cc.
References ADD_TIMER, impala::RuntimeProfile::AddChild(), impala::RuntimeProfile::AddEventSequence(), impala::RuntimeProfile::AddInfoString(), impala::ExecEnv::backend_address(), client_wait_timer_, connected_user(), impala_udf::DebugString(), default_db(), do_as_user(), effective_user(), impala::GetVersionString(), impala::PrintId(), impala::PrintQueryState(), impala::PrintTSessionType(), profile_, query_ctx_, query_events_, query_id(), query_state_, row_materialization_timer_, server_profile_, session_, session_id(), session_type(), impala::RuntimeProfile::set_name(), impala::RuntimeProfile::EventSequence::Start(), start_time(), summary_profile_, and impala::TNetworkAddressToString().
impala::ImpalaServer::QueryExecState::~QueryExecState | ( | ) |
Definition at line 110 of file query-exec-state.cc.
void impala::ImpalaServer::QueryExecState::BlockOnWait | ( | ) |
BlockOnWait() may be called after WaitAsync() has been called in order to wait for the asynchronous thread to complete. It is safe to call this multiple times (only the first call will block). Do not call while holding lock_.
Definition at line 531 of file query-exec-state.cc.
void impala::ImpalaServer::QueryExecState::Cancel | ( | const Status * | cause = NULL | ) |
Cancels the child queries and the coordinator with the given cause. If cause is NULL, assume this was deliberately cancelled by the user. Otherwise, sets state to EXCEPTION. Caller needs to hold lock_. Does nothing if the query has reached EOS or already cancelled.
Definition at line 778 of file query-exec-state.cc.
References impala::ChildQuery::Cancel(), impala::RuntimeProfile::EventSequence::MarkEvent(), and impala::query_events_.
|
inline |
Definition at line 157 of file query-exec-state.h.
References exec_request_.
Referenced by impala::ImpalaServer::LogQueryEvents().
|
private |
Sets result_cache_ to NULL and updates its associated metrics and mem consumption. This function is a no-op if the cache has already been cleared.
Definition at line 1013 of file query-exec-state.cc.
References impala::ImpaladMetrics::RESULTSET_CACHE_TOTAL_BYTES, and impala::ImpaladMetrics::RESULTSET_CACHE_TOTAL_NUM_ROWS.
|
inline |
Definition at line 141 of file query-exec-state.h.
References query_ctx_.
Referenced by effective_user(), impala::ImpalaServer::LogAuditRecord(), and QueryExecState().
|
inline |
Definition at line 147 of file query-exec-state.h.
References coord_.
Referenced by impala::ImpalaServer::ArchiveQuery().
|
inline |
Definition at line 160 of file query-exec-state.h.
References exec_request_.
|
inline |
Definition at line 145 of file query-exec-state.h.
References query_ctx_.
Referenced by QueryExecState().
|
inline |
Definition at line 142 of file query-exec-state.h.
References session_.
Referenced by effective_user(), impala::ImpalaServer::LogAuditRecord(), and QueryExecState().
void impala::ImpalaServer::QueryExecState::Done | ( | ) |
This is called when the query is done (finished, cancelled, or failed). Takes lock_: callers must not hold lock() before calling.
Definition at line 489 of file query-exec-state.cc.
References impala::Expr::Close(), impala_udf::DebugString(), impala::ImpalaServer::exec_env_, impala::Status::GetDetail(), impala::TimestampValue::LocalTime(), impala::lock_, impala::RuntimeProfile::EventSequence::MarkEvent(), impala::PrintQueryState(), impala::query_events_, impala::Scheduler::Release(), and impala::ExecEnv::scheduler().
|
inline |
Queries are run and authorized on behalf of the effective_user. When a do_as_user is specified (is not empty), the effective_user is set to the do_as_user. This is because the connected_user is acting as a "proxy user" for the do_as_user. When do_as_user is empty, the effective_user is always set to the connected_user.
Definition at line 138 of file query-exec-state.h.
References connected_user(), and do_as_user().
Referenced by impala::ImpalaServer::LogAuditRecord(), and QueryExecState().
|
inline |
Definition at line 172 of file query-exec-state.h.
References end_time_.
|
inline |
Definition at line 146 of file query-exec-state.h.
References eos_.
Status impala::ImpalaServer::QueryExecState::Exec | ( | TExecRequest * | exec_request | ) |
Initiates execution of a exec_request. Non-blocking. Must not be called with lock_ held.
Definition at line 128 of file query-exec-state.cc.
References impala::ImpalaServer::exec_env_, impala::Status::OK, impala::PrintQueryState(), impala::PrintTStmtType(), RETURN_IF_ERROR, impala::SetQueryOption(), and impala::TQueryOptionsToMap().
Status impala::ImpalaServer::QueryExecState::Exec | ( | const TMetadataOpRequest & | exec_request | ) |
Execute a HiveServer2 metadata operation TODO: This is likely a superset of GetTableNames/GetDbNames. Coalesce these different code paths.
Definition at line 514 of file query-exec-state.cc.
References impala::Status::OK, impala::PrintQueryState(), impala::PrintTStmtType(), and RETURN_IF_ERROR.
|
inline |
Definition at line 155 of file query-exec-state.h.
References exec_request_.
Referenced by impala::ImpalaServer::LogQueryEvents().
|
private |
Serially executes the queries in child_queries_ by calling the child query's ExecAndWait(). This function is blocking and is intended to be run in a separate thread to ensure that Exec() remains non-blocking. Sets child_queries_status_. Must not be called while holding lock_.
Definition at line 994 of file query-exec-state.cc.
Referenced by ExecChildQueriesAsync().
|
private |
Asynchronously executes all child_queries_ one by one. Calls ExecChildQueries() in a new child_queries_thread_.
Definition at line 988 of file query-exec-state.cc.
References ExecChildQueries().
|
private |
Core logic of executing a ddl statement. May internally initiate execution of queries (e.g., compute stats) or dml (e.g., create table as select)
Definition at line 424 of file query-exec-state.cc.
References impala::ImpalaServer::ChildQuery, impala::ImpalaServer::exec_env_, impala::lock_, impala::Status::OK, impala::PrintTCatalogOpType(), impala::PrintTDdlType(), and RETURN_IF_ERROR.
|
private |
Executes a LOAD DATA.
|
private |
Executes a local catalog operation (an operation that does not need to execute against the catalog service). Includes USE, SHOW, DESCRIBE, and EXPLAIN statements.
Definition at line 206 of file query-exec-state.cc.
References impala::ImpalaServer::exec_env_, impala::Status::OK, impala::query_ctx_, and RETURN_IF_ERROR.
|
private |
Core logic of initiating a query or dml execution request. Initiates execution of plan fragments, if there are any, and sets up the output exprs for subsequent calls to FetchRows(). Also sets up profile and pre-execution counters. Non-blocking.
Definition at line 340 of file query-exec-state.cc.
References impala::ImpalaServer::exec_env_, impala::lock_, impala::RuntimeProfile::EventSequence::MarkEvent(), impala::Status::OK, impala::Status::ok(), impala::PER_HOST_MEM_KEY, impala::PER_HOST_VCORES_KEY, impala::query_events_, impala::query_id(), impala::ExecEnv::resource_broker(), RETURN_IF_ERROR, impala::Scheduler::Schedule(), impala::ExecEnv::scheduler(), and impala::TABLES_MISSING_STATS_KEY.
|
inline |
Definition at line 164 of file query-exec-state.h.
References fetch_rows_lock_.
|
inline |
Definition at line 151 of file query-exec-state.h.
References fetched_rows_.
Referenced by impala::ImpalaServer::LogQueryEvents().
|
private |
Fetch the next row batch and store the results in current_batch_. Only called for non-DDL / DML queries. current_batch_ is set to NULL if execution is complete or the query was cancelled. Caller needs to hold fetch_rows_lock_ and lock_. Blocks, during which time lock_ is released.
Definition at line 847 of file query-exec-state.cc.
References impala::lock_, impala::Status::OK, impala::Status::ok(), and impala::query_status_.
Status impala::ImpalaServer::QueryExecState::FetchRows | ( | const int32_t | max_rows, |
QueryResultSet * | fetched_rows | ||
) |
Return at most max_rows from the current batch. If the entire current batch has been returned, fetch another batch first. Caller needs to hold fetch_rows_lock_ and lock_. Caller should verify that EOS has not be reached before calling. Must be preceeded by call to Wait() (or WaitAsync()/BlockOnWait()). Also updates query_state_/status_ in case of error.
Definition at line 589 of file query-exec-state.cc.
References impala::query_status_.
|
private |
Core logic of FetchRows(). Does not update query_state_/status_. Caller needs to hold fetch_rows_lock_ and lock_.
Definition at line 636 of file query-exec-state.cc.
References impala::ImpalaServer::QueryResultSet::AddOneRow(), impala::ImpalaServer::QueryResultSet::AddRows(), impala::ImpalaServer::QueryResultSet::ByteSize(), impala::ExprContext::FreeLocalAllocations(), impala::Status::OK, impala::query_mem_tracker(), impala::MemTracker::Release(), impala::ImpaladMetrics::RESULTSET_CACHE_TOTAL_BYTES, impala::ImpaladMetrics::RESULTSET_CACHE_TOTAL_NUM_ROWS, RETURN_IF_ERROR, SCOPED_TIMER, impala::ImpalaServer::QueryResultSet::size(), and impala::MemTracker::TryConsume().
|
inline |
Definition at line 178 of file query-exec-state.h.
References exec_request_.
|
private |
Evaluates 'output_expr_ctxs_' against 'row' and output the evaluated row in 'result'. The values' scales (# of digits after decimal) are stored in 'scales'. result and scales must have been resized to the number of columns before call.
Definition at line 768 of file query-exec-state.cc.
References impala::Status::OK.
|
inline |
Returns true if Impala is actively processing this query.
Definition at line 188 of file query-exec-state.h.
References expiration_data_lock_, and ref_count_.
|
inline |
Definition at line 182 of file query-exec-state.h.
References expiration_data_lock_, and last_active_time_.
|
inline |
Definition at line 163 of file query-exec-state.h.
References lock_.
|
private |
Updates last_active_time_ and ref_count_ to reflect that query is currently being actively processed. Takes expiration_data_lock_.
Definition at line 937 of file query-exec-state.cc.
References impala::UnixMillis().
|
private |
Updates last_active_time_ and ref_count_ to reflect that query is currently not doing any work. Takes expiration_data_lock_.
Definition at line 929 of file query-exec-state.cc.
References impala::UnixMillis().
|
inline |
Definition at line 149 of file query-exec-state.h.
References num_rows_fetched_.
|
inline |
Returns 0:0 if this is a root query.
Definition at line 176 of file query-exec-state.h.
References query_ctx_.
|
inline |
Definition at line 169 of file query-exec-state.h.
References profile_.
Referenced by impala::ImpalaServer::ArchiveQuery().
|
inline |
Definition at line 193 of file query-exec-state.h.
References query_events_.
|
inline |
Definition at line 154 of file query-exec-state.h.
References query_ctx_.
Referenced by impala::ImpalaServer::ArchiveQuery(), impala::ImpalaServer::LogAuditRecord(), and QueryExecState().
|
inline |
Definition at line 174 of file query-exec-state.h.
References query_ctx_.
|
inline |
Definition at line 165 of file query-exec-state.h.
References query_state_.
|
inline |
Definition at line 167 of file query-exec-state.h.
References query_status_.
Referenced by impala::ImpalaServer::LogAuditRecord(), and impala::ImpalaServer::LogQueryEvents().
Status impala::ImpalaServer::QueryExecState::RestartFetch | ( | ) |
Resets the state of this query such that the next fetch() returns results from the beginning of the query result set (by using the using result_cache_). It is valid to call this function for any type of statement that returns a result set, including queries, show stmts, compute stats, etc. Returns a recoverable error status if the restart is not possible, ok() otherwise. The error is recoverable to allow clients to resume fetching. The caller must hold fetch_rows_lock_ and lock_.
Definition at line 601 of file query-exec-state.cc.
References impala::Status::OK.
|
inline |
Definition at line 153 of file query-exec-state.h.
References result_metadata_.
|
inline |
Definition at line 152 of file query-exec-state.h.
References result_metadata_.
|
inline |
Definition at line 148 of file query-exec-state.h.
References schedule_.
|
inline |
Definition at line 132 of file query-exec-state.h.
References session_.
Referenced by impala::ImpalaServer::LogAuditRecord().
|
inline |
Definition at line 144 of file query-exec-state.h.
References query_ctx_.
Referenced by impala::ImpalaServer::LogAuditRecord(), and QueryExecState().
|
inline |
Definition at line 143 of file query-exec-state.h.
References query_ctx_.
Referenced by QueryExecState().
|
inline |
Definition at line 150 of file query-exec-state.h.
References fetched_rows_.
|
inline |
Definition at line 166 of file query-exec-state.h.
References query_state_.
|
inline |
Definition at line 168 of file query-exec-state.h.
References result_metadata_.
|
private |
Sets the result set for a CREATE TABLE AS SELECT statement. The results will not be ready until all BEs complete execution. This can be called as part of Wait(), at which point results will be avilable.
Definition at line 911 of file query-exec-state.cc.
References VLOG_QUERY.
Status impala::ImpalaServer::QueryExecState::SetResultCache | ( | QueryResultSet * | cache, |
int64_t | max_size | ||
) |
Sets the API-specific (Beeswax, HS2) result cache and its size bound. The given cache is owned by this query exec state, even if an error is returned. Returns a non-ok status if max_size exceeds the per-impalad allowed maximum.
Definition at line 114 of file query-exec-state.cc.
References impala::lock_, and impala::Status::OK.
|
private |
Copies results into request_result_set_ TODO: Have the FE return list<Data.TResultRow> so that this isn't necessary
|
private |
|
private |
|
inline |
Definition at line 173 of file query-exec-state.h.
References query_ctx_.
Referenced by impala::ImpalaServer::LogAuditRecord().
|
inline |
Definition at line 171 of file query-exec-state.h.
References start_time_.
Referenced by impala::ImpalaServer::LogAuditRecord(), and QueryExecState().
|
inline |
Definition at line 156 of file query-exec-state.h.
References exec_request_.
Referenced by impala::ImpalaServer::LogQueryEvents().
|
inline |
Definition at line 170 of file query-exec-state.h.
References summary_profile_.
|
inline |
Definition at line 194 of file query-exec-state.h.
References summary_profile_.
|
private |
Gather and publish all required updates to the metastore.
Definition at line 795 of file query-exec-state.cc.
References ADD_TIMER, impala::ExecEnv::catalogd_client_cache(), impala::ImpalaServer::exec_env_, impala::MakeNetworkAddress(), impala::RuntimeProfile::EventSequence::MarkEvent(), impala::Status::OK, impala::PrepareCatalogUpdate(), impala::query_events_, impala::query_id(), RETURN_IF_ERROR, SCOPED_TIMER, and VLOG_QUERY.
void impala::ImpalaServer::QueryExecState::UpdateQueryState | ( | beeswax::QueryState::type | query_state | ) |
Update query state if the requested state isn't already obsolete. Takes lock_.
Definition at line 620 of file query-exec-state.cc.
References impala::lock_.
Update the query status and the "Query Status" summary profile string. If current status is already != ok, no update is made (we preserve the first error) If called with a non-ok argument, the expectation is that the query will be aborted quickly. Returns the status argument (so we can write RETURN_IF_ERROR(UpdateQueryStatus(SomeOperation())). Does not take lock_, but requires it: caller must ensure lock_ is taken before calling UpdateQueryStatus
Definition at line 625 of file query-exec-state.cc.
References impala::Status::GetDetail(), impala::Status::ok(), and impala::query_status_.
|
private |
Updates the metastore's table and column statistics based on the child-query results of a compute stats command. TODO: Unify the various ways that the Metastore is updated for DDL/DML. For example, INSERT queries update partition metadata in UpdateCatalog() using a TUpdateCatalogRequest, whereas our DDL uses a TCatalogOpRequest for very similar purposes. Perhaps INSERT should use a TCatalogOpRequest as well.
Definition at line 946 of file query-exec-state.cc.
References impala::ImpalaServer::exec_env_, impala::lock_, impala::RuntimeProfile::EventSequence::MarkEvent(), impala::Status::OK, impala::query_events_, and RETURN_IF_ERROR.
void impala::ImpalaServer::QueryExecState::Wait | ( | ) |
Call this to ensure that rows are ready when calling FetchRows(). Updates the query_status_, and advances query_state_ to FINISHED or EXCEPTION. Must be preceded by call to Exec(). Waits for all child queries to complete. Takes lock_.
Definition at line 538 of file query-exec-state.cc.
References impala::lock_, and impala::Status::ok().
Referenced by WaitAsync().
void impala::ImpalaServer::QueryExecState::WaitAsync | ( | ) |
Calls Wait() asynchronously in a thread and returns immediately.
Definition at line 526 of file query-exec-state.cc.
References Wait().
|
private |
Waits for all child queries to complete successfully or with an error, by joining child_queries_thread_. Returns a non-OK status if a child query fails or if the parent query is cancelled (subsequent children will not be executed). Returns OK if child_queries_thread_ is not set or if all child queries finished successfully.
Definition at line 1001 of file query-exec-state.cc.
References impala::lock_, impala::RuntimeProfile::EventSequence::MarkEvent(), impala::Status::OK, impala::query_events_, impala::query_status_, and RETURN_IF_ERROR.
|
private |
Core logic of Wait(). Does not update query_state_/status_.
Definition at line 555 of file query-exec-state.cc.
References impala::Status::OK, impala::Expr::Open(), and RETURN_IF_ERROR.
|
private |
Runs statements that query or modify the catalog via the CatalogService.
Definition at line 232 of file query-exec-state.h.
|
private |
List of child queries to be executed on behalf of this query.
Definition at line 301 of file query-exec-state.h.
|
private |
Thread to execute child_queries_ in and the resulting status. The status is OK iff all child queries complete successfully. Otherwise, status contains the error of the first child query that failed (child queries are executed serially and abort on the first error).
Definition at line 307 of file query-exec-state.h.
|
private |
Definition at line 308 of file query-exec-state.h.
|
private |
Timer to track idle time for the above counter.
Definition at line 272 of file query-exec-state.h.
|
private |
Tracks how long we are idle waiting for a client to fetch rows.
Definition at line 270 of file query-exec-state.h.
Referenced by QueryExecState().
|
private |
not set for ddl queries, or queries with "limit 0"
Definition at line 229 of file query-exec-state.h.
Referenced by coord().
|
private |
Definition at line 282 of file query-exec-state.h.
|
private |
Definition at line 283 of file query-exec-state.h.
|
private |
Definition at line 298 of file query-exec-state.h.
Referenced by end_time().
|
private |
Definition at line 276 of file query-exec-state.h.
Referenced by eos().
|
private |
Definition at line 220 of file query-exec-state.h.
|
private |
Definition at line 279 of file query-exec-state.h.
Referenced by catalog_op_type(), ddl_type(), exec_request(), GetAnalysisWarnings(), and stmt_type().
|
mutableprivate |
Protects last_active_time_ and ref_count_. Must always be taken as the last lock, that is no other locks may be taken while holding this lock.
Definition at line 208 of file query-exec-state.h.
Referenced by is_active(), and last_active().
|
private |
Ensures single-threaded execution of FetchRows(). Callers of FetchRows() are responsible for acquiring this lock. To avoid deadlocks, callers must not hold lock_ while acquiring this lock (since FetchRows() will release and re-acquire lock_ during its execution).
Definition at line 203 of file query-exec-state.h.
Referenced by fetch_rows_lock().
|
private |
True if a fetch was attempted by a client, regardless of whether a result set (or error) was returned to the client.
Definition at line 288 of file query-exec-state.h.
Referenced by fetched_rows(), and set_fetched_rows().
|
private |
To get access to UpdateCatalog, LOAD, and DDL methods. Not owned.
Definition at line 291 of file query-exec-state.h.
|
private |
Definition at line 209 of file query-exec-state.h.
Referenced by last_active().
|
private |
local runtime_state_ in case we don't have a coord_
Definition at line 249 of file query-exec-state.h.
|
private |
Definition at line 219 of file query-exec-state.h.
Referenced by lock().
|
private |
Definition at line 284 of file query-exec-state.h.
Referenced by num_rows_fetched().
|
private |
Definition at line 275 of file query-exec-state.h.
|
private |
The parent ImpalaServer; called to wait until the the impalad has processed a catalog update request. Not owned.
Definition at line 295 of file query-exec-state.h.
|
private |
The QueryExecState builds three separate profiles.
Definition at line 264 of file query-exec-state.h.
Referenced by profile(), and QueryExecState().
|
private |
Definition at line 250 of file query-exec-state.h.
|
private |
Definition at line 197 of file query-exec-state.h.
Referenced by connected_user(), default_db(), parent_query_id(), query_id(), query_options(), QueryExecState(), session_id(), session_type(), and sql_stmt().
|
private |
Definition at line 274 of file query-exec-state.h.
Referenced by query_events(), and QueryExecState().
|
private |
Definition at line 277 of file query-exec-state.h.
Referenced by query_state(), QueryExecState(), and set_query_state().
|
private |
Definition at line 278 of file query-exec-state.h.
Referenced by query_status().
|
private |
ref_count_ > 0 if Impala is currently performing work on this query's behalf. Every time a client instructs Impala to do work on behalf of this query, the ref count is increased, and decreased once that work is completed.
Definition at line 214 of file query-exec-state.h.
Referenced by is_active().
|
private |
Result set used for requests that return results and are not QUERY statements. For example, EXPLAIN, LOAD, and SHOW use this.
Definition at line 236 of file query-exec-state.h.
|
private |
Cache of the first result_cache_max_size_ query results to allow clients to restart fetching from the beginning of the result set. This cache is appended to in FetchInternal(), and set to NULL if its bound is exceeded. If the bound is exceeded, then clients cannot restart fetching because some results have been lost since the last fetch. Only set if result_cache_max_size_ > 0.
Definition at line 243 of file query-exec-state.h.
|
private |
Max size of the result_cache_ in number of rows. A value <= 0 means no caching.
Definition at line 246 of file query-exec-state.h.
|
private |
Definition at line 281 of file query-exec-state.h.
Referenced by result_metadata(), returns_result_set(), and set_result_metadata().
|
private |
Definition at line 267 of file query-exec-state.h.
Referenced by QueryExecState().
|
private |
Resource assignment determined by scheduler. Owned by obj_pool_.
Definition at line 226 of file query-exec-state.h.
Referenced by schedule().
|
private |
Definition at line 265 of file query-exec-state.h.
Referenced by QueryExecState().
|
private |
Session that this query is from.
Definition at line 223 of file query-exec-state.h.
Referenced by do_as_user(), QueryExecState(), and session().
|
private |
Start/end time of the query.
Definition at line 298 of file query-exec-state.h.
Referenced by start_time().
|
private |
Definition at line 266 of file query-exec-state.h.
Referenced by QueryExecState(), and summary_profile().
|
private |
Thread for asynchronously running Wait().
Definition at line 217 of file query-exec-state.h.