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

Method BlockOnWait

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

Source from the content-addressed store, hash-verified

1302}
1303
1304bool ClientRequestState::BlockOnWait(int64_t timeout_us, int64_t* block_on_wait_time_us) {
1305 DCHECK_GE(timeout_us, 0);
1306 unique_lock<mutex> l(lock_);
1307 *block_on_wait_time_us = 0;
1308 // Some metadata operations like GET_COLUMNS do not rely on WaitAsync() to launch
1309 // the wait thread. In such cases this method is expected to be a no-op.
1310 if (wait_thread_.get() == nullptr) return true;
1311 while (!is_wait_done_) {
1312 if (timeout_us == 0) {
1313 block_on_wait_cv_.Wait(l);
1314 return true;
1315 } else {
1316 MonotonicStopWatch wait_timeout_timer;
1317 wait_timeout_timer.Start();
1318 bool notified = block_on_wait_cv_.WaitFor(l, timeout_us);
1319 if (notified) {
1320 *block_on_wait_time_us = wait_timeout_timer.ElapsedTime() / NANOS_PER_MICRO;
1321 }
1322 return notified;
1323 }
1324 }
1325 return true;
1326}
1327
1328void ClientRequestState::Wait() {
1329 // block until results are ready

Callers

nothing calls this directly

Calls 5

getMethod · 0.65
WaitMethod · 0.45
StartMethod · 0.45
WaitForMethod · 0.45
ElapsedTimeMethod · 0.45

Tested by

no test coverage detected