ClickHouse/src/Interpreters/BackupLog.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.2 KiB
C++
Raw Normal View History

2023-08-10 12:46:04 +00:00
#pragma once
#include <Interpreters/SystemLog.h>
#include <Core/NamesAndTypes.h>
#include <Core/NamesAndAliases.h>
#include <Backups/BackupOperationInfo.h>
#include <Storages/ColumnsDescription.h>
2023-08-10 12:46:04 +00:00
namespace DB
{
/** A struct which will be inserted as row into backup_log table.
* Contains a record about backup or restore operation.
*/
struct BackupLogElement
{
BackupLogElement() = default;
2024-02-29 14:56:33 +00:00
explicit BackupLogElement(BackupOperationInfo info_);
2023-08-10 12:46:04 +00:00
BackupLogElement(const BackupLogElement &) = default;
BackupLogElement & operator=(const BackupLogElement &) = default;
BackupLogElement(BackupLogElement &&) = default;
BackupLogElement & operator=(BackupLogElement &&) = default;
std::chrono::system_clock::time_point event_time{};
Decimal64 event_time_usec{};
2024-03-14 12:16:33 +00:00
BackupOperationInfo info{}; /// NOLINT(bugprone-throw-keyword-missing)
2023-08-10 12:46:04 +00:00
static std::string name() { return "BackupLog"; }
static ColumnsDescription getColumnsDescription();
2023-08-10 12:46:04 +00:00
static NamesAndAliases getNamesAndAliases() { return {}; }
void appendToBlock(MutableColumns & columns) const;
};
class BackupLog : public SystemLog<BackupLogElement>
{
using SystemLog<BackupLogElement>::SystemLog;
};
}