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

Method close

bolt/exec/LocalPartition.cpp:311–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311void LocalExchangeQueue::close() {
312 std::vector<ContinuePromise> consumerPromises;
313 std::vector<ContinuePromise> memoryPromises;
314 queue_.withWLock([&](auto& queue) {
315 uint64_t freedBytes = 0;
316
317 while (!queue.empty()) {
318 freedBytes += queue.front()->estimateFlatSize();
319 queue.pop();
320 }
321
322 if (freedBytes) {
323 memoryPromises = memoryManager_->decreaseMemoryUsage(freedBytes);
324 }
325
326 consumerPromises = std::move(consumerPromises_);
327 closed_ = true;
328 });
329 notify(consumerPromises);
330 notify(memoryPromises);
331}
332
333LocalExchange::LocalExchange(
334 int32_t operatorId,

Callers

nothing calls this directly

Calls 5

notifyFunction · 0.85
emptyMethod · 0.45
estimateFlatSizeMethod · 0.45
popMethod · 0.45
decreaseMemoryUsageMethod · 0.45

Tested by

no test coverage detected