| 61 | } |
| 62 | |
| 63 | void IDisk::copyFile( /// NOLINT |
| 64 | const String & from_file_path, |
| 65 | IDisk & to_disk, |
| 66 | const String & to_file_path, |
| 67 | const ReadSettings & read_settings, |
| 68 | const WriteSettings & write_settings, |
| 69 | const std::function<void()> & cancellation_hook |
| 70 | ) |
| 71 | { |
| 72 | LOG_DEBUG(getLogger("IDisk"), "Copying from {} (path: {}) {} to {} (path: {}) {}.", |
| 73 | getName(), getPath(), from_file_path, to_disk.getName(), to_disk.getPath(), to_file_path); |
| 74 | |
| 75 | auto in = readFile(from_file_path, read_settings); |
| 76 | auto out = to_disk.writeFile(to_file_path, DBMS_DEFAULT_BUFFER_SIZE, WriteMode::Rewrite, write_settings); |
| 77 | copyData(*in, *out, cancellation_hook); |
| 78 | out->finalize(); |
| 79 | } |
| 80 | |
| 81 | std::unique_ptr<ReadBufferFromFileBase> IDisk::readFile( |
| 82 | const String & path, |
no test coverage detected