Lines Matching refs:key

180   Slice key;  member
199 : key(k), value(v), deleter(del) {} in CacheHandle()
203 key = a.key; in operator =()
210 Slice key, size_t charge, in CalcTotalCharge()
217 malloc_usable_size(static_cast<void*>(const_cast<char*>(key.data()))); in CalcTotalCharge()
219 meta_charge += key.size(); in CalcTotalCharge()
227 return CalcTotalCharge(key, charge, metadata_charge_policy); in CalcTotalCharge()
233 Slice key; member
239 key = k; in CacheKey()
244 return a.hash_value == b.hash_value && a.key == b.key; in equal()
272 Status Insert(const Slice& key, uint32_t hash, void* value, size_t charge,
275 Cache::Handle* Lookup(const Slice& key, uint32_t hash) override;
282 void Erase(const Slice& key, uint32_t hash) override;
283 bool EraseAndConfirm(const Slice& key, uint32_t hash,
342 CacheHandle* Insert(const Slice& key, uint32_t hash, void* value,
391 (*handle.deleter)(handle.key, handle.value); in ~ClockCacheShard()
393 delete[] handle.key.data(); in ~ClockCacheShard()
428 context->to_delete_key.push_back(handle->key.data()); in RecycleHandle()
431 handle->key.clear(); in RecycleHandle()
441 (*handle.deleter)(handle.key, handle.value); in Cleanup()
444 for (const char* key : context.to_delete_key) { in Cleanup() local
445 delete[] key; in Cleanup()
514 table_.erase(CacheKey(handle->key, handle->hash)); in TryEvict()
564 CacheHandle* ClockCacheShard::Insert(const Slice& key, uint32_t hash, in Insert() argument
569 CacheHandle::CalcTotalCharge(key, charge, metadata_charge_policy_); in Insert()
574 context->to_delete_key.push_back(key.data()); in Insert()
576 context->to_delete_value.emplace_back(key, value, deleter); in Insert()
591 handle->key = key; in Insert()
599 if (table_.find(accessor, CacheKey(key, hash))) { in Insert()
604 table_.insert(HashTable::value_type(CacheKey(key, hash), handle)); in Insert()
612 Status ClockCacheShard::Insert(const Slice& key, uint32_t hash, void* value, in Insert() argument
618 char* key_data = new char[key.size()]; in Insert()
619 memcpy(key_data, key.data(), key.size()); in Insert()
620 Slice key_copy(key_data, key.size()); in Insert()
635 Cache::Handle* ClockCacheShard::Lookup(const Slice& key, uint32_t hash) { in Lookup() argument
637 if (!table_.find(accessor, CacheKey(key, hash))) { in Lookup()
650 if (hash != handle->hash || key != handle->key) { in Lookup()
665 erased = EraseAndConfirm(handle->key, handle->hash, &context); in Release()
671 void ClockCacheShard::Erase(const Slice& key, uint32_t hash) { in Erase() argument
673 EraseAndConfirm(key, hash, &context); in Erase()
677 bool ClockCacheShard::EraseAndConfirm(const Slice& key, uint32_t hash, in EraseAndConfirm() argument
682 if (table_.find(accessor, CacheKey(key, hash))) { in EraseAndConfirm()