static
| 155 | |
| 156 | // static |
| 157 | std::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 | |
| 171 | void OperatorTraceSplitWriter::writeSummary() const { |
| 172 | const auto summaryFilePath = getOpTraceSummaryFilePath(traceDir_); |