#pragma once #include namespace DB { class IBackup; using BackupPtr = std::shared_ptr; using BackupMutablePtr = std::shared_ptr; class IBackupEntry; using BackupEntryPtr = std::unique_ptr; using BackupEntries = std::vector>; using RestoreDataTask = std::function; using RestoreDataTasks = std::vector; using RestoreObjectTask = std::function; using RestoreObjectsTasks = std::vector; class Context; using ContextPtr = std::shared_ptr; using ContextMutablePtr = std::shared_ptr; /// Prepares backup entries. BackupEntries makeBackupEntries(const ASTBackupQuery::Elements & elements, const ContextPtr & context); /// Estimate total size of the backup which would be written from the specified entries. UInt64 estimateBackupSize(const BackupEntries & backup_entries, const BackupPtr & base_backup); /// Write backup entries to an opened backup. void writeBackupEntries(BackupMutablePtr backup, BackupEntries && backup_entries, size_t num_threads); /// Prepare restore tasks. RestoreObjectsTasks makeRestoreTasks(const ASTBackupQuery::Elements & elements, ContextMutablePtr context, const BackupPtr & backup); /// Execute restore tasks. void executeRestoreTasks(RestoreObjectsTasks && restore_tasks, size_t num_threads); }