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

Method flush

bolt/exec/SpillFile.cpp:267–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267uint64_t SpillWriter::flush() {
268 if (batch_ == nullptr) {
269 return 0;
270 }
271
272 auto* file = ensureFile();
273 BOLT_CHECK_NOT_NULL(file);
274
275 IOBufOutputStream out(
276 *pool_, nullptr, std::max<int64_t>(64 * 1024, batch_->size()));
277 uint64_t flushTimeUs{0};
278 {
279 MicrosecondTimer timer(&flushTimeUs);
280 batch_->flush(&out);
281 }
282 batch_.reset();
283
284 uint64_t writeTimeUs{0};
285 uint64_t writtenBytes{0};
286 auto iobuf = out.getIOBuf();
287 {
288 MicrosecondTimer timer(&writeTimeUs);
289 writtenBytes = file->write(std::move(iobuf));
290 }
291 updateWriteStats(writtenBytes, flushTimeUs, writeTimeUs);
292 updateAndCheckSpillLimitCb_(writtenBytes);
293 return writtenBytes;
294}
295
296uint64_t SpillWriter::write(
297 const RowVectorPtr& rows,

Callers 8

_pollFunction · 0.45
run_sqlFunction · 0.45
writeMethod · 0.45
toSerializedPageMethod · 0.45
toSerializedPageMethod · 0.45
toSerializedPageMethod · 0.45
appendMethod · 0.45
copyFilesMethod · 0.45

Calls 4

sizeMethod · 0.45
resetMethod · 0.45
getIOBufMethod · 0.45
writeMethod · 0.45

Tested by 4

toSerializedPageMethod · 0.36
toSerializedPageMethod · 0.36
toSerializedPageMethod · 0.36
appendMethod · 0.36