Skip to content

Commit

Permalink
CR Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
udi-speedb committed Sep 23, 2023
1 parent b8073ac commit 4c3c246
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions db/column_family.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1665,14 +1665,14 @@ VersionStorageInfo* ColumnFamilyData::TEST_GetCurrentStorageInfo() {
return current_->storage_info();
}

int ColumnFamilyData::IsLastLevelWithData(int level) const {
bool ColumnFamilyData::IsLastLevelWithData(int level) const {
auto* vstorage = current_->storage_info();
assert(vstorage);

int last_level_with_data = vstorage->num_non_empty_levels() - 1;

auto is_last_level_with_data = false;
if ((level > 0) and (level == last_level_with_data)) {
if ((level > 0) && (level == last_level_with_data)) {
is_last_level_with_data = true;
}

Expand Down
2 changes: 1 addition & 1 deletion db/column_family.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ class ColumnFamilyData {
WriteStallCondition RecalculateWriteStallConditions(
const MutableCFOptions& mutable_cf_options);

int IsLastLevelWithData(int level) const;
bool IsLastLevelWithData(int level) const;

// REQUIREMENT: db mutex must be held
double TEST_CalculateWriteDelayDivider(
Expand Down
8 changes: 4 additions & 4 deletions db/table_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TableCache::TableCache(const ImmutableOptions& ioptions,
BlockCacheTracer* const block_cache_tracer,
const std::shared_ptr<IOTracer>& io_tracer,
const std::string& db_session_id,
IsLastLevelWithDataFunc is_last_leve_with_data_func)
IsLastLevelWithDataFunc is_last_level_with_data_func)
: ioptions_(ioptions),
file_options_(*file_options),
cache_(cache),
Expand All @@ -78,7 +78,7 @@ TableCache::TableCache(const ImmutableOptions& ioptions,
loader_mutex_(kLoadConcurency, kGetSliceNPHash64UnseededFnPtr),
io_tracer_(io_tracer),
db_session_id_(db_session_id),
is_last_leve_with_data_func_(is_last_leve_with_data_func) {
is_last_level_with_data_func_(is_last_level_with_data_func) {
if (ioptions_.row_cache) {
// If the same cache is shared by multiple instances, we need to
// disambiguate its entries.
Expand Down Expand Up @@ -141,8 +141,8 @@ Status TableCache::GetTableReader(
}

auto is_last_level_with_data = is_bottom;
if (is_last_leve_with_data_func_) {
is_last_level_with_data = is_last_leve_with_data_func_(level);
if (is_last_level_with_data_func_) {
is_last_level_with_data = is_last_level_with_data_func_(level);
}

TableReaderOptions table_reader_options(
Expand Down
4 changes: 2 additions & 2 deletions db/table_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class TableCache {
BlockCacheTracer* const block_cache_tracer,
const std::shared_ptr<IOTracer>& io_tracer,
const std::string& db_session_id,
IsLastLevelWithDataFunc is_last_leve_with_data_func = nullptr);
IsLastLevelWithDataFunc is_last_level_with_data_func = nullptr);
~TableCache();

// Cache interface for table cache
Expand Down Expand Up @@ -278,7 +278,7 @@ class TableCache {
std::shared_ptr<IOTracer> io_tracer_;
std::string db_session_id_;
Cache::ItemOwnerId cache_owner_id_ = Cache::kUnknownItemOwnerId;
IsLastLevelWithDataFunc is_last_leve_with_data_func_;
IsLastLevelWithDataFunc is_last_level_with_data_func_;
};

} // namespace ROCKSDB_NAMESPACE

0 comments on commit 4c3c246

Please sign in to comment.