20 #include "gen-cpp/ImpalaInternalService.h"
25 using namespace apache::thrift;
26 using namespace impala;
29 lock_guard<mutex> l(status_lock_);
30 if (!status.
ok() && exec_status_.ok()) exec_status_ = status;
35 lock_guard<mutex> l(status_lock_);
41 Status FragmentMgr::FragmentExecState::Prepare(
42 const TExecPlanFragmentParams& exec_params) {
43 exec_params_ = exec_params;
58 void FragmentMgr::FragmentExecState::ReportStatusCb(
60 DCHECK(status.
ok() || done);
65 if (!coord_status.
ok()) {
67 s <<
"couldn't get a client for " << coord_address();
72 TReportExecStatusParams params;
73 params.protocol_version = ImpalaInternalServiceVersion::V1;
74 params.__set_query_id(fragment_instance_ctx_.query_ctx.query_id);
75 params.__set_backend_num(fragment_instance_ctx_.backend_num);
76 params.__set_fragment_instance_id(fragment_instance_ctx_.fragment_instance_id);
78 params.__set_done(done);
80 params.__isset.profile =
true;
83 DCHECK(runtime_state != NULL);
87 TInsertExecStatus insert_status;
96 params.__set_insert_exec_status(insert_status);
101 params.__isset.error_log = (params.error_log.size() > 0);
103 TReportExecStatusResult res;
105 coord.
DoRpc(&ImpalaInternalServiceClient::ReportExecStatus, params, &res);
106 if (rpc_status.
ok()) rpc_status =
Status(res.status);
107 if (!rpc_status.
ok()) {
RuntimeState * runtime_state()
only valid after calling Exec(), and may return NULL if there is no executor
FileMoveMap * hdfs_files_to_move()
#define RETURN_IF_ERROR(stmt)
some generally useful macros
void GetUnreportedErrors(ErrorLogMap *new_errors)
PartitionStatusMap * per_partition_status()
void Cancel(const Status *cause=NULL)
Status Exec(QuerySchedule &schedule, std::vector< ExprContext * > *output_expr_ctxs)
Status Close()
call beeswax.close() for current query, if one in progress
Status DoRpc(const F &f, const Request &request, Response *response)
void SetTStatus(T *status_container) const
Status UpdateStatus(const Status &status, const TUniqueId *failed_fragment)
ImpaladQueryExecutor * executor_
execution state of coordinator fragment
void ToThrift(TRuntimeProfileTree *tree) const