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

Method ReadDone

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

Source from the content-addressed store, hash-verified

202};
203
204void RequestContext::ReadDone(int disk_id, ReadOutcome outcome, ScanRange* range) {
205 // TODO: IMPALA-4249: it is safe to touch 'range' until DecrementDiskThread() is
206 // called because all clients of DiskIoMgr keep ScanRange objects alive until they
207 // unregister their RequestContext.
208 unique_lock<mutex> lock(lock_);
209 RequestContext::PerDiskState* disk_state = &disk_states_[disk_id];
210 DCHECK_GT(disk_state->num_threads_in_op(), 0);
211 if (outcome == ReadOutcome::SUCCESS_EOSR) {
212 // No more reads to do.
213 --disk_state->num_remaining_ranges();
214 } else if (outcome == ReadOutcome::SUCCESS_NO_EOSR) {
215 // Schedule the next read.
216 if (state_ != RequestContext::Cancelled) {
217 ScheduleScanRange(lock, range);
218 }
219 } else if (outcome == ReadOutcome::BLOCKED_ON_BUFFER) {
220 // Do nothing - the caller must add a buffer to the range or cancel it.
221 } else {
222 DCHECK(outcome == ReadOutcome::CANCELLED) << static_cast<int>(outcome);
223 // No more reads - clean up the scan range.
224 --disk_state->num_remaining_ranges();
225 RemoveActiveScanRangeLocked(lock, range);
226 }
227 // Release refcount that was taken in IncrementDiskThreadAfterDequeue().
228 disk_state->DecrementDiskThread(lock, this);
229 DCHECK(Validate()) << endl << DebugString();
230}
231
232void RequestContext::OperDone(RequestRange* range, const Status& status) {
233 DCHECK(range != nullptr);

Callers 1

DiskThreadLoopMethod · 0.80

Calls 5

num_threads_in_opMethod · 0.80
num_remaining_rangesMethod · 0.80
DecrementDiskThreadMethod · 0.80
ValidateFunction · 0.50
DebugStringFunction · 0.50

Tested by

no test coverage detected