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

Method writeAndFlush

bolt/exec/SpillFile.cpp:356–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356uint64_t SpillWriter::writeAndFlush(
357 const RowVectorPtr& rows,
358 const folly::Range<IndexRange*>& indices) {
359 checkNotFinished();
360
361 uint64_t timeUs{0};
362 {
363 MicrosecondTimer timer(&timeUs);
364 if (batch_ == nullptr) {
365 bytedance::bolt::VectorSerde::Options options = {
366 kDefaultUseLosslessTimestamp, compressionKind_};
367 batch_ = std::make_unique<VectorStreamGroup>(pool_, serde_);
368 batch_->createStreamTree(
369 std::static_pointer_cast<const RowType>(rows->type()),
370 rows->size(),
371 &options);
372 }
373 batch_->append(rows, indices);
374 }
375 rowsInCurrentFile_ += rows->size();
376 updateAppendStats(rows->size(), timeUs);
377 return flush();
378}
379
380uint64_t SpillWriter::write(
381 const std::vector<char*, memory::StlAllocator<char*>>& rows,

Callers 1

appendToPartitionMethod · 0.80

Calls 4

createStreamTreeMethod · 0.80
typeMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected