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

Method Finish

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

Source from the content-addressed store, hash-verified

220Status TableBuilder::status() const { return rep_->status; }
221
222Status TableBuilder::Finish() {
223 Rep* r = rep_;
224 Flush();
225 assert(!r->closed);
226 r->closed = true;
227
228 BlockHandle metaindex_block_handle, index_block_handle;
229
230 // Write metaindex block
231 if (ok()) {
232 BlockBuilder meta_index_block(&r->options);
233 // TODO(postrelease): Add stats and other meta blocks
234 WriteBlock(&meta_index_block, &metaindex_block_handle);
235 }
236
237 // Write index block
238 if (ok()) {
239 if (r->pending_index_entry) {
240 FindShortSuccessor(&r->last_key);
241 string handle_encoding;
242 r->pending_handle.EncodeTo(&handle_encoding);
243 r->index_block.Add(r->last_key, StringPiece(handle_encoding));
244 r->pending_index_entry = false;
245 }
246 WriteBlock(&r->index_block, &index_block_handle);
247 }
248
249 // Write footer
250 if (ok()) {
251 Footer footer;
252 footer.set_metaindex_handle(metaindex_block_handle);
253 footer.set_index_handle(index_block_handle);
254 string footer_encoding;
255 footer.EncodeTo(&footer_encoding);
256 r->status = r->file->Append(footer_encoding);
257 if (r->status.ok()) {
258 r->offset += footer_encoding.size();
259 }
260 }
261 return r->status;
262}
263
264void TableBuilder::Abandon() {
265 Rep* r = rep_;

Callers 12

mainFunction · 0.45
EncodeByFlatBufferFunction · 0.45
FlushMethod · 0.45
TestSinglePartitionMethod · 0.45
TestMultiPartitionMethod · 0.45
TestReadTensorSliceMethod · 0.45
DumpSsdMetaMethod · 0.45
WriteBlockMethod · 0.45
LOCKS_EXCLUDEDMethod · 0.45
~SummaryDbWriterMethod · 0.45
RemoveVariableFunction · 0.45

Calls 8

FindShortSuccessorFunction · 0.85
EncodeToMethod · 0.80
set_metaindex_handleMethod · 0.80
set_index_handleMethod · 0.80
AddMethod · 0.45
AppendMethod · 0.45
okMethod · 0.45
sizeMethod · 0.45

Tested by 4

EncodeByFlatBufferFunction · 0.36
TestSinglePartitionMethod · 0.36
TestMultiPartitionMethod · 0.36
TestReadTensorSliceMethod · 0.36