mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Update LRUFileCachePriority.cpp
This commit is contained in:
parent
9f2719b714
commit
7cbf77a178
@ -34,7 +34,7 @@ IFileCachePriority::WriteIterator LRUFileCachePriority::add(const Key & key, siz
|
|||||||
CurrentMetrics::add(CurrentMetrics::FilesystemCacheSize, size);
|
CurrentMetrics::add(CurrentMetrics::FilesystemCacheSize, size);
|
||||||
CurrentMetrics::add(CurrentMetrics::FilesystemCacheElements);
|
CurrentMetrics::add(CurrentMetrics::FilesystemCacheElements);
|
||||||
|
|
||||||
LOG_TRACE(log, "Added entry into LRU queue, key: {}, offset: {}", key.toString(), offset);
|
LOG_TEST(log, "Added entry into LRU queue, key: {}, offset: {}", key.toString(), offset);
|
||||||
|
|
||||||
return std::make_shared<LRUFileCacheIterator>(this, iter);
|
return std::make_shared<LRUFileCacheIterator>(this, iter);
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ void LRUFileCachePriority::removeAll(std::lock_guard<std::mutex> &)
|
|||||||
CurrentMetrics::sub(CurrentMetrics::FilesystemCacheSize, cache_size);
|
CurrentMetrics::sub(CurrentMetrics::FilesystemCacheSize, cache_size);
|
||||||
CurrentMetrics::sub(CurrentMetrics::FilesystemCacheElements, queue.size());
|
CurrentMetrics::sub(CurrentMetrics::FilesystemCacheElements, queue.size());
|
||||||
|
|
||||||
LOG_TRACE(log, "Removed all entries from LRU queue");
|
LOG_TEST(log, "Removed all entries from LRU queue");
|
||||||
|
|
||||||
queue.clear();
|
queue.clear();
|
||||||
cache_size = 0;
|
cache_size = 0;
|
||||||
@ -88,7 +88,7 @@ void LRUFileCachePriority::LRUFileCacheIterator::removeAndGetNext(std::lock_guar
|
|||||||
CurrentMetrics::sub(CurrentMetrics::FilesystemCacheSize, queue_iter->size);
|
CurrentMetrics::sub(CurrentMetrics::FilesystemCacheSize, queue_iter->size);
|
||||||
CurrentMetrics::sub(CurrentMetrics::FilesystemCacheElements);
|
CurrentMetrics::sub(CurrentMetrics::FilesystemCacheElements);
|
||||||
|
|
||||||
LOG_TRACE(cache_priority->log, "Removed entry from LRU queue, key: {}, offset: {}", queue_iter->key.toString(), queue_iter->offset);
|
LOG_TEST(cache_priority->log, "Removed entry from LRU queue, key: {}, offset: {}", queue_iter->key.toString(), queue_iter->offset);
|
||||||
|
|
||||||
queue_iter = cache_priority->queue.erase(queue_iter);
|
queue_iter = cache_priority->queue.erase(queue_iter);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user