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

Method InitBackendStates

be/src/runtime/coordinator.cc:260–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260void Coordinator::InitBackendStates() {
261 int num_backends = exec_params_.query_schedule().backend_exec_params().size();
262 DCHECK_GT(num_backends, 0);
263
264 lock_guard<SpinLock> l(backend_states_init_lock_);
265 backend_states_.resize(num_backends);
266
267 COUNTER_SET(PROFILE_NumBackends.Instantiate(query_profile_), num_backends);
268
269 // create BackendStates
270 int backend_idx = 0;
271 for (const BackendExecParamsPB& backend_exec_params :
272 exec_params_.query_schedule().backend_exec_params()) {
273 BackendState* backend_state = obj_pool()->Add(
274 new BackendState(exec_params_, backend_idx, filter_mode_, backend_exec_params));
275 backend_state->Init(fragment_stats_, host_profiles_, obj_pool());
276 backend_states_[backend_idx++] = backend_state;
277 // was_inserted is true if the pair was successfully inserted into the map, false
278 // otherwise.
279 bool was_inserted = addr_to_backend_state_
280 .emplace(backend_state->krpc_impalad_address(), backend_state)
281 .second;
282 if (UNLIKELY(!was_inserted)) {
283 DCHECK(false) << "Network address " << backend_state->krpc_impalad_address()
284 << " associated with multiple BackendStates";
285 }
286 }
287 backend_resource_state_ = obj_pool()->Add(new BackendResourceState(backend_states_));
288 num_completed_backends_ = PROFILE_NumCompletedBackends.Instantiate(query_profile_);
289}
290
291void Coordinator::ExecSummary::Init(const QueryExecParams& exec_params) {
292 const TQueryExecRequest& request = exec_params.query_exec_request();

Callers

nothing calls this directly

Calls 5

resizeMethod · 0.80
sizeMethod · 0.45
InstantiateMethod · 0.45
AddMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected