This commit is contained in:
KinderRiven 2022-06-28 03:50:44 +08:00 committed by KinderRiven
parent 081cd4938a
commit 61b580aba4
3 changed files with 7 additions and 5 deletions

View File

@ -22,9 +22,8 @@
namespace DB
{
/**
* Local cache for remote filesystem files, represented as a set of non-overlapping non-empty file segments.
*/
/// Local cache for remote filesystem files, represented as a set of non-overlapping non-empty file segments.
/// Different caching algorithms are implemented based on IFileCachePriority.
class FileCache : private boost::noncopyable
{
friend class FileSegment;

View File

@ -61,6 +61,7 @@ public:
virtual size_t hits() const = 0;
/// Point the iterator to the next higher priority cache record.
virtual void next() const = 0;
virtual bool valid() const = 0;
@ -72,6 +73,8 @@ public:
/// Deletes an existing cached record.
virtual void remove(std::lock_guard<std::mutex> &) = 0;
/// Get an iterator to handle write operations. Write iterators should only
/// be allowed to call remove, use and incrementSize methods.
virtual WriteIterator getWriteIterator() const = 0;
virtual void incrementSize(size_t, std::lock_guard<std::mutex> &) = 0;

View File

@ -5,8 +5,8 @@
namespace DB
{
/// Based on the LRU algorithm implementation, the data with the lowest priority is stored at
/// the head of the queue, and the data with the highest priority is stored at the tail.
/// Based on the LRU algorithm implementation, the record with the lowest priority is stored at
/// the head of the queue, and the record with the highest priority is stored at the tail.
class LRUFileCachePriority : public IFileCachePriority
{
public: