8#include <unordered_set>
22 const std::filesystem::path & feed_db_path,
23 const std::filesystem::path & archive_root,
24 std::int64_t outbox_retention_ms,
26 std::string default_chain_namespace =
"local");
37 bool runArchiveCycle(
int chain_id, std::size_t hot_window_days, std::int64_t now_ms)
override;
41 bool _initializeFeedSchema();
42 bool _initializeArchiveSchema(sqlite3 * archive_db)
const;
43 bool _exportMonth(
const int chain_id,
const std::string & month_token,
const std::int64_t now_ms);
44 std::vector<std::filesystem::path> _candidateArchivePaths(
const std::optional<CursorKey> & before_key)
const;
45 void _appendFeedRowsFromDatabase(
47 const char * table_name,
49 const std::optional<CursorKey> & before_key,
50 const std::size_t limit,
51 std::vector<FeedItem> & out_items,
52 std::unordered_set<std::string> & seen_feed_ids)
const;
55 std::filesystem::path _feed_db_path;
56 std::filesystem::path _archive_root;
57 std::int64_t _outbox_retention_ms = 0;
59 sqlite3 * _write_db =
nullptr;
60 sqlite3 * _read_db =
nullptr;
61 std::unique_ptr<events::IEventShardRouter> _shard_router;
63 int _default_chain_id = 1;
64 std::string _default_chain_namespace =
"local";
Definition feed_store.hpp:14
void setFeedCursor(std::int64_t last_change_seq) override
Definition sqlite_feed_store.cpp:1502
bool runArchiveCycle(int chain_id, std::size_t hot_window_days, std::int64_t now_ms) override
Definition sqlite_feed_store.cpp:404
StreamPage getStreamPage(const StreamQuery &query) const override
Definition sqlite_feed_store.cpp:637
std::int64_t minAvailableStreamSeq() const override
Definition sqlite_feed_store.cpp:742
void maintainOutbox(std::int64_t now_ms) override
Definition sqlite_feed_store.cpp:1520
storage::sqlite::WalCheckpointStats checkpointWal(storage::sqlite::WalCheckpointMode mode) override
Definition sqlite_feed_store.cpp:347
std::int64_t getFeedCursor() const override
Definition sqlite_feed_store.cpp:1482
FeedPage getFeedPage(const FeedQuery &query) const override
Definition sqlite_feed_store.cpp:535
~SqliteFeedStore() override
Definition sqlite_feed_store.cpp:329
void applyChange(const events::ChangeRecord &row, std::int64_t now_ms) override
Definition sqlite_feed_store.cpp:1606
SqliteFeedStore(const std::filesystem::path &feed_db_path, const std::filesystem::path &archive_root, std::int64_t outbox_retention_ms, int default_chain_id, std::string default_chain_namespace="local")
Definition sqlite_feed_store.cpp:228
WalCheckpointMode
Definition wal.hpp:9
Definition event_projector.hpp:38
Definition feed_types.hpp:57
Definition feed_types.hpp:49
Definition feed_types.hpp:81
Definition feed_types.hpp:64