MCPcopy Create free account
hub / github.com/bytedance/bolt / hasNext

Method hasNext

bolt/exec/tests/utils/Cursor.cpp:459–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457 };
458
459 bool hasNext() override {
460 if (next_) {
461 return true;
462 }
463 if (!task_->isRunning()) {
464 return false;
465 }
466 while (true) {
467 ContinueFuture future = ContinueFuture::makeEmpty();
468 RowVectorPtr next = task_->next(&future);
469 if (next != nullptr) {
470 next_ = next;
471 return true;
472 }
473 // When next is returned from task as a null pointer.
474 if (!future.valid()) {
475 BOLT_CHECK(!task_->isRunning() || !noMoreSplits_);
476 return false;
477 }
478 // Task is blocked for some reason. Wait and try again.
479 BOLT_CHECK_NULL(next);
480 future.wait();
481 }
482 };
483
484 RowVectorPtr& current() override {
485 return current_;

Callers

nothing calls this directly

Calls 4

waitMethod · 0.80
isRunningMethod · 0.45
nextMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected