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

Method ParseKey

src/leveldb/db/db_iter.cc:122–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120};
121
122inline bool DBIter::ParseKey(ParsedInternalKey* ikey) {
123 Slice k = iter_->key();
124
125 size_t bytes_read = k.size() + iter_->value().size();
126 while (bytes_until_read_sampling_ < bytes_read) {
127 bytes_until_read_sampling_ += RandomCompactionPeriod();
128 db_->RecordReadSample(k);
129 }
130 assert(bytes_until_read_sampling_ >= bytes_read);
131 bytes_until_read_sampling_ -= bytes_read;
132
133 if (!ParseInternalKey(k, ikey)) {
134 status_ = Status::Corruption("corrupted internal key in DBIter");
135 return false;
136 } else {
137 return true;
138 }
139}
140
141void DBIter::Next() {
142 assert(valid_);

Callers

nothing calls this directly

Calls 6

ParseInternalKeyFunction · 0.85
CorruptionFunction · 0.85
keyMethod · 0.45
sizeMethod · 0.45
valueMethod · 0.45
RecordReadSampleMethod · 0.45

Tested by

no test coverage detected