Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
Li0k committed Aug 23, 2024
1 parent 4bd6904 commit 90fca85
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/storage/src/hummock/sstable/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ impl<W: SstableWriter, F: FilterBuilder> SstableBuilder<W, F> {
mut meta: BlockMeta,
) -> HummockResult<bool> {
let table_id = smallest_key.user_key.table_id.table_id;
if self.last_table_id.is_none() || self.last_table_id.unwrap() != table_id {
self.table_ids.insert(table_id);
self.finalize_last_table_stats();
self.last_table_id = Some(table_id);
}
if !self.block_builder.is_empty() {
let min_block_size = std::cmp::min(MIN_BLOCK_SIZE, self.options.block_capacity / 4);
if self.block_builder.approximate_len() < min_block_size {
Expand Down Expand Up @@ -231,12 +236,6 @@ impl<W: SstableWriter, F: FilterBuilder> SstableBuilder<W, F> {
let block_meta = self.block_metas.last_mut().unwrap();
self.writer.write_block_bytes(buf, block_meta).await?;

if self.last_table_id.is_none() || self.last_table_id.unwrap() != table_id {
self.table_ids.insert(table_id);
self.finalize_last_table_stats();
self.last_table_id = Some(table_id);
}

Ok(true)
}

Expand Down

0 comments on commit 90fca85

Please sign in to comment.