0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-30 12:48:54 +02:00

ircd::db: Wrap interface to toggle file deletions.

This commit is contained in:
Jason Volk 2018-04-03 11:26:56 -07:00
parent cfb80085a8
commit 1dc2daa5e9
2 changed files with 20 additions and 0 deletions

View file

@ -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 &);

View file

@ -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)
{ {