Skip to content

Commit

Permalink
Remove unused variable: number_of_files_to_sort_ (#13259)
Browse files Browse the repository at this point in the history
Summary:
This variable is not used, the one actually being used is `kNumberFilesToSort`.
https://github.com/facebook/rocksdb/blob/02b4197544f758bdf84d80fe9319238611848c48/db/version_set.h#L544-L549

Pull Request resolved: #13259

Reviewed By: archang19

Differential Revision: D67765254

Pulled By: cbi42

fbshipit-source-id: 3c32b0396d0ba9e08e77b96b098e6c26d0bf8aac
  • Loading branch information
jonahgao authored and facebook-github-bot committed Jan 2, 2025
1 parent 601a6b5 commit 00a3eb6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4085,7 +4085,7 @@ void VersionStorageInfo::UpdateFilesByCompactionPri(
temp[i].file = files[i];
}

// sort the top number_of_files_to_sort_ based on file size
// sort the top kNumberFilesToSort based on file size
size_t num = VersionStorageInfo::kNumberFilesToSort;
if (num > temp.size()) {
num = temp.size();
Expand Down
7 changes: 0 additions & 7 deletions db/version_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,6 @@ class VersionStorageInfo {
// file that is not yet compacted
std::vector<int> next_file_to_compact_by_size_;

// Only the first few entries of files_by_compaction_pri_ are sorted.
// There is no need to sort all the files because it is likely
// that on a running system, we need to look at only the first
// few largest files because a new version is created every few
// seconds/minutes (because of concurrent compactions).
static const size_t number_of_files_to_sort_ = 50;

// This vector contains list of files marked for compaction and also not
// currently being compacted. It is protected by DB mutex. It is calculated in
// ComputeCompactionScore(). Used by Leveled and Universal Compaction.
Expand Down

0 comments on commit 00a3eb6

Please sign in to comment.