MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / WriteRawBlock

Method WriteRawBlock

tensorflow/core/lib/io/table_builder.cc:201–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void TableBuilder::WriteRawBlock(const StringPiece& block_contents,
202 CompressionType type, BlockHandle* handle) {
203 Rep* r = rep_;
204 handle->set_offset(r->offset);
205 handle->set_size(block_contents.size());
206 r->status = r->file->Append(block_contents);
207 if (r->status.ok()) {
208 char trailer[kBlockTrailerSize];
209 trailer[0] = type;
210 uint32 crc = crc32c::Value(block_contents.data(), block_contents.size());
211 crc = crc32c::Extend(crc, trailer, 1); // Extend crc to cover block type
212 core::EncodeFixed32(trailer + 1, crc32c::Mask(crc));
213 r->status = r->file->Append(StringPiece(trailer, kBlockTrailerSize));
214 if (r->status.ok()) {
215 r->offset += block_contents.size() + kBlockTrailerSize;
216 }
217 }
218}
219
220Status TableBuilder::status() const { return rep_->status; }
221

Callers

nothing calls this directly

Calls 10

ExtendFunction · 0.85
EncodeFixed32Function · 0.85
MaskFunction · 0.85
set_offsetMethod · 0.80
ValueFunction · 0.50
set_sizeMethod · 0.45
sizeMethod · 0.45
AppendMethod · 0.45
okMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected