mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
42226b1a96
* Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io" * Added setting "min_bytes_to_use_mmap_io": better error message * Added setting "min_bytes_to_use_mmap_io": fixed error
41 lines
734 B
C++
41 lines
734 B
C++
#pragma once
|
|
|
|
#include <Common/CurrentMetrics.h>
|
|
#include <IO/MMapReadBufferFromFileDescriptor.h>
|
|
|
|
|
|
namespace CurrentMetrics
|
|
{
|
|
extern const Metric OpenFileForRead;
|
|
}
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class MMapReadBufferFromFile : public MMapReadBufferFromFileDescriptor
|
|
{
|
|
public:
|
|
MMapReadBufferFromFile(const std::string & file_name_, size_t offset, size_t length_);
|
|
|
|
/// Map till end of file.
|
|
MMapReadBufferFromFile(const std::string & file_name_, size_t offset);
|
|
|
|
~MMapReadBufferFromFile() override;
|
|
|
|
void close();
|
|
|
|
std::string getFileName() const override;
|
|
|
|
private:
|
|
int fd = -1;
|
|
std::string file_name;
|
|
|
|
CurrentMetrics::Increment metric_increment{CurrentMetrics::OpenFileForRead};
|
|
|
|
void open();
|
|
};
|
|
|
|
}
|
|
|