Skip to content

Commit

Permalink
Clean up unnecessary parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
pdillinger committed Dec 19, 2024
1 parent 79b3f7c commit 86e5e2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
5 changes: 2 additions & 3 deletions db/compaction/compaction_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1442,9 +1442,8 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) {
// close the output files. Open file function is also passed, in case there's
// only range-dels, no file was opened, to save the range-dels, it need to
// create a new output file.
status = sub_compact->CloseCompactionFiles(
status, sub_compact->compaction->SupportsPerKeyPlacement(),
open_file_func, close_file_func);
status = sub_compact->CloseCompactionFiles(status, open_file_func,
close_file_func);

if (blob_file_builder) {
if (status.ok()) {
Expand Down
11 changes: 5 additions & 6 deletions db/compaction/subcompaction_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,21 +201,20 @@ class SubcompactionState {
// Close all compaction output files, both output_to_penultimate_level outputs
// and normal outputs.
Status CloseCompactionFiles(const Status& curr_status,
bool supports_per_key_placement,
const CompactionFileOpenFunc& open_file_func,
const CompactionFileCloseFunc& close_file_func) {
auto per_key = compaction->SupportsPerKeyPlacement();
// Call FinishCompactionOutputFile() even if status is not ok: it needs to
// close the output file.
// CloseOutput() may open new compaction output files.
is_current_penultimate_level_ = true;
Status s = penultimate_level_outputs_.CloseOutput(
curr_status,
supports_per_key_placement ? range_del_agg_.get() : nullptr,
open_file_func, close_file_func);
curr_status, per_key ? range_del_agg_.get() : nullptr, open_file_func,
close_file_func);
is_current_penultimate_level_ = false;
s = compaction_outputs_.CloseOutput(
s, supports_per_key_placement ? nullptr : range_del_agg_.get(),
open_file_func, close_file_func);
s, per_key ? nullptr : range_del_agg_.get(), open_file_func,
close_file_func);
return s;
}

Expand Down

0 comments on commit 86e5e2b

Please sign in to comment.