From 8dbe902a4d57487e3ef855d7fa6d9394483c4094 Mon Sep 17 00:00:00 2001 From: zilai Date: Mon, 25 Sep 2023 16:49:50 -0700 Subject: [PATCH] fix review comments --- src/lib/homestore/heap_chunk_selector.cpp | 4 ++-- src/lib/homestore/heap_chunk_selector.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/homestore/heap_chunk_selector.cpp b/src/lib/homestore/heap_chunk_selector.cpp index ccd1daf6..2d3cd6ca 100644 --- a/src/lib/homestore/heap_chunk_selector.cpp +++ b/src/lib/homestore/heap_chunk_selector.cpp @@ -118,10 +118,10 @@ void HeapChunkSelector::build_per_dev_chunk_heap(const std::unordered_set< chunk }; } -homestore::blk_alloc_hints HeapChunkSelector::get_blk_alloc_hints_on_same_pdev(chunk_num_t chunk_id) const { +homestore::blk_alloc_hints HeapChunkSelector::chunk_to_hints(chunk_num_t chunk_id) const { auto iter = m_chunks.find(chunk_id); if (iter == m_chunks.end()) { - LOGWARN("No chunk found for ChunkID {}, will return default blk alloc hints", chunk_id); + LOGWARNMOD(homeobject, "No chunk found for chunk_id {}, will return default blk alloc hints", chunk_id); return homestore::blk_alloc_hints(); } homestore::blk_alloc_hints hints; diff --git a/src/lib/homestore/heap_chunk_selector.h b/src/lib/homestore/heap_chunk_selector.h index 149d5110..2c104e62 100644 --- a/src/lib/homestore/heap_chunk_selector.h +++ b/src/lib/homestore/heap_chunk_selector.h @@ -1,5 +1,7 @@ #pragma once +#include "homeobject/common.hpp" + #include #include #include @@ -46,7 +48,7 @@ class HeapChunkSelector : public homestore::ChunkSelector { // this should be called after ShardManager is initialized and get all the open shards void build_per_dev_chunk_heap(const std::unordered_set< chunk_num_t >& excludingChunks); - homestore::blk_alloc_hints get_blk_alloc_hints_on_same_pdev(chunk_num_t chunk_id) const; + homestore::blk_alloc_hints chunk_to_hints(chunk_num_t chunk_id) const; private: std::unordered_map< uint32_t, std::shared_ptr< PerDevHeap > > m_per_dev_heap;