File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -895,6 +895,28 @@ impl PartitionHandle {
895
895
)
896
896
}
897
897
898
+ /// Performs major compaction, blocking the caller until it's done.
899
+ ///
900
+ /// # Errors
901
+ ///
902
+ /// Will return `Err` if an IO error occurs.
903
+ #[ doc( hidden) ]
904
+ pub fn major_compact ( & self ) -> crate :: Result < ( ) > {
905
+ match & self . config . compaction_strategy {
906
+ crate :: compaction:: Strategy :: Leveled ( x) => self . tree . major_compact (
907
+ u64:: from ( x. target_size ) ,
908
+ self . snapshot_tracker . get_seqno_safe_to_gc ( ) ,
909
+ ) ?,
910
+ crate :: compaction:: Strategy :: SizeTiered ( _) => self
911
+ . tree
912
+ . major_compact ( u64:: MAX , self . snapshot_tracker . get_seqno_safe_to_gc ( ) ) ?,
913
+ crate :: compaction:: Strategy :: Fifo ( _) => {
914
+ log:: warn!( "Major compaction not supported for FIFO strategy" ) ;
915
+ }
916
+ }
917
+ Ok ( ( ) )
918
+ }
919
+
898
920
/// Inserts a key-value pair into the partition.
899
921
///
900
922
/// Keys may be up to 65536 bytes long, values up to 2^32 bytes.
You can’t perform that action at this time.
0 commit comments