mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
cleanup: Remove unused PerformDeletion()
overloads (#2418)
This commit is contained in:
parent
078db5caae
commit
f4c1e33d48
1 changed files with 0 additions and 64 deletions
|
@ -60,70 +60,6 @@ void AccountObjectMemory(string_view key, unsigned type, int64_t size, DbTable*
|
|||
}
|
||||
}
|
||||
|
||||
void PerformDeletion(PrimeIterator del_it, ExpireIterator exp_it, EngineShard* shard,
|
||||
DbTable* table) {
|
||||
if (!exp_it.is_done()) {
|
||||
table->expire.Erase(exp_it);
|
||||
}
|
||||
|
||||
if (del_it->second.HasFlag()) {
|
||||
if (table->mcflag.Erase(del_it->first) == 0) {
|
||||
LOG(ERROR) << "Internal error, inconsistent state, mcflag should be present but not found "
|
||||
<< del_it->first.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
DbTableStats& stats = table->stats;
|
||||
const PrimeValue& pv = del_it->second;
|
||||
if (pv.IsExternal()) {
|
||||
auto [offset, size] = pv.GetExternalSlice();
|
||||
|
||||
stats.tiered_entries--;
|
||||
stats.tiered_size -= size;
|
||||
TieredStorage* tiered = shard->tiered_storage();
|
||||
tiered->Free(offset, size);
|
||||
}
|
||||
if (pv.HasIoPending()) {
|
||||
TieredStorage* tiered = shard->tiered_storage();
|
||||
tiered->CancelIo(table->index, del_it);
|
||||
}
|
||||
|
||||
stats.inline_keys -= del_it->first.IsInline();
|
||||
|
||||
{
|
||||
string tmp;
|
||||
string_view key = del_it->first.GetSlice(&tmp);
|
||||
AccountObjectMemory(key, del_it->first.ObjType(), -del_it->first.MallocUsed(), table); // Key
|
||||
AccountObjectMemory(key, del_it->second.ObjType(), -del_it->second.MallocUsed(),
|
||||
table); // Value
|
||||
}
|
||||
|
||||
if (pv.ObjType() == OBJ_HASH && pv.Encoding() == kEncodingListPack) {
|
||||
--stats.listpack_blob_cnt;
|
||||
} else if (pv.ObjType() == OBJ_ZSET && pv.Encoding() == OBJ_ENCODING_LISTPACK) {
|
||||
--stats.listpack_blob_cnt;
|
||||
}
|
||||
|
||||
if (ClusterConfig::IsEnabled()) {
|
||||
string tmp;
|
||||
string_view key = del_it->first.GetSlice(&tmp);
|
||||
SlotId sid = ClusterConfig::KeySlot(key);
|
||||
table->slots_stats[sid].key_count -= 1;
|
||||
}
|
||||
|
||||
table->prime.Erase(del_it);
|
||||
}
|
||||
|
||||
inline void PerformDeletion(PrimeIterator del_it, EngineShard* shard, DbTable* table) {
|
||||
ExpireIterator exp_it;
|
||||
if (del_it->second.HasExpire()) {
|
||||
exp_it = table->expire.Find(del_it->first);
|
||||
DCHECK(!exp_it.is_done());
|
||||
}
|
||||
|
||||
PerformDeletion(del_it, exp_it, shard, table);
|
||||
};
|
||||
|
||||
class PrimeEvictionPolicy {
|
||||
public:
|
||||
static constexpr bool can_evict = true; // we implement eviction functionality.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue