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

Method ReadMeta

src/leveldb/table/table.cc:84–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void Table::ReadMeta(const Footer& footer) {
85 if (rep_->options.filter_policy == nullptr) {
86 return; // Do not need any metadata
87 }
88
89 // TODO(sanjay): Skip this if footer.metaindex_handle() size indicates
90 // it is an empty block.
91 ReadOptions opt;
92 if (rep_->options.paranoid_checks) {
93 opt.verify_checksums = true;
94 }
95 BlockContents contents;
96 if (!ReadBlock(rep_->file, opt, footer.metaindex_handle(), &contents).ok()) {
97 // Do not propagate errors since meta info is not needed for operation
98 return;
99 }
100 Block* meta = new Block(contents);
101
102 Iterator* iter = meta->NewIterator(BytewiseComparator());
103 std::string key = "filter.";
104 key.append(rep_->options.filter_policy->Name());
105 iter->Seek(key);
106 if (iter->Valid() && iter->key() == Slice(key)) {
107 ReadFilter(iter->value());
108 }
109 delete iter;
110 delete meta;
111}
112
113void Table::ReadFilter(const Slice& filter_handle_value) {
114 Slice v = filter_handle_value;

Callers 1

OpenMethod · 0.80

Calls 9

ReadBlockFunction · 0.85
BytewiseComparatorFunction · 0.85
SliceClass · 0.50
NewIteratorMethod · 0.45
NameMethod · 0.45
SeekMethod · 0.45
ValidMethod · 0.45
keyMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected