Decentralised Art Server
High-performance C++ backend that exposes HTML interface and a secure REST API for managing Performative Transactions entities
 
Loading...
Searching...
No Matches
dcn::events::SQLiteHotStore Class Referencefinal

#include <sqlite_hot_store.hpp>

Inheritance diagram for dcn::events::SQLiteHotStore:
dcn::events::IHotEventStore dcn::events::IArchiveManager

Public Member Functions

 SQLiteHotStore (const std::filesystem::path &hot_db_path, const std::filesystem::path &archive_root, const std::int64_t outbox_retention_ms, const int default_chain_id, std::string default_chain_namespace="eth")
 
 ~SQLiteHotStore () override
 
std::optional< std::int64_t > loadNextFromBlock (const int chain_id) override
 
std::optional< std::uint64_t > loadNextLocalSeq (const int chain_id)
 
bool saveNextLocalSeq (const int chain_id, const std::uint64_t next_seq, const std::int64_t now_ms)
 
std::vector< std::int64_t > loadReorgWindowBlocks (const int chain_id, const std::int64_t from_block, const std::int64_t to_block) const
 
bool ingestBatch (const int chain_id, const std::vector< RawChainLog > &raw_events, const std::vector< DecodedEvent > &decoded_events, const std::vector< ChainBlockInfo > &block_infos, const std::int64_t next_from_block, const std::int64_t now_ms, const std::optional< std::uint64_t > next_local_seq=std::nullopt) override
 
bool ingestBatch (const int chain_id, const std::vector< DecodedEvent > &events, const std::vector< ChainBlockInfo > &block_infos, const std::int64_t next_from_block, const std::int64_t now_ms)
 
bool applyFinality (const int chain_id, const FinalityHeights &heights, const std::int64_t now_ms, const std::size_t reorg_window_blocks) override
 
std::size_t projectBatch (const std::size_t limit, const std::int64_t now_ms) override
 
bool runArchiveCycle (const int chain_id, const std::size_t hot_window_days, const std::int64_t now_ms) override
 
bool runCycle (const int chain_id, const std::size_t hot_window_days, const std::int64_t now_ms) override
 
storage::sqlite::WalCheckpointStats checkpointWal (storage::sqlite::WalCheckpointMode mode)
 
FeedPage getFeedPage (const FeedQuery &query) const
 
StreamPage getStreamPage (const StreamQuery &query) const
 
std::int64_t minAvailableStreamSeq () const
 
- Public Member Functions inherited from dcn::events::IHotEventStore
virtual ~IHotEventStore ()=default
 
- Public Member Functions inherited from dcn::events::IArchiveManager
virtual ~IArchiveManager ()=default
 

Constructor & Destructor Documentation

◆ SQLiteHotStore()

dcn::events::SQLiteHotStore::SQLiteHotStore ( const std::filesystem::path &  hot_db_path,
const std::filesystem::path &  archive_root,
const std::int64_t  outbox_retention_ms,
const int  default_chain_id,
std::string  default_chain_namespace = "eth" 
)

◆ ~SQLiteHotStore()

dcn::events::SQLiteHotStore::~SQLiteHotStore ( )
override

Member Function Documentation

◆ applyFinality()

bool dcn::events::SQLiteHotStore::applyFinality ( const int  chain_id,
const FinalityHeights heights,
const std::int64_t  now_ms,
const std::size_t  reorg_window_blocks 
)
overridevirtual

◆ checkpointWal()

storage::sqlite::WalCheckpointStats dcn::events::SQLiteHotStore::checkpointWal ( storage::sqlite::WalCheckpointMode  mode)

◆ getFeedPage()

FeedPage dcn::events::SQLiteHotStore::getFeedPage ( const FeedQuery query) const

◆ getStreamPage()

StreamPage dcn::events::SQLiteHotStore::getStreamPage ( const StreamQuery query) const

◆ ingestBatch() [1/2]

bool dcn::events::SQLiteHotStore::ingestBatch ( const int  chain_id,
const std::vector< DecodedEvent > &  events,
const std::vector< ChainBlockInfo > &  block_infos,
const std::int64_t  next_from_block,
const std::int64_t  now_ms 
)

◆ ingestBatch() [2/2]

bool dcn::events::SQLiteHotStore::ingestBatch ( const int  chain_id,
const std::vector< RawChainLog > &  raw_events,
const std::vector< DecodedEvent > &  decoded_events,
const std::vector< ChainBlockInfo > &  block_infos,
const std::int64_t  next_from_block,
const std::int64_t  now_ms,
const std::optional< std::uint64_t >  next_local_seq = std::nullopt 
)
overridevirtual

◆ loadNextFromBlock()

std::optional< std::int64_t > dcn::events::SQLiteHotStore::loadNextFromBlock ( const int  chain_id)
overridevirtual

◆ loadNextLocalSeq()

std::optional< std::uint64_t > dcn::events::SQLiteHotStore::loadNextLocalSeq ( const int  chain_id)

◆ loadReorgWindowBlocks()

std::vector< std::int64_t > dcn::events::SQLiteHotStore::loadReorgWindowBlocks ( const int  chain_id,
const std::int64_t  from_block,
const std::int64_t  to_block 
) const

◆ minAvailableStreamSeq()

std::int64_t dcn::events::SQLiteHotStore::minAvailableStreamSeq ( ) const

◆ projectBatch()

std::size_t dcn::events::SQLiteHotStore::projectBatch ( const std::size_t  limit,
const std::int64_t  now_ms 
)
overridevirtual

◆ runArchiveCycle()

bool dcn::events::SQLiteHotStore::runArchiveCycle ( const int  chain_id,
const std::size_t  hot_window_days,
const std::int64_t  now_ms 
)
overridevirtual

◆ runCycle()

bool dcn::events::SQLiteHotStore::runCycle ( const int  chain_id,
const std::size_t  hot_window_days,
const std::int64_t  now_ms 
)
overridevirtual

◆ saveNextLocalSeq()

bool dcn::events::SQLiteHotStore::saveNextLocalSeq ( const int  chain_id,
const std::uint64_t  next_seq,
const std::int64_t  now_ms 
)

The documentation for this class was generated from the following files: