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

Function ParseInternalKey

src/leveldb/db/dbformat.h:171–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171inline 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()
184class LookupKey {

Callers 12

keyMethod · 0.85
TestKeyFunction · 0.85
DumpInternalIterFunction · 0.85
ParseKeyMethod · 0.85
PrintContentsFunction · 0.85
AllEntriesForMethod · 0.85
DoCompactionWorkMethod · 0.85
ScanTableMethod · 0.85
DumpTableFunction · 0.85
SaveValueFunction · 0.85
RecordReadSampleMethod · 0.85
DebugStringMethod · 0.85

Calls 4

DecodeFixed64Function · 0.85
SliceClass · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by 4

keyMethod · 0.68
TestKeyFunction · 0.68
PrintContentsFunction · 0.68
AllEntriesForMethod · 0.68