0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::db: Explicitly involve SST files in column compaction.

This commit is contained in:
Jason Volk 2018-04-20 16:48:07 -07:00
parent 6de7fb7b8c
commit ebea2e2385

View file

@ -3988,6 +3988,34 @@ ircd::db::compact(column &column,
{
d.d->CompactRange(opts, c, b, e)
};
rocksdb::ColumnFamilyMetaData cfmd;
d.d->GetColumnFamilyMetaData(c, &cfmd);
for(const auto &level : cfmd.levels)
{
if(level.files.empty())
continue;
std::vector<std::string> files(level.files.size());
std::transform(level.files.begin(), level.files.end(), files.begin(), []
(auto &metadata)
{
return std::move(metadata.name);
});
log.debug("'%s':'%s' COMPACT level:%d files:%zu size:%zu",
name(d),
name(c),
level.level,
level.files.size(),
level.size);
rocksdb::CompactionOptions opts;
throw_on_error
{
d.d->CompactFiles(opts, c, files, level.level)
};
}
}
void