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

Method Cancel

be/src/exec/buffered-plan-root-sink.cc:143–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void BufferedPlanRootSink::Cancel(RuntimeState* state) {
144 DCHECK(state->is_cancelled());
145 // Get the lock_ to synchronize with FlushFinal(). Either FlushFinal() will be waiting
146 // on the consumer_eos_ condition variable and get signalled below, or it will see
147 // that is_cancelled() is true after it gets the lock. Drop the the lock before
148 // signalling the CV so that a blocked thread can immediately acquire the mutex when
149 // it wakes up.
150 {
151 unique_lock<mutex> l(lock_);
152 }
153 // Wake up all sleeping threads so they can check the cancellation state.
154 // While it should be safe to call NotifyOne() here, prefer to use NotifyAll() to
155 // ensure that all sleeping threads are awoken. The calls to NotifyAll() are not on the
156 // fast path so any overhead from calling it should be negligible.
157 rows_available_.NotifyAll();
158 consumer_eos_.NotifyAll();
159 batch_queue_has_capacity_.NotifyAll();
160 discard_result(all_results_spooled_.Set(false));
161}
162
163Status BufferedPlanRootSink::GetNext(RuntimeState* state, QueryResultSet* results,
164 int num_results, bool* eos, int64_t timeout_us) {

Callers 5

SkipScanRangeMethod · 0.45
ProcessSplitMethod · 0.45
SetDoneInternalMethod · 0.45
GetNextMethod · 0.45

Calls 4

discard_resultFunction · 0.85
NotifyAllMethod · 0.80
is_cancelledMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected