0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 23:40:57 +01:00

ircd::db: Add util to get file list for specific column.

This commit is contained in:
Jason Volk 2018-09-20 15:56:46 -07:00
parent 8a514808f9
commit f80aaa7904
2 changed files with 23 additions and 0 deletions

View file

@ -19,6 +19,7 @@ namespace ircd::db
uint32_t id(const column &); uint32_t id(const column &);
const std::string &name(const column &); const std::string &name(const column &);
const descriptor &describe(const column &); const descriptor &describe(const column &);
std::vector<std::string> files(const column &);
size_t file_count(const column &); size_t file_count(const column &);
size_t bytes(const column &); size_t bytes(const column &);

View file

@ -7324,6 +7324,28 @@ ircd::db::describe(const column &column)
return describe(c); return describe(c);
} }
std::vector<std::string>
ircd::db::files(const column &column)
{
database::column &c(const_cast<db::column &>(column));
database &d(*c.d);
rocksdb::ColumnFamilyMetaData cfmd;
d.d->GetColumnFamilyMetaData(c, &cfmd);
size_t count(0);
for(const auto &level : cfmd.levels)
count += level.files.size();
std::vector<std::string> ret;
ret.reserve(count);
for(auto &level : cfmd.levels)
for(auto &file : level.files)
ret.emplace_back(std::move(file.name));
return ret;
}
void void
ircd::db::sort(column &column, ircd::db::sort(column &column,
const bool &blocking) const bool &blocking)