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

Method getSplits

bolt/exec/Exchange.cpp:43–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43bool Exchange::getSplits(ContinueFuture* future) {
44 if (!processSplits_) {
45 return false;
46 }
47 if (noMoreSplits_) {
48 return false;
49 }
50 std::vector<std::string> taskIds;
51 for (;;) {
52 exec::Split split;
53 auto reason = operatorCtx_->task()->getSplitOrFuture(
54 operatorCtx_->driverCtx()->splitGroupId, planNodeId(), split, *future);
55 if (reason == BlockingReason::kNotBlocked) {
56 if (split.hasConnectorSplit()) {
57 auto remoteSplit = std::dynamic_pointer_cast<RemoteConnectorSplit>(
58 split.connectorSplit);
59 BOLT_CHECK(remoteSplit, "Wrong type of split");
60 taskIds.push_back(remoteSplit->taskId);
61 } else {
62 addTaskIds(taskIds);
63 exchangeClient_->noMoreRemoteTasks();
64 noMoreSplits_ = true;
65 if (atEnd_) {
66 operatorCtx_->task()->multipleSplitsFinished(
67 stats_.rlock()->numSplits);
68 recordExchangeClientStats();
69 }
70 return false;
71 }
72 } else {
73 addTaskIds(taskIds);
74 return true;
75 }
76 }
77}
78
79BlockingReason Exchange::isBlocked(ContinueFuture* future) {
80 if (!currentPages_.empty() || atEnd_) {

Callers

nothing calls this directly

Calls 7

getSplitOrFutureMethod · 0.80
taskMethod · 0.80
hasConnectorSplitMethod · 0.80
noMoreRemoteTasksMethod · 0.80
driverCtxMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected