2023-08-10 10:29:20 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Backups/BackupStatus.h>
|
2023-11-07 16:32:08 +00:00
|
|
|
#include <Common/ProfileEvents.h>
|
2023-08-10 10:29:20 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2023-08-30 15:52:43 +00:00
|
|
|
using BackupOperationID = String;
|
|
|
|
|
2023-08-10 10:29:20 +00:00
|
|
|
/// Information about executing a BACKUP or RESTORE operation
|
|
|
|
struct BackupOperationInfo
|
|
|
|
{
|
|
|
|
/// Operation ID, can be either passed via SETTINGS id=... or be randomly generated UUID.
|
2023-08-30 15:52:43 +00:00
|
|
|
BackupOperationID id;
|
2023-08-10 10:29:20 +00:00
|
|
|
|
|
|
|
/// Operation name, a string like "Disk('backups', 'my_backup')"
|
|
|
|
String name;
|
|
|
|
|
2023-12-23 03:08:50 +00:00
|
|
|
/// Base Backup Operation name, a string like "Disk('backups', 'my_base_backup')"
|
|
|
|
String base_backup_name;
|
|
|
|
|
2024-02-21 11:36:58 +00:00
|
|
|
/// Query ID of a query that started backup
|
|
|
|
String query_id;
|
|
|
|
|
2023-08-10 10:29:20 +00:00
|
|
|
/// This operation is internal and should not be shown in system.backups
|
|
|
|
bool internal = false;
|
|
|
|
|
|
|
|
/// Status of backup or restore operation.
|
|
|
|
BackupStatus status;
|
|
|
|
|
|
|
|
/// The number of files stored in the backup.
|
|
|
|
size_t num_files = 0;
|
|
|
|
|
|
|
|
/// The total size of files stored in the backup.
|
|
|
|
UInt64 total_size = 0;
|
|
|
|
|
|
|
|
/// The number of entries in the backup, i.e. the number of files inside the folder if the backup is stored as a folder.
|
|
|
|
size_t num_entries = 0;
|
|
|
|
|
|
|
|
/// The uncompressed size of the backup.
|
|
|
|
UInt64 uncompressed_size = 0;
|
|
|
|
|
|
|
|
/// The compressed size of the backup.
|
|
|
|
UInt64 compressed_size = 0;
|
|
|
|
|
|
|
|
/// Returns the number of files read during RESTORE from this backup.
|
|
|
|
size_t num_read_files = 0;
|
|
|
|
|
|
|
|
// Returns the total size of files read during RESTORE from this backup.
|
|
|
|
UInt64 num_read_bytes = 0;
|
|
|
|
|
|
|
|
/// Set only if there was an error.
|
|
|
|
std::exception_ptr exception;
|
|
|
|
String error_message;
|
|
|
|
|
2023-11-07 16:32:08 +00:00
|
|
|
/// Profile events collected during the backup.
|
|
|
|
std::shared_ptr<ProfileEvents::Counters::Snapshot> profile_counters = nullptr;
|
|
|
|
|
2023-08-10 10:29:20 +00:00
|
|
|
std::chrono::system_clock::time_point start_time;
|
|
|
|
std::chrono::system_clock::time_point end_time;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|