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

Method TryReadFromCache

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

Source from the content-addressed store, hash-verified

536}
537
538Status RequestContext::TryReadFromCache(const unique_lock<mutex>& lock,
539 ScanRange* range, bool* read_succeeded, bool* needs_buffers) {
540 DCHECK(lock.mutex() == &lock_ && lock.owns_lock());
541 RETURN_IF_ERROR(range->ReadFromCache(lock, read_succeeded));
542 if (!*read_succeeded) return Status::OK();
543
544 DCHECK(Validate()) << endl << DebugString();
545 // The following cases are possible at this point:
546 // * The scan range doesn't have sub-ranges:
547 // ** 'range->buffer_manager_->buffer_tag' is CACHED_BUFFER and the buffer is
548 // already available to the reader.
549 // (there is nothing to do)
550 //
551 // * The scan range has sub-ranges, and 'range->buffer_manager_->buffer_tag' is:
552 // ** INTERNAL_BUFFER: the client needs to add buffers to the scan range.
553 // ** CLIENT_BUFFER: the client already provided a buffer to copy data into it.
554 *needs_buffers = range->buffer_manager_->is_internal_buffer();
555 if (*needs_buffers) {
556 DCHECK(range->HasSubRanges());
557 range->SetBlockedOnBuffer();
558 // The range will be scheduled when buffers are added to it.
559 AddRangeToDisk(lock, range, ScheduleMode::BY_CALLER);
560 } else if (range->buffer_manager_->is_client_buffer()) {
561 DCHECK(range->HasSubRanges());
562 AddRangeToDisk(lock, range, ScheduleMode::IMMEDIATELY);
563 }
564 return Status::OK();
565}
566
567Status RequestContext::AddWriteRange(WriteRange* write_range) {
568 unique_lock<mutex> lock(lock_);

Callers

nothing calls this directly

Calls 10

OKFunction · 0.85
owns_lockMethod · 0.80
ReadFromCacheMethod · 0.80
is_internal_bufferMethod · 0.80
HasSubRangesMethod · 0.80
SetBlockedOnBufferMethod · 0.80
ValidateFunction · 0.50
DebugStringFunction · 0.50
mutexMethod · 0.45
is_client_bufferMethod · 0.45

Tested by

no test coverage detected