MCPcopy Create free account
hub / github.com/apache/impala / ClientRequestState

Method ClientRequestState

be/src/service/client-request-state.cc:110–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108const TExecRequest ClientRequestState::unknown_exec_request_;
109
110ClientRequestState::ClientRequestState(const TQueryCtx& query_ctx, Frontend* frontend,
111 ImpalaServer* server, shared_ptr<ImpalaServer::SessionState> session,
112 QueryDriver* query_driver)
113 : query_ctx_(query_ctx),
114 last_active_time_ms_(numeric_limits<int64_t>::max()),
115 child_query_executor_(new ChildQueryExecutor),
116 session_(move(session)),
117 coord_exec_called_(false),
118 // Profile is assigned name w/ id after planning
119 profile_(RuntimeProfile::Create(&profile_pool_, "Query", false)),
120 frontend_profile_(RuntimeProfile::Create(&profile_pool_, "Frontend", false)),
121 server_profile_(RuntimeProfile::Create(&profile_pool_, "ImpalaServer", false)),
122 summary_profile_(RuntimeProfile::Create(&profile_pool_, "Summary", false)),
123 frontend_(frontend),
124 parent_server_(server),
125 start_time_us_(UnixMicros()),
126 fetch_rows_timeout_us_(MICROS_PER_MILLI * query_options().fetch_rows_timeout_ms),
127 parent_driver_(query_driver) {
128
129 if (FLAGS_otel_trace_enabled && should_otel_trace_query(
130 query_ctx_.session.session_type, query_ctx_.client_request)) {
131 // initialize OpenTelemetry for this query
132 VLOG(2) << "Initializing OpenTelemetry trace for query " << PrintId(query_id());
133 otel_trace_manager_ = build_otel_trace_manager(this);
134 otel_trace_manager_->StartChildSpanInit();
135 }
136
137 bool is_external_fe = session_type() == TSessionType::EXTERNAL_FRONTEND;
138 // "Impala Backend Timeline" was specifically chosen to exploit the lexicographical
139 // ordering defined by the underlying std::map holding the timelines displayed in
140 // the web UI. This helps ensure that "Frontend Timeline" is displayed before
141 // "Impala Backend Timeline".
142 query_events_ = summary_profile_->AddEventSequence(
143 is_external_fe ? "Impala Backend Timeline" : "Query Timeline");
144 query_events_->Start();
145 profile_->AddChild(summary_profile_);
146
147#ifndef NDEBUG
148 profile_->AddInfoString("DEBUG MODE WARNING", "Query profile created while running a "
149 "DEBUG build of Impala. Use RELEASE builds to measure query performance.");
150#endif
151 row_materialization_timer_ = ADD_TIMER(server_profile_, "RowMaterializationTimer");
152 num_rows_fetched_counter_ = ADD_COUNTER(server_profile_, "NumRowsFetched", TUnit::UNIT);
153 row_materialization_rate_ =
154 server_profile_->AddDerivedCounter("RowMaterializationRate", TUnit::UNIT_PER_SECOND,
155 bind<int64_t>(&RuntimeProfile::UnitsPerSecond, num_rows_fetched_counter_,
156 row_materialization_timer_));
157 num_rows_fetched_from_cache_counter_ =
158 ADD_COUNTER(server_profile_, "NumRowsFetchedFromCache", TUnit::UNIT);
159 client_wait_timer_ = ADD_TIMER(server_profile_, "ClientFetchWaitTimer");
160 client_wait_time_stats_ =
161 ADD_SUMMARY_STATS_TIMER(server_profile_, "ClientFetchWaitTimeStats");
162 rpc_read_timer_ = ADD_TIMER(server_profile_, "RPCReadTimer");
163 rpc_write_timer_ = ADD_TIMER(server_profile_, "RPCWriteTimer");
164 rpc_count_ = ADD_COUNTER(server_profile_, "RPCCount", TUnit::UNIT);
165 get_inflight_profile_time_stats_ =
166 PROFILE_GetInFlightProfileTimeStats.Instantiate(server_profile_);
167 client_fetch_lock_wait_timer_ =

Callers

nothing calls this directly

Calls 15

maxFunction · 0.85
moveFunction · 0.85
CreateClass · 0.85
UnixMicrosFunction · 0.85
should_otel_trace_queryFunction · 0.85
PrintIdFunction · 0.85
build_otel_trace_managerFunction · 0.85
PrintValueFunction · 0.85
SubstituteFunction · 0.85
GetVersionStringFunction · 0.85
TNetworkAddressToStringFunction · 0.85
StartChildSpanInitMethod · 0.80

Tested by

no test coverage detected