Skip to content

Commit

Permalink
Add SstPartitioner::Context::target_output_file_size
Browse files Browse the repository at this point in the history
  • Loading branch information
rockeet committed May 7, 2023
1 parent e508e6e commit e1bb138
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions db/compaction/compaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ std::unique_ptr<SstPartitioner> Compaction::CreateSstPartitioner() const {
context.output_level = output_level_;
context.smallest_user_key = smallest_user_key_;
context.largest_user_key = largest_user_key_;
context.target_output_file_size = target_output_file_size_;
return immutable_options_.sst_partitioner_factory->CreatePartitioner(context);
}

Expand Down
1 change: 1 addition & 0 deletions db/db_impl/db_impl_compaction_flush.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,7 @@ Status DBImpl::CompactRangeInternal(const CompactRangeOptions& options,
// Small lies about compaction range
context.smallest_user_key = *begin;
context.largest_user_key = *end;
context.target_output_file_size = 0;
partitioner = partitioner_factory->CreatePartitioner(context);
}

Expand Down
1 change: 1 addition & 0 deletions include/rocksdb/sst_partitioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class SstPartitioner {
Slice smallest_user_key;
// Largest key for compaction
Slice largest_user_key;
size_t target_output_file_size;
};
};

Expand Down

0 comments on commit e1bb138

Please sign in to comment.