| 120 | }; |
| 121 | |
| 122 | inline 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 | |
| 141 | void DBIter::Next() { |
| 142 | assert(valid_); |
nothing calls this directly
no test coverage detected