MCPcopy Create free account
hub / github.com/ElementsProject/elements / FinishImpl

Method FinishImpl

src/leveldb/table/table_test.cc:217–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215 : Constructor(cmp), source_(nullptr), table_(nullptr) {}
216 ~TableConstructor() override { Reset(); }
217 Status FinishImpl(const Options& options, const KVMap& data) override {
218 Reset();
219 StringSink sink;
220 TableBuilder builder(options, &sink);
221
222 for (const auto& kvp : data) {
223 builder.Add(kvp.first, kvp.second);
224 ASSERT_TRUE(builder.status().ok());
225 }
226 Status s = builder.Finish();
227 ASSERT_TRUE(s.ok()) << s.ToString();
228
229 ASSERT_EQ(sink.contents().size(), builder.FileSize());
230
231 // Open the table
232 source_ = new StringSource(sink.contents());
233 Options table_options;
234 table_options.comparator = options.comparator;
235 return Table::Open(table_options, source_, sink.contents().size(), &table_);
236 }
237
238 Iterator* NewIterator() const override {
239 return table_->NewIterator(ReadOptions());

Callers

nothing calls this directly

Calls 6

AddMethod · 0.45
statusMethod · 0.45
FinishMethod · 0.45
ToStringMethod · 0.45
sizeMethod · 0.45
FileSizeMethod · 0.45

Tested by

no test coverage detected