0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

ircd::db: Distinguish range compact from files compact in interface.

This commit is contained in:
Jason Volk 2018-12-11 16:20:34 -08:00
parent 1906ac57b7
commit 8e11620100
3 changed files with 21 additions and 2 deletions

View file

@ -47,6 +47,7 @@ namespace ircd::db
uint64_t checkpoint(database &);
void resume(database &);
void check(database &);
void compact(database &, const int &level, const compactor & = {});
void compact(database &, const compactor & = {});
void sort(database &, const bool &blocking = true);
void flush(database &, const bool &sync = false);

View file

@ -436,7 +436,18 @@ ircd::db::compact(database &d,
{
db::column column{*c};
compact(column, range, -1, cb);
compact(column, -1, cb);
}
}
void
ircd::db::compact(database &d,
const int &level,
const compactor &cb)
{
for(const auto &c : d.columns)
{
db::column column{*c};
compact(column, level, cb);
}
}

View file

@ -1526,7 +1526,7 @@ try
const auto colname
{
param.at(1, "*"_sv)
param[1]
};
const auto level
@ -1539,6 +1539,13 @@ try
db::database::get(dbname)
};
if(!colname)
{
compact(database, level);
out << "done" << std::endl;
return true;
}
const auto compact_column{[&out, &database, &level]
(const string_view &colname)
{