Skip to content

Commit

Permalink
refactor(storage): unify sstable writer in normal compaction (#13742)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcy-fdu authored Nov 30, 2023
1 parent e7ef790 commit 47445df
Showing 1 changed file with 5 additions and 37 deletions.
42 changes: 5 additions & 37 deletions src/storage/src/hummock/compactor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ use crate::hummock::iterator::{Forward, HummockIterator};
use crate::hummock::multi_builder::SplitTableOutput;
use crate::hummock::vacuum::Vacuum;
use crate::hummock::{
validate_ssts, BatchSstableWriterFactory, BlockedXor16FilterBuilder,
CompactionDeleteRangeIterator, FilterBuilder, HummockError, SharedComapctorObjectIdManager,
SstableWriterFactory, StreamingSstableWriterFactory,
validate_ssts, BlockedXor16FilterBuilder, CompactionDeleteRangeIterator, FilterBuilder,
HummockError, SharedComapctorObjectIdManager, SstableWriterFactory,
UnifiedSstableWriterFactory,
};
use crate::monitor::CompactorMetrics;

Expand Down Expand Up @@ -141,40 +141,8 @@ impl Compactor {
.start_timer()
};

let (split_table_outputs, table_stats_map) = if self
.context
.sstable_store
.store()
.support_streaming_upload()
{
let factory = StreamingSstableWriterFactory::new(self.context.sstable_store.clone());
if self.task_config.use_block_based_filter {
self.compact_key_range_impl::<_, BlockedXor16FilterBuilder>(
factory,
iter,
compaction_filter,
del_iter,
filter_key_extractor,
task_progress.clone(),
self.object_id_getter.clone(),
)
.verbose_instrument_await("compact")
.await?
} else {
self.compact_key_range_impl::<_, Xor16FilterBuilder>(
factory,
iter,
compaction_filter,
del_iter,
filter_key_extractor,
task_progress.clone(),
self.object_id_getter.clone(),
)
.verbose_instrument_await("compact")
.await?
}
} else {
let factory = BatchSstableWriterFactory::new(self.context.sstable_store.clone());
let (split_table_outputs, table_stats_map) = {
let factory = UnifiedSstableWriterFactory::new(self.context.sstable_store.clone());
if self.task_config.use_block_based_filter {
self.compact_key_range_impl::<_, BlockedXor16FilterBuilder>(
factory,
Expand Down

0 comments on commit 47445df

Please sign in to comment.