mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 21:12:28 +00:00
30 lines
703 B
C++
30 lines
703 B
C++
#pragma once
|
|
|
|
#include <IO/ReadBufferFromFileBase.h>
|
|
#include <IO/MMappedFileCache.h>
|
|
#include <IO/MMapReadBufferFromFileDescriptor.h>
|
|
|
|
|
|
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();
|
|
};
|
|
|
|
}
|