20#include <xrpld/app/rdb/Vacuum.h>
21#include <boost/format.hpp>
30 uintmax_t
const dbSize = file_size(dbPath);
32 dbSize !=
static_cast<uintmax_t
>(-1),
33 "ripple:doVacuumDB : file_size succeeded");
35 if (
auto available = space(dbPath.parent_path()).available;
38 std::cerr <<
"The database filesystem must have at least as "
39 "much free space as the size of "
40 << dbPath.string() <<
", which is " << dbSize
41 <<
" bytes. Only " <<
available <<
" bytes are available.\n";
45 auto txnDB = std::make_unique<DatabaseCon>(
47 auto& session = txnDB->getSession();
54 session <<
"PRAGMA page_size;", soci::into(pageSize);
60 setup.
globalPragma,
"ripple:doVacuumDB : non-null global pragma");
63 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.
constexpr std::array< char const *, 8 > TxDBInit
constexpr char const * CommonDBPragmaTemp
bool doVacuumDB(DatabaseCon::Setup const &setup, beast::Journal j)
doVacuumDB Creates, initialises, and performs cleanup on a database.
boost::filesystem::path dataDir
static std::unique_ptr< std::vector< std::string > const > globalPragma
std::array< std::string, 4 > txPragma