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

Method StartScanRange

be/src/runtime/io/request-context.cc:511–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511Status RequestContext::StartScanRange(ScanRange* range, bool* needs_buffers) {
512 RETURN_IF_ERROR(parent_->ValidateScanRange(range));
513 range->InitInternal(parent_, this);
514
515 unique_lock<mutex> lock(lock_);
516 DCHECK(Validate()) << endl << DebugString();
517 if (state_ == RequestContext::Cancelled) return CONTEXT_CANCELLED;
518
519 DCHECK_NE(range->bytes_to_read(), 0);
520 if (range->UseHdfsCache()) {
521 bool cached_read_succeeded;
522 RETURN_IF_ERROR(TryReadFromCache(lock, range, &cached_read_succeeded,
523 needs_buffers));
524 if (cached_read_succeeded) return Status::OK();
525 // Cached read failed, fall back to normal read path.
526 }
527 // If we don't have a buffer yet, the caller must allocate buffers for the range.
528 *needs_buffers =
529 range->buffer_manager_->is_internal_buffer();
530 if (*needs_buffers) range->SetBlockedOnBuffer();
531 AddActiveScanRangeLocked(lock, range);
532 AddRangeToDisk(lock, range,
533 *needs_buffers ? ScheduleMode::BY_CALLER : ScheduleMode::IMMEDIATELY);
534 DCHECK(Validate()) << endl << DebugString();
535 return Status::OK();
536}
537
538Status RequestContext::TryReadFromCache(const unique_lock<mutex>& lock,
539 ScanRange* range, bool* read_succeeded, bool* needs_buffers) {

Callers 10

AddAndStartStreamMethod · 0.80
GetNextBufferMethod · 0.80
LoadMethod · 0.80
ReadAllMethod · 0.80
ReadToBufferMethod · 0.80
readRandomMethod · 0.80
ReadAsyncMethod · 0.80
ValidateSyncReadMethod · 0.80
TEST_FFunction · 0.80

Calls 9

OKFunction · 0.85
bytes_to_readMethod · 0.80
UseHdfsCacheMethod · 0.80
is_internal_bufferMethod · 0.80
SetBlockedOnBufferMethod · 0.80
ValidateFunction · 0.50
DebugStringFunction · 0.50
ValidateScanRangeMethod · 0.45
InitInternalMethod · 0.45

Tested by 2

ValidateSyncReadMethod · 0.64
TEST_FFunction · 0.64