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

Method FinishImpl

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

Source from the content-addressed store, hash-verified

220 TableConstructor() : source_(nullptr), table_(nullptr) {}
221 ~TableConstructor() override { Reset(); }
222 Status FinishImpl(const Options& options, const KVMap& data) override {
223 Reset();
224 StringSink sink;
225 TableBuilder builder(options, &sink);
226
227 for (KVMap::const_iterator it = data.begin(); it != data.end(); ++it) {
228 builder.Add(it->first, it->second);
229 TF_CHECK_OK(builder.status());
230 }
231 Status s = builder.Finish();
232 TF_CHECK_OK(s) << s.ToString();
233
234 CHECK_EQ(sink.contents().size(), builder.FileSize());
235
236 // Open the table
237 source_ = new StringSource(sink.contents());
238 Options table_options;
239 return Table::Open(table_options, source_, sink.contents().size(), &table_);
240 }
241
242 Iterator* NewIterator() const override { return table_->NewIterator(); }
243

Callers

nothing calls this directly

Calls 10

FileSizeMethod · 0.80
ResetFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
AddMethod · 0.45
statusMethod · 0.45
FinishMethod · 0.45
ToStringMethod · 0.45
sizeMethod · 0.45
contentsMethod · 0.45

Tested by

no test coverage detected