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

Method WriteRecord

tensorflow/core/lib/io/record_writer.cc:91–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91Status RecordWriter::WriteRecord(StringPiece data) {
92 if (dest_ == nullptr) {
93 return Status(::tensorflow::error::FAILED_PRECONDITION,
94 "Writer not initialized or previously closed");
95 }
96 // Format of a single record:
97 // uint64 length
98 // uint32 masked crc of length
99 // byte data[length]
100 // uint32 masked crc of data
101 char header[kHeaderSize];
102 char footer[kFooterSize];
103 PopulateHeader(header, data.data(), data.size());
104 PopulateFooter(footer, data.data(), data.size());
105 TF_RETURN_IF_ERROR(dest_->Append(StringPiece(header, sizeof(header))));
106 TF_RETURN_IF_ERROR(dest_->Append(data));
107 return dest_->Append(StringPiece(footer, sizeof(footer)));
108}
109
110#if defined(PLATFORM_GOOGLE)
111Status RecordWriter::WriteRecord(const absl::Cord& data) {

Callers 7

ComputeMethod · 0.45
VerifyFlushFunction · 0.45
TESTFunction · 0.45
WriteMethod · 0.45
TestNonSequentialReadsFunction · 0.45
TestReadErrorFunction · 0.45
WriteSerializedEventMethod · 0.45

Calls 4

StatusClass · 0.50
dataMethod · 0.45
sizeMethod · 0.45
AppendMethod · 0.45

Tested by 5

VerifyFlushFunction · 0.36
TESTFunction · 0.36
WriteMethod · 0.36
TestNonSequentialReadsFunction · 0.36
TestReadErrorFunction · 0.36