| 169 | } |
| 170 | |
| 171 | inline bool ParseInternalKey(const Slice& internal_key, |
| 172 | ParsedInternalKey* result) { |
| 173 | const size_t n = internal_key.size(); |
| 174 | if (n < 8) return false; |
| 175 | uint64_t num = DecodeFixed64(internal_key.data() + n - 8); |
| 176 | uint8_t c = num & 0xff; |
| 177 | result->sequence = num >> 8; |
| 178 | result->type = static_cast<ValueType>(c); |
| 179 | result->user_key = Slice(internal_key.data(), n - 8); |
| 180 | return (c <= static_cast<uint8_t>(kTypeValue)); |
| 181 | } |
| 182 | |
| 183 | // A helper class useful for DBImpl::Get() |
| 184 | class LookupKey { |