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

Method GetNextScanRange

be/src/exec/hdfs-scan-node-base.cc:1392–1412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1390}
1391
1392Status ScanRangeSharedState::GetNextScanRange(
1393 RuntimeState* state, ScanRange** scan_range) {
1394 DCHECK(use_mt_scan_node_) << "Should only be called by MT scan nodes";
1395 while (true) {
1396 *scan_range = scan_range_queue_.Dequeue();
1397 if (*scan_range != nullptr) return Status::OK();
1398 {
1399 unique_lock<mutex> l(scan_range_submission_lock_);
1400 while (scan_range_queue_.Empty() && remaining_scan_range_submissions_.Load() > 0
1401 && !state->is_cancelled()) {
1402 range_submission_cv_.Wait(l);
1403 }
1404 }
1405 // No more work to do.
1406 if (scan_range_queue_.Empty() && remaining_scan_range_submissions_.Load() == 0) {
1407 break;
1408 }
1409 if (state->is_cancelled()) return Status::CANCELLED;
1410 }
1411 return Status::OK();
1412}
1413
1414void ScanRangeSharedState::AddCancellationHook(RuntimeState* state) {
1415 DCHECK(use_mt_scan_node_) << "Should only be called by MT scan nodes";

Callers 1

Calls 6

OKFunction · 0.85
DequeueMethod · 0.45
EmptyMethod · 0.45
LoadMethod · 0.45
is_cancelledMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected