Skip to content

Commit

Permalink
rename vars
Browse files Browse the repository at this point in the history
Signed-off-by: luohaha <[email protected]>
  • Loading branch information
luohaha committed Nov 18, 2024
1 parent c5517df commit 5df7939
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions be/src/storage/rowset/metadata_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ std::shared_ptr<MetadataCacheItem> MetadataCacheItemMgr::create_item(Rowset* ptr
// Get the map for the shard
auto& m = _rowset_maps[shard_id];
// Create a new MetadataCacheItem and insert it into the map
auto wrapper = std::make_shared<MetadataCacheItem>(ptr, uuid);
m[uuid] = wrapper;
auto item = std::make_shared<MetadataCacheItem>(ptr, uuid);
m[uuid] = item;
// Return the created MetadataCacheItem
return wrapper;
return item;
}

// Delete a MetadataCacheItem from the map based on the given UUID
Expand Down Expand Up @@ -102,11 +102,11 @@ void MetadataCache::_erase(const std::string& key) {
}

void MetadataCache::_cache_value_deleter(const CacheKey& /*key*/, void* value) {
MetadataCacheItem* wrapper_ptr = reinterpret_cast<MetadataCacheItem*>(value);
MetadataCacheItem* item_ptr = reinterpret_cast<MetadataCacheItem*>(value);
// close this rowset, release metadata memory
wrapper_ptr->close_rowset();
item_ptr->close_rowset();
// delete this item
MetadataCacheItemMgr::instance()->delete_item(wrapper_ptr->uuid());
MetadataCacheItemMgr::instance()->delete_item(item_ptr->uuid());
}

void MetadataCache::_warmup(const std::string& key) {
Expand Down
4 changes: 2 additions & 2 deletions be/src/storage/rowset/metadata_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MetadataCacheItem {
private:
std::mutex _lock;
Rowset* _ptr;
// UUID for this rowset wrapper
// UUID for this cache item
uint64_t _uuid = 0;
// Wheter this rowset is alive or not.
bool _alive = true;
Expand All @@ -63,7 +63,7 @@ class MetadataCacheItemMgr {
return &_s_instance;
}

// Build rowset wrapper by rowset pointer.
// Build cache item by rowset pointer.
std::shared_ptr<MetadataCacheItem> create_item(Rowset* ptr);
// Delete a MetadataCacheItem from the map based on the given UUID
void delete_item(uint64_t uuid);
Expand Down

0 comments on commit 5df7939

Please sign in to comment.