1#include <xrpl/server/Vacuum.h>
3#include <xrpl/beast/utility/Journal.h>
4#include <xrpl/beast/utility/instrumentation.h>
5#include <xrpl/rdb/DBInit.h>
6#include <xrpl/rdb/DatabaseCon.h>
23 XRPL_ASSERT(dbSize !=
static_cast<uintmax_t
>(-1),
"xrpl::doVacuumDB : file_size succeeded");
27 std::cerr <<
"The database filesystem must have at least as "
28 "much free space as the size of "
29 << dbPath.
string() <<
", which is " << dbSize <<
" bytes. Only " << available
30 <<
" bytes are available.\n";
35 auto& session = txnDB->getSession();
42 session <<
"PRAGMA page_size;", soci::into(pageSize);
47 XRPL_ASSERT(setup.
globalPragma,
"xrpl::doVacuumDB : non-null global pragma");
50 session <<
"PRAGMA page_size;", soci::into(pageSize);
A generic endpoint for log messages.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool doVacuumDB(DatabaseCon::Setup const &setup, beast::Journal j)
doVacuumDB Creates, initialises, and performs cleanup on a database.
constexpr std::array< char const *, 8 > kTxDbInit
std::string commonDbPragmaTemp(std::string_view tempStore)
std::array< std::string, 4 > txPragma
static std::unique_ptr< std::vector< std::string > const > globalPragma
std::filesystem::path dataDir