1#include <xrpld/app/rdb/Vacuum.h>
3#include <boost/format.hpp>
12 uintmax_t
const dbSize = file_size(dbPath);
14 dbSize !=
static_cast<uintmax_t
>(-1),
15 "ripple:doVacuumDB : file_size succeeded");
17 if (
auto available = space(dbPath.parent_path()).available;
20 std::cerr <<
"The database filesystem must have at least as "
21 "much free space as the size of "
22 << dbPath.string() <<
", which is " << dbSize
23 <<
" bytes. Only " <<
available <<
" bytes are available.\n";
29 auto& session = txnDB->getSession();
36 session <<
"PRAGMA page_size;", soci::into(pageSize);
42 setup.
globalPragma,
"ripple:doVacuumDB : non-null global pragma");
45 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