MCPcopy Create free account
hub / github.com/apache/arrow / ~SerialIterator

Method ~SerialIterator

cpp/src/arrow/util/thread_pool.h:327–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325 ARROW_DISALLOW_COPY_AND_ASSIGN(SerialIterator);
326 ARROW_DEFAULT_MOVE_AND_ASSIGN(SerialIterator);
327 ~SerialIterator() {
328 // A serial iterator must be consumed before it can be destroyed. Allowing it to
329 // do otherwise would lead to resource leakage. There will likely be deadlocks at
330 // this spot in the future but these will be the result of other bugs and not the
331 // fact that we are forcing consumption here.
332
333 // If a streaming API needs to support early abandonment then it should be done so
334 // with a cancellation token and not simply discarding the iterator and expecting
335 // the underlying work to clean up correctly.
336 if (executor && !executor->IsFinished()) {
337 while (true) {
338 Result<T> maybe_next = Next();
339 if (!maybe_next.ok() || IsIterationEnd(*maybe_next)) {
340 break;
341 }
342 }
343 }
344 }
345
346 Result<T> Next() {
347 executor->Unpause();

Callers

nothing calls this directly

Calls 4

IsIterationEndFunction · 0.85
NextFunction · 0.50
IsFinishedMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected