void LevelDBStorageProcess::initialize() { leveldb::Options options; options.create_if_missing = true; leveldb::Status status = leveldb::DB::Open(options, path, &db); if (!status.ok()) { // TODO(benh): Consider trying to repair the DB. error = status.ToString(); } else { // TODO(benh): Conditionally compact to avoid long recovery times? db->CompactRange(NULL, NULL); } }
void Compact() { db->CompactRange(NULL,NULL); }