diff --git a/src/Common/FileCache.h b/src/Common/FileCache.h index 4d2654d1491..f809f57f389 100644 --- a/src/Common/FileCache.h +++ b/src/Common/FileCache.h @@ -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; diff --git a/src/Common/IFileCachePriority.h b/src/Common/IFileCachePriority.h index 84e1a386d24..568b778d296 100644 --- a/src/Common/IFileCachePriority.h +++ b/src/Common/IFileCachePriority.h @@ -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 &) = 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 &) = 0; diff --git a/src/Common/LRUFileCachePriority.h b/src/Common/LRUFileCachePriority.h index bc9badc0af6..10ad21672dd 100644 --- a/src/Common/LRUFileCachePriority.h +++ b/src/Common/LRUFileCachePriority.h @@ -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: