mirror of
https://github.com/matrix-construct/construct
synced 2024-09-30 04:38:52 +02:00
ircd::db: Wrap interface to toggle file deletions.
This commit is contained in:
parent
cfb80085a8
commit
1dc2daa5e9
2 changed files with 20 additions and 0 deletions
|
@ -27,6 +27,7 @@ namespace ircd::db
|
||||||
template<> prop_int property(const database &, const string_view &name);
|
template<> prop_int property(const database &, const string_view &name);
|
||||||
|
|
||||||
// Control panel
|
// Control panel
|
||||||
|
void fdeletions(database &, const bool &enable);
|
||||||
void checkpoint(database &, const string_view &dir);
|
void checkpoint(database &, const string_view &dir);
|
||||||
void flush(database &, const bool &blocking = true);
|
void flush(database &, const bool &blocking = true);
|
||||||
void sync(database &);
|
void sync(database &);
|
||||||
|
|
19
ircd/db.cc
19
ircd/db.cc
|
@ -164,6 +164,25 @@ ircd::db::checkpoint(database &d,
|
||||||
dir);
|
dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// This wraps RocksDB's "File Deletions" which means after RocksDB
|
||||||
|
/// compresses some file it then destroys the uncompressed version;
|
||||||
|
/// setting this to false will disable that and retain both versions.
|
||||||
|
/// This is useful when a direct reference is being manually held by
|
||||||
|
/// us into the uncompressed version which must remain valid.
|
||||||
|
void
|
||||||
|
ircd::db::fdeletions(database &d,
|
||||||
|
const bool &enable)
|
||||||
|
{
|
||||||
|
if(enable) throw_on_error
|
||||||
|
{
|
||||||
|
d.d->EnableFileDeletions(true)
|
||||||
|
};
|
||||||
|
else throw_on_error
|
||||||
|
{
|
||||||
|
d.d->DisableFileDeletions()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t
|
||||||
ircd::db::sequence(const database &cd)
|
ircd::db::sequence(const database &cd)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue