in glean/rocksdb/rocksdb.cpp [438:470]
explicit DatabaseImpl(ContainerImpl c, Id start, int64_t version)
: container_(std::move(c)) {
starting_id = Id::fromWord(getAdminValue(
AdminId::STARTING_ID,
start.toWord(),
container_.mode == Mode::Create,
[]{}));
next_id = Id::fromWord(getAdminValue(
AdminId::NEXT_ID,
start.toWord(),
container_.mode == Mode::Create,
[mode = container_.mode] {
if (mode != Mode::Create) {
rts::error("corrupt database - missing NEXT_ID");
}
}));
db_version = getAdminValue(
AdminId::VERSION,
version,
container_.mode == Mode::Create,
[]{});
if (db_version != version) {
rts::error("unexpected database version {}", db_version);
}
stats_.set(loadStats());
ownership_unit_counters = loadOwnershipUnitCounters();
ownership_derived_counters = loadOwnershipDerivedCounters();
usets_ = loadOwnershipSets();
}