mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
c884cf901f
and use a BackupEntriesBatch for Memort engine to improve performance. A lot of minor corrections.
30 lines
707 B
C++
30 lines
707 B
C++
#pragma once
|
|
|
|
#include <Backups/IBackupEntry.h>
|
|
#include <mutex>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/// Helper class designed to generate multiple backup entries from one source.
|
|
class IBackupEntriesBatch : public std::enable_shared_from_this<IBackupEntriesBatch>
|
|
{
|
|
public:
|
|
BackupEntries getBackupEntries();
|
|
|
|
virtual ~IBackupEntriesBatch() = default;
|
|
|
|
protected:
|
|
IBackupEntriesBatch(const Strings & entry_names_) : entry_names(entry_names_) {}
|
|
|
|
virtual std::unique_ptr<ReadBuffer> getReadBuffer(size_t index) = 0;
|
|
virtual UInt64 getSize(size_t index) = 0;
|
|
virtual std::optional<UInt128> getChecksum(size_t) { return {}; }
|
|
|
|
private:
|
|
class BackupEntryFromBatch;
|
|
const Strings entry_names;
|
|
};
|
|
|
|
}
|