| 1 | #pragma once |
| 2 | |
| 3 | #include <IO/WriteBufferFromFileBase.h> |
| 4 | #include <string> |
| 5 | #include <memory> |
| 6 | |
| 7 | |
| 8 | namespace DB |
| 9 | { |
| 10 | |
| 11 | /** Create an object to write data to a file. |
| 12 | * estimated_size - number of bytes to write |
| 13 | * aio_threshold - the minimum number of bytes for asynchronous writes |
| 14 | * |
| 15 | * If aio_threshold = 0 or estimated_size < aio_threshold, the write operations are executed synchronously. |
| 16 | * Otherwise, write operations are performed asynchronously. |
| 17 | */ |
| 18 | std::unique_ptr<WriteBufferFromFileBase> createWriteBufferFromFileBase( |
| 19 | const std::string & filename_, |
| 20 | size_t estimated_size, |
| 21 | size_t aio_threshold, |
| 22 | size_t buffer_size_ = DBMS_DEFAULT_BUFFER_SIZE, |
| 23 | int flags_ = -1, |
| 24 | mode_t mode = 0666, |
| 25 | char * existing_memory_ = nullptr, |
| 26 | size_t alignment = 0); |
| 27 | |
| 28 | } |
| 29 | |