diff --git a/db/hints/internal/hint_storage.cc b/db/hints/internal/hint_storage.cc index 6bb67aa7b4..6b81500ec7 100644 --- a/db/hints/internal/hint_storage.cc +++ b/db/hints/internal/hint_storage.cc @@ -260,16 +260,16 @@ future<> remove_irrelevant_shards_directories(const fs::path& hint_directory) { } // anonymous namespace -future<> rebalance(fs::path hints_directory) { +future<> rebalance_hints(fs::path hint_directory) { // Scan currently present hint segments. - hints_segments_map current_hints_segments = co_await get_current_hints_segments(hints_directory); + hints_segments_map current_hints_segments = co_await get_current_hints_segments(hint_directory); // Move segments to achieve an even distribution of files among all present shards. - co_await rebalance_segments(hints_directory, current_hints_segments); + co_await rebalance_segments(hint_directory, current_hints_segments); // Remove the directories of shards that are not present anymore. // They should not have any segments by now. - co_await remove_irrelevant_shards_directories(hints_directory); + co_await remove_irrelevant_shards_directories(hint_directory); } } // namespace internal diff --git a/db/hints/internal/hint_storage.hh b/db/hints/internal/hint_storage.hh index fb869b83aa..384a7ba565 100644 --- a/db/hints/internal/hint_storage.hh +++ b/db/hints/internal/hint_storage.hh @@ -32,18 +32,19 @@ using hint_entry_reader = commitlog_entry_reader; /// \brief Rebalance hints segments among all present shards. /// -/// The difference between the number of segments on every two shard will be not greater than 1 after the -/// rebalancing. +/// The difference between the number of segments on every two shard will not be +/// greater than 1 after the rebalancing. /// -/// Removes the sub-directories of \ref hints_directory that correspond to shards that are not relevant any more -/// (re-sharding to a lower shards number case). +/// Removes the subdirectories of \ref hint_directory that correspond to shards that +/// are not relevant anymore (in the case of re-sharding to a lower shard number). /// -/// Complexity: O(N+K), where N is a total number of present hints' segments and -/// K = * +/// Complexity: O(N+K), where N is a total number of present hint segments and +/// K = * /// -/// \param hints_directory A hints directory to rebalance +/// \param hint_directory A hint directory to rebalance /// \return A future that resolves when the operation is complete. -future<> rebalance(std::filesystem::path hints_directory); +future<> rebalance_hints(std::filesystem::path hint_directory); } // namespace internal } // namespace db::hints diff --git a/db/hints/manager.cc b/db/hints/manager.cc index 35c88eff81..1efb5467d8 100644 --- a/db/hints/manager.cc +++ b/db/hints/manager.cc @@ -452,7 +452,7 @@ public: return with_semaphore(_lock, 1, [this] () { manager_logger.debug("Rebalancing hints in {}", _hints_directory); - return rebalance(fs::path{_hints_directory}).then([this] { + return rebalance_hints(fs::path{_hints_directory}).then([this] { _state = state::rebalanced; }); });