#pragma once #include #include #include namespace DB { class MMapReadBufferFromFileWithCache : public ReadBufferFromFileBase { public: MMapReadBufferFromFileWithCache(MMappedFileCache & cache, const std::string & file_name, size_t offset, size_t length); /// Map till end of file. MMapReadBufferFromFileWithCache(MMappedFileCache & cache, const std::string & file_name, size_t offset); off_t getPosition() override; std::string getFileName() const override; off_t seek(off_t offset, int whence) override; private: MMappedFileCache::MappedPtr mapped; void init(); }; }