diff --git a/be/src/storage/rowset/metadata_cache.cpp b/be/src/storage/rowset/metadata_cache.cpp index beec84ed47f10..818edaa94ca0b 100644 --- a/be/src/storage/rowset/metadata_cache.cpp +++ b/be/src/storage/rowset/metadata_cache.cpp @@ -42,10 +42,10 @@ std::shared_ptr 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(ptr, uuid); - m[uuid] = wrapper; + auto item = std::make_shared(ptr, uuid); + m[uuid] = item; // Return the created MetadataCacheItem - return wrapper; + return item; } // Delete a MetadataCacheItem from the map based on the given UUID @@ -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(value); + MetadataCacheItem* item_ptr = reinterpret_cast(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) { diff --git a/be/src/storage/rowset/metadata_cache.h b/be/src/storage/rowset/metadata_cache.h index 65477f7ba7b4f..bd13fb161999d 100644 --- a/be/src/storage/rowset/metadata_cache.h +++ b/be/src/storage/rowset/metadata_cache.h @@ -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; @@ -63,7 +63,7 @@ class MetadataCacheItemMgr { return &_s_instance; } - // Build rowset wrapper by rowset pointer. + // Build cache item by rowset pointer. std::shared_ptr create_item(Rowset* ptr); // Delete a MetadataCacheItem from the map based on the given UUID void delete_item(uint64_t uuid);