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

Method GetMaxBackendStateLagMs

be/src/runtime/coordinator.cc:1371–1389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1369}
1370
1371int64_t Coordinator::GetMaxBackendStateLagMs(NetworkAddressPB* address) {
1372 DCHECK(exec_rpcs_complete_.Load()) << "Exec() must be called first.";
1373 DCHECK_GT(backend_states_.size(), 0);
1374 int64_t current_time = BackendState::GenerateReportTimestamp();
1375 int64_t min_last_report_time_ms = current_time;
1376 BackendState* min_state = nullptr;
1377 for (BackendState* backend_state : backend_states_) {
1378 if (backend_state->IsDone()) continue;
1379 int64_t last_report_time_ms = backend_state->last_report_time_ms();
1380 DCHECK_GT(last_report_time_ms, 0);
1381 if (last_report_time_ms < min_last_report_time_ms) {
1382 min_last_report_time_ms = last_report_time_ms;
1383 min_state = backend_state;
1384 }
1385 }
1386 if (min_state == nullptr) return 0;
1387 *address = min_state->krpc_impalad_address();
1388 return current_time - min_last_report_time_ms;
1389}
1390
1391// TODO: add histogram/percentile
1392void Coordinator::ComputeQuerySummary() {

Callers 1

Calls 4

last_report_time_msMethod · 0.80
LoadMethod · 0.45
sizeMethod · 0.45
IsDoneMethod · 0.45

Tested by

no test coverage detected