20 #ifndef RIPPLE_CORE_RELATIONALDBINTERFACE_SHARDS_H_INCLUDED
21 #define RIPPLE_CORE_RELATIONALDBINTERFACE_SHARDS_H_INCLUDED
23 #include <ripple/app/ledger/Ledger.h>
24 #include <ripple/app/rdb/RelationalDBInterface.h>
25 #include <ripple/core/Config.h>
26 #include <boost/filesystem.hpp>
145 soci::session& session,
std::unique_ptr< DatabaseCon > makeAcquireDB(DatabaseCon::Setup const &setup, DatabaseCon::CheckpointerSetup const &checkpointerSetup)
makeAcquireDB Opens shard acquire DB and returns its descriptor.
std::unique_ptr< DatabaseCon > transactionDb
std::pair< bool, AcquireShardSeqsHash > selectAcquireDBLedgerSeqsHash(soci::session &session, std::uint32_t index)
selectAcquireDBLedgerSeqsHash Returns set of acquired ledgers and hash for given shard.
void insertAcquireDBIndex(soci::session &session, std::uint32_t index)
insertAcquireDBIndex Adds new shard index to shard acquire DB.
std::unique_ptr< DatabaseCon > ledgerDb
void updateAcquireDB(soci::session &session, std::shared_ptr< Ledger const > const &ledger, std::uint32_t index, std::uint32_t lastSeq, std::optional< std::string > const &seqs)
updateAcquireDB Updates information in acquire DB.
void deleteFromArchiveDB(DatabaseCon &db, std::uint32_t shardIndex)
deleteFromArchiveDB Deletes entry from shard archive DB.
void dropArchiveDB(DatabaseCon &db)
dropArchiveDB Removes table in shard archive DB.
A generic endpoint for log messages.
bool updateLedgerDBs(soci::session &txsession, soci::session &lgrsession, std::shared_ptr< Ledger const > const &ledger, std::uint32_t index, std::atomic< bool > &stop, beast::Journal j)
updateLedgerDBs Save given ledger to shard databases.
std::optional< std::string > hash
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void readArchiveDB(DatabaseCon &db, std::function< void(std::string const &, int)> const &func)
readArchiveDB Read entries from shard archive database and calls fiven callback for each entry.
DatabasePair makeShardIncompleteLedgerDBs(Config const &config, DatabaseCon::Setup const &setup, DatabaseCon::CheckpointerSetup const &checkpointerSetup)
makeShardIncompleteLedgerDBs Opens shard databases for not fully downloaded or verified shard and ret...
void insertArchiveDB(DatabaseCon &db, std::uint32_t shardIndex, std::string const &url)
insertArchiveDB Adds entry to shard archive database.
std::pair< bool, std::optional< std::string > > selectAcquireDBLedgerSeqs(soci::session &session, std::uint32_t index)
selectAcquireDBLedgerSeqs Returns set of acquired ledgers for given shard.
std::unique_ptr< DatabaseCon > makeArchiveDB(boost::filesystem::path const &dir, std::string const &dbName)
makeArchiveDB Opens shard archive DB and returns its descriptor.
std::optional< std::string > sequences
DatabasePair makeShardCompleteLedgerDBs(Config const &config, DatabaseCon::Setup const &setup)
makeShardCompleteLedgerDBs Opens shard databases for already verified shard and returns its descripto...