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

Method init

bolt/exec/Task.cpp:393–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393void Task::init(std::optional<common::SpillDiskOptions>&& spillDiskOpts) {
394 BOLT_CHECK(driverFactories_.empty());
395 initTaskPool();
396
397 setSpillDiskConfig(std::move(spillDiskOpts));
398
399 if (mode_ != Task::ExecutionMode::kSerial) {
400 return;
401 }
402
403 // Create drivers.
404 BOLT_CHECK_NULL(
405 consumerSupplier_,
406 "Serial execution mode doesn't support delivering results to a "
407 "callback");
408
409 taskStats_.executionStartTimeMs = getCurrentTimeMs();
410 LocalPlanner::plan(
411 planFragment_,
412 nullptr,
413 &driverFactories_,
414 queryCtx_->queryConfig(),
415 1,
416 queryCtx_->queryConfig().isMultiDriverEnabled());
417 exchangeClients_.resize(driverFactories_.size());
418
419 // In Task::next() we always assume ungrouped execution.
420 for (const auto& factory : driverFactories_) {
421 BOLT_CHECK(factory->supportsSerialExecution());
422 numDriversUngrouped_ += factory->numDrivers;
423 numTotalDrivers_ += factory->numTotalDrivers;
424 taskStats_.pipelineStats.emplace_back(
425 factory->inputDriver, factory->outputDriver, factory->isMorselDriven());
426 }
427
428 // Create drivers.
429 createSplitGroupStateLocked(kUngroupedGroupId);
430 std::vector<std::shared_ptr<Driver>> drivers =
431 createDriversLocked(kUngroupedGroupId);
432 if (pool_->reservedBytes() != 0) {
433 BOLT_FAIL(
434 "Unexpected memory pool allocations during task[{}] driver initialization: {}",
435 taskId_,
436 pool_->treeMemoryUsage());
437 }
438
439 drivers_ = std::move(drivers);
440}
441
442void Task::setSpillDiskConfig(
443 std::optional<common::SpillDiskOptions>&& spillDiskOpts) {

Callers 6

createMethod · 0.45
extractAccumulatorsMethod · 0.45
extractValuesMethod · 0.45
toIntermediateImplMethod · 0.45
LocalPlanner.cppFile · 0.45
mainFunction · 0.45

Calls 10

getCurrentTimeMsFunction · 0.85
planFunction · 0.85
isMultiDriverEnabledMethod · 0.80
isMorselDrivenMethod · 0.80
emptyMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
reservedBytesMethod · 0.45
treeMemoryUsageMethod · 0.45

Tested by

no test coverage detected