MCPcopy Create free account
hub / github.com/facebook/CacheLib / writeEntryDescAndKey

Method writeEntryDescAndKey

cachelib/navy/block_cache/BlockCache.cpp:1305–1318  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

1303}
1304
1305/* static */ BlockCache::EntryDesc* BlockCache::writeEntryDescAndKey(
1306 MutableBufferView buffer,
1307 const HashedKey& hk,
1308 uint32_t valueSize,
1309 uint32_t lastAccessTimeSecs) {
1310 // Copy descriptor and the key to the end
1311 const auto& key = hk.key();
1312 uint8_t* dest = buffer.data() + buffer.size() - sizeof(EntryDesc);
1313 auto desc = new (dest)
1314 EntryDesc(static_cast<uint32_t>(key.size()), valueSize, hk.keyHash(),
1315 lastAccessTimeSecs); // desc
1316 std::memcpy(dest - key.size(), key.data(), key.size()); // key
1317 return desc;
1318}
1319
1320void BlockCache::writeEntry(MutableBufferView buffer,
1321 std::optional<HashedKey> hk,

Callers

nothing calls this directly

Calls 4

keyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
keyHashMethod · 0.45

Tested by

no test coverage detected