ClickHouse/src/IO/createReadBufferFromFileBase.h

33 lines
840 B
C++
Raw Normal View History

#pragma once
#include <IO/ReadBufferFromFileBase.h>
#include <string>
2016-06-25 04:29:09 +00:00
#include <memory>
namespace DB
{
2021-03-28 19:24:28 +00:00
class MMappedFileCache;
2017-05-28 14:29:40 +00:00
/** Create an object to read data from a file.
* estimated_size - the number of bytes to read
* aio_threshold - the minimum number of bytes for asynchronous reads
*
2017-05-28 14:29:40 +00:00
* If aio_threshold = 0 or estimated_size < aio_threshold, read operations are executed synchronously.
* Otherwise, the read operations are performed asynchronously.
*/
2018-09-04 19:34:34 +00:00
std::unique_ptr<ReadBufferFromFileBase> createReadBufferFromFileBase(
const std::string & filename_,
size_t estimated_size,
size_t aio_threshold,
size_t mmap_threshold,
2021-03-28 19:24:28 +00:00
MMappedFileCache * mmap_cache,
2018-09-04 19:34:34 +00:00
size_t buffer_size_ = DBMS_DEFAULT_BUFFER_SIZE,
int flags_ = -1,
char * existing_memory_ = nullptr,
size_t alignment = 0);
}