Better name

This commit is contained in:
kssenii 2023-08-10 14:13:26 +02:00
parent 48fe9605a8
commit 3c26d51220
2 changed files with 6 additions and 6 deletions

View File

@ -265,7 +265,7 @@ void CacheMetadata::removeAllKeys(bool if_releasable)
bool removed_all = locked_key->removeAllFileSegments(if_releasable);
if (removed_all)
{
it = removeKeyImpl(it, *locked_key, lock);
it = removeEmptyKey(it, *locked_key, lock);
continue;
}
}
@ -297,10 +297,10 @@ void CacheMetadata::removeKey(const Key & key, bool if_exists, bool if_releasabl
bool removed_all = locked_key->removeAllFileSegments(if_releasable);
if (removed_all)
removeKeyImpl(it, *locked_key, metadata_lock);
removeEmptyKey(it, *locked_key, metadata_lock);
}
CacheMetadata::iterator CacheMetadata::removeKeyImpl(iterator it, LockedKey & locked_key, const CacheMetadataGuard::Lock &)
CacheMetadata::iterator CacheMetadata::removeEmptyKey(iterator it, LockedKey & locked_key, const CacheMetadataGuard::Lock &)
{
const auto & key = locked_key.getKey();
@ -407,7 +407,7 @@ void CacheMetadata::cleanupThreadFunc()
auto locked_key = it->second->lockNoStateCheck();
if (locked_key->getKeyState() == KeyMetadata::KeyState::REMOVING)
{
removeKeyImpl(it, *locked_key, lock);
removeEmptyKey(it, *locked_key, lock);
}
}
catch (...)

View File

@ -128,7 +128,7 @@ public:
/// Firstly, this cleanup does not delete cache files,
/// but only empty keys from cache_metadata_map and key (prefix) directories from fs.
/// Secondly, it deletes those only if arised as a result of
/// Secondly, it deletes those only if arose as a result of
/// (1) eviction in FileCache::tryReserve();
/// (2) removal of cancelled non-downloaded file segments after FileSegment::complete().
/// which does not include removal of cache files because of FileCache::removeKey/removeAllKeys,
@ -150,7 +150,7 @@ private:
Poco::Logger * log;
void downloadImpl(FileSegment & file_segment, std::optional<Memory<>> & memory);
iterator removeKeyImpl(iterator it, LockedKey &, const CacheMetadataGuard::Lock &);
iterator removeEmptyKey(iterator it, LockedKey &, const CacheMetadataGuard::Lock &);
};