2015-03-30 22:10:59 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <IO/ReadBufferFromFileBase.h>
|
2015-03-30 22:10:59 +00:00
|
|
|
#include <string>
|
2016-06-25 04:29:09 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2015-03-30 22:10:59 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
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
|
2015-04-14 11:35:10 +00:00
|
|
|
*
|
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.
|
2015-04-14 11:35:10 +00:00
|
|
|
*/
|
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,
|
2020-01-04 05:46:50 +00:00
|
|
|
size_t mmap_threshold,
|
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);
|
2015-03-30 22:10:59 +00:00
|
|
|
|
|
|
|
}
|