Sfoglia il codice sorgente

naive version which fails TEST LastLevelCompaction

naive_version
ArcueidType 3 settimane fa
parent
commit
9c689f2f8b
3 ha cambiato i file con 8 aggiunte e 6 eliminazioni
  1. +4
    -0
      db/db_impl.cc
  2. +1
    -1
      db/dbformat.h
  3. +3
    -5
      db/version_set.cc

+ 4
- 0
db/db_impl.cc Vedi File

@ -606,6 +606,10 @@ void DBImpl::TEST_CompactRange(int level, const Slice* begin,
InternalKey begin_storage, end_storage; InternalKey begin_storage, end_storage;
if (level == config::kNumLevels - 1) {
return;
}
ManualCompaction manual; ManualCompaction manual;
manual.level = level; manual.level = level;
manual.done = false; manual.done = false;

+ 1
- 1
db/dbformat.h Vedi File

@ -22,7 +22,7 @@ namespace leveldb {
// Grouping of constants. We may want to make some of these // Grouping of constants. We may want to make some of these
// parameters set via options. // parameters set via options.
namespace config { namespace config {
static const int kNumLevels = 7;
static const int kNumLevels = 3;
// Level-0 compaction is started when we hit this many files. // Level-0 compaction is started when we hit this many files.
static const int kL0_CompactionTrigger = 4; static const int kL0_CompactionTrigger = 4;

+ 3
- 5
db/version_set.cc Vedi File

@ -1104,13 +1104,11 @@ int VersionSet::NumLevelFiles(int level) const {
const char* VersionSet::LevelSummary(LevelSummaryStorage* scratch) const { const char* VersionSet::LevelSummary(LevelSummaryStorage* scratch) const {
// Update code if kNumLevels changes // Update code if kNumLevels changes
static_assert(config::kNumLevels == 7, "");
static_assert(config::kNumLevels == 3, "");
std::snprintf( std::snprintf(
scratch->buffer, sizeof(scratch->buffer), "files[ %d %d %d %d %d %d %d ]",
scratch->buffer, sizeof(scratch->buffer), "files[ %d %d %d ]",
int(current_->files_[0].size()), int(current_->files_[1].size()), int(current_->files_[0].size()), int(current_->files_[1].size()),
int(current_->files_[2].size()), int(current_->files_[3].size()),
int(current_->files_[4].size()), int(current_->files_[5].size()),
int(current_->files_[6].size()));
int(current_->files_[2].size()));
return scratch->buffer; return scratch->buffer;
} }

Caricamento…
Annulla
Salva