6#include "SqlBackup.hpp"
15namespace Lightweight::SqlBackup::detail
22class LIGHTWEIGHT_API RestoreFailureLog
32 void RecordRowFailure(std::string_view table,
33 std::string_view chunkPath,
34 std::uint64_t rowInChunk,
35 std::string_view sqlState,
36 std::string_view message,
37 std::string sampleKey);
43 void RecordNulledCell(std::string_view table, std::string_view column, std::string_view reason);
48 void RecordTableFailure(std::string_view table, std::string_view reason);
55 void SetFailedTableRowCount(std::string_view table, std::uint64_t missingRows);
59 void RecordUnreadableChunk(std::string_view table);
63 [[nodiscard]] TableRestoreReport TableSnapshot(std::string_view table)
const;
66 [[nodiscard]] RestoreReport Snapshot()
const;
71 TableRestoreReport report;
73 std::map<std::string, std::size_t, std::less<>> lastRangeOfChunk;
75 std::vector<std::string> reasonKeys;
76 std::map<std::string, std::size_t, std::less<>> columnIndex;
79 mutable std::mutex _mutex;
80 std::map<std::string, TableState, std::less<>> _tables;
81 std::uint64_t _unattributedChunkErrors {};
83 TableState& StateFor(std::string_view table);