0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-01 05:08:59 +02:00

ircd::db: Add interface to get column and database options.

This commit is contained in:
Jason Volk 2018-12-12 09:57:46 -08:00
parent a133235f82
commit 41fd658b24
4 changed files with 23 additions and 0 deletions

View file

@ -22,6 +22,7 @@ namespace ircd::db
std::vector<std::string> files(const column &);
size_t file_count(const column &);
size_t bytes(const column &);
options getopt(const column &);
// Get property data of a db column. R can optionally be uint64_t for some
// values; we typedef that as prop_int for templating purposes. R can also

View file

@ -29,6 +29,7 @@ namespace ircd::db
std::vector<std::string> wals(const database &);
size_t file_count(const database &);
size_t bytes(const database &);
options getopt(const database &);
log::facility loglevel(const database &);
// Property information interface

View file

@ -22,6 +22,7 @@ namespace ircd::db
struct column;
struct index;
struct database;
struct options;
// Errors for the database subsystem. The exceptions that use _HIDENAME
// are built from RocksDB errors which already have an info string with

View file

@ -639,6 +639,15 @@ ircd::db::loglevel(const database &d)
}
}
ircd::db::options
ircd::db::getopt(const database &d)
{
return options
{
d.d->GetDBOptions()
};
}
size_t
ircd::db::bytes(const database &d)
{
@ -9018,6 +9027,17 @@ ircd::db::property(const column &column,
return ret;
}
ircd::db::options
ircd::db::getopt(const column &column)
{
database &d(const_cast<db::column &>(column));
database::column &c(const_cast<db::column &>(column));
return options
{
static_cast<rocksdb::ColumnFamilyOptions>(d.d->GetOptions(c))
};
}
size_t
ircd::db::bytes(const column &column)
{