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

Method serialize

bolt/exec/OperatorTraceWriter.cpp:157–169  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

155
156// static
157std::unique_ptr<folly::IOBuf> OperatorTraceSplitWriter::serialize(
158 const std::string& split) {
159 const uint32_t length = split.length();
160 const uint32_t crc32 = folly::crc32(
161 reinterpret_cast<const uint8_t*>(split.data()), split.size());
162 auto ioBuf =
163 folly::IOBuf::create(sizeof(length) + split.size() + sizeof(crc32));
164 folly::io::Appender appender(ioBuf.get(), 0);
165 appender.writeLE(length);
166 appender.push(reinterpret_cast<const uint8_t*>(split.data()), length);
167 appender.writeLE(crc32);
168 return ioBuf;
169}
170
171void OperatorTraceSplitWriter::writeSummary() const {
172 const auto summaryFilePath = getOpTraceSummaryFilePath(traceDir_);

Callers 1

writeMethod · 0.45

Calls 6

lengthMethod · 0.80
crc32Function · 0.50
createFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected