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

Method write

bolt/exec/OperatorTraceWriter.cpp:77–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void OperatorTraceInputWriter::write(const RowVectorPtr& rows) {
78 if (FOLLY_UNLIKELY(finished_)) {
79 return;
80 }
81
82 if (batch_ == nullptr) {
83 batch_ = std::make_unique<VectorStreamGroup>(pool_, serde_);
84 batch_->createStreamTree(
85 std::static_pointer_cast<const RowType>(rows->type()),
86 1'000,
87 &options_);
88 }
89 batch_->append(rows);
90
91 // Serialize and write out each batch.
92 IOBufOutputStream out(
93 *pool_, nullptr, std::max<int64_t>(64 * 1024, batch_->size()));
94 batch_->flush(&out);
95 batch_->clear();
96 auto iobuf = out.getIOBuf();
97 updateAndCheckTraceLimitCB_(iobuf->computeChainDataLength());
98 traceFile_->append(std::move(iobuf));
99}
100
101void OperatorTraceInputWriter::finish() {
102 if (finished_) {

Callers

nothing calls this directly

Calls 12

toJsonFunction · 0.85
createStreamTreeMethod · 0.80
hasGroupMethod · 0.80
hasConnectorSplitMethod · 0.80
serializeFunction · 0.50
typeMethod · 0.45
appendMethod · 0.45
sizeMethod · 0.45
flushMethod · 0.45
clearMethod · 0.45
getIOBufMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected