@ -218,7 +218,7 @@ TEST_F(CompactionPickerTest, Empty) {
UpdateVersionStorageInfo ( ) ;
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) = = nullptr ) ;
}
@ -230,7 +230,7 @@ TEST_F(CompactionPickerTest, Single) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) = = nullptr ) ;
}
@ -244,7 +244,7 @@ TEST_F(CompactionPickerTest, Level0Trigger) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 1U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -258,7 +258,7 @@ TEST_F(CompactionPickerTest, Level1Trigger) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 66U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -277,7 +277,7 @@ TEST_F(CompactionPickerTest, Level1Trigger2) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 1 ) ) ;
@ -309,7 +309,7 @@ TEST_F(CompactionPickerTest, LevelMaxScore) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 7U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -357,7 +357,7 @@ TEST_F(CompactionPickerTest, Level0TriggerDynamic) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 1U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -382,7 +382,7 @@ TEST_F(CompactionPickerTest, Level0TriggerDynamic2) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 1U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -408,7 +408,7 @@ TEST_F(CompactionPickerTest, Level0TriggerDynamic3) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 1U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -438,7 +438,7 @@ TEST_F(CompactionPickerTest, Level0TriggerDynamic4) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 1U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -471,7 +471,7 @@ TEST_F(CompactionPickerTest, LevelTriggerDynamic4) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 5U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -528,7 +528,7 @@ TEST_F(CompactionPickerTest, CompactionUniversalIngestBehindReservedLevel) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
// output level should be the one above the bottom-most
ASSERT_EQ ( 1 , compaction - > output_level ( ) ) ;
@ -563,7 +563,7 @@ TEST_F(CompactionPickerTest, CannotTrivialMoveUniversal) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( ! compaction - > is_trivial_move ( ) ) ;
}
@ -590,7 +590,7 @@ TEST_F(CompactionPickerTest, AllowsTrivialMoveUniversal) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction - > is_trivial_move ( ) ) ;
}
@ -619,7 +619,7 @@ TEST_F(CompactionPickerTest, UniversalPeriodicCompaction1) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
ASSERT_EQ ( 4 , compaction - > output_level ( ) ) ;
@ -650,7 +650,7 @@ TEST_F(CompactionPickerTest, UniversalPeriodicCompaction2) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_FALSE ( compaction ) ;
}
@ -677,7 +677,7 @@ TEST_F(CompactionPickerTest, UniversalPeriodicCompaction3) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_FALSE ( compaction ) ;
}
@ -708,7 +708,7 @@ TEST_F(CompactionPickerTest, UniversalPeriodicCompaction4) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( ! compaction | |
compaction - > start_level ( ) ! = compaction - > output_level ( ) ) ;
}
@ -729,7 +729,7 @@ TEST_F(CompactionPickerTest, UniversalPeriodicCompaction5) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
ASSERT_EQ ( 0 , compaction - > start_level ( ) ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -754,7 +754,7 @@ TEST_F(CompactionPickerTest, UniversalPeriodicCompaction6) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
ASSERT_EQ ( 4 , compaction - > start_level ( ) ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
@ -792,7 +792,7 @@ TEST_F(CompactionPickerTest, UniversalIncrementalSpace1) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
ASSERT_EQ ( 4 , compaction - > output_level ( ) ) ;
ASSERT_EQ ( 3 , compaction - > start_level ( ) ) ;
@ -834,7 +834,7 @@ TEST_F(CompactionPickerTest, UniversalIncrementalSpace2) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
ASSERT_EQ ( 4 , compaction - > output_level ( ) ) ;
ASSERT_EQ ( 2 , compaction - > start_level ( ) ) ;
@ -876,7 +876,7 @@ TEST_F(CompactionPickerTest, UniversalIncrementalSpace3) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
ASSERT_EQ ( 4 , compaction - > output_level ( ) ) ;
ASSERT_EQ ( 2 , compaction - > start_level ( ) ) ;
@ -924,7 +924,7 @@ TEST_F(CompactionPickerTest, UniversalIncrementalSpace4) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
ASSERT_EQ ( 4 , compaction - > output_level ( ) ) ;
ASSERT_EQ ( 3 , compaction - > start_level ( ) ) ;
@ -968,7 +968,7 @@ TEST_F(CompactionPickerTest, UniversalIncrementalSpace5) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
ASSERT_EQ ( 4 , compaction - > output_level ( ) ) ;
ASSERT_EQ ( 3 , compaction - > start_level ( ) ) ;
@ -1035,7 +1035,7 @@ TEST_F(CompactionPickerTest, FIFOToWarm1) {
ASSERT_EQ ( fifo_compaction_picker . NeedsCompaction ( vstorage_ . get ( ) ) , true ) ;
std : : unique_ptr < Compaction > compaction ( fifo_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 3U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -1073,7 +1073,7 @@ TEST_F(CompactionPickerTest, FIFOToWarm2) {
ASSERT_EQ ( fifo_compaction_picker . NeedsCompaction ( vstorage_ . get ( ) ) , true ) ;
std : : unique_ptr < Compaction > compaction ( fifo_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 2U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -1114,7 +1114,7 @@ TEST_F(CompactionPickerTest, FIFOToWarmMaxSize) {
ASSERT_EQ ( fifo_compaction_picker . NeedsCompaction ( vstorage_ . get ( ) ) , true ) ;
std : : unique_ptr < Compaction > compaction ( fifo_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 1U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -1155,7 +1155,7 @@ TEST_F(CompactionPickerTest, FIFOToWarmWithExistingWarm) {
ASSERT_EQ ( fifo_compaction_picker . NeedsCompaction ( vstorage_ . get ( ) ) , true ) ;
std : : unique_ptr < Compaction > compaction ( fifo_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_EQ ( 2U , compaction - > input ( 0 , 0 ) - > fd . GetNumber ( ) ) ;
@ -1197,7 +1197,7 @@ TEST_F(CompactionPickerTest, FIFOToWarmWithOngoing) {
ASSERT_EQ ( fifo_compaction_picker . NeedsCompaction ( vstorage_ . get ( ) ) , true ) ;
std : : unique_ptr < Compaction > compaction ( fifo_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
// Stop if a file is being compacted
ASSERT_TRUE ( compaction . get ( ) = = nullptr ) ;
}
@ -1236,7 +1236,7 @@ TEST_F(CompactionPickerTest, FIFOToWarmWithHotBetweenWarms) {
ASSERT_EQ ( fifo_compaction_picker . NeedsCompaction ( vstorage_ . get ( ) ) , true ) ;
std : : unique_ptr < Compaction > compaction ( fifo_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
// Stop if a file is being compacted
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -1267,7 +1267,7 @@ TEST_F(CompactionPickerTest, CompactionPriMinOverlapping1) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
// Pick file 8 because it overlaps with 0 files on level 3.
@ -1300,7 +1300,7 @@ TEST_F(CompactionPickerTest, CompactionPriMinOverlapping2) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
// Picking file 7 because overlapping ratio is the biggest.
@ -1328,7 +1328,7 @@ TEST_F(CompactionPickerTest, CompactionPriMinOverlapping3) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
// Picking file 8 because overlapping ratio is the biggest.
@ -1359,7 +1359,7 @@ TEST_F(CompactionPickerTest, CompactionPriMinOverlapping4) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
// Picking file 8 because overlapping ratio is the biggest.
@ -1395,7 +1395,7 @@ TEST_F(CompactionPickerTest, CompactionPriRoundRobin) {
std : : unique_ptr < Compaction > compaction (
local_level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
// Since the max bytes for level 2 is 120M, picking one file to compact
// makes the post-compaction level size less than 120M, there is exactly one
@ -1435,7 +1435,7 @@ TEST_F(CompactionPickerTest, CompactionPriMultipleFilesRoundRobin1) {
std : : unique_ptr < Compaction > compaction (
local_level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
// The maximum compaction bytes is very large in this case so we can igore its
@ -1478,7 +1478,7 @@ TEST_F(CompactionPickerTest, CompactionPriMultipleFilesRoundRobin2) {
std : : unique_ptr < Compaction > compaction (
local_level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
// The maximum compaction bytes is only 2500 bytes now. Even though we are
@ -1522,7 +1522,7 @@ TEST_F(CompactionPickerTest, CompactionPriMultipleFilesRoundRobin3) {
std : : unique_ptr < Compaction > compaction (
local_level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
// Cannot pick more files since we reach the last file in level 2
@ -1581,7 +1581,7 @@ TEST_F(CompactionPickerTest, CompactionPriMinOverlappingManyFiles) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
// Picking file 8 because overlapping ratio is the biggest.
@ -1609,7 +1609,7 @@ TEST_F(CompactionPickerTest, ParentIndexResetBug) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
}
// This test checks ExpandWhileOverlapping() by having overlapping user keys
@ -1627,7 +1627,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
@ -1647,7 +1647,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys2) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 2U , compaction - > num_input_files ( 0 ) ) ;
@ -1675,7 +1675,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys3) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 5U , compaction - > num_input_files ( 0 ) ) ;
@ -1706,7 +1706,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys4) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -1730,7 +1730,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys5) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) = = nullptr ) ;
}
@ -1752,7 +1752,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys6) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -1773,7 +1773,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys7) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_GE ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -1802,7 +1802,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys8) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 3U , compaction - > num_input_files ( 0 ) ) ;
@ -1835,7 +1835,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys9) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 5U , compaction - > num_input_files ( 0 ) ) ;
@ -1876,7 +1876,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys10) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -1915,7 +1915,7 @@ TEST_F(CompactionPickerTest, OverlappingUserKeys11) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -2013,7 +2013,7 @@ TEST_F(CompactionPickerTest, NotScheduleL1IfL0WithHigherPri1) {
ASSERT_EQ ( 1 , vstorage_ - > CompactionScoreLevel ( 1 ) ) ;
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) = = nullptr ) ;
}
@ -2044,7 +2044,7 @@ TEST_F(CompactionPickerTest, NotScheduleL1IfL0WithHigherPri2) {
ASSERT_EQ ( 1 , vstorage_ - > CompactionScoreLevel ( 1 ) ) ;
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
}
@ -2078,7 +2078,7 @@ TEST_F(CompactionPickerTest, NotScheduleL1IfL0WithHigherPri3) {
ASSERT_EQ ( 0 , vstorage_ - > CompactionScoreLevel ( 1 ) ) ;
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
}
@ -2374,7 +2374,7 @@ TEST_F(CompactionPickerTest, MaxCompactionBytesHit) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -2400,7 +2400,7 @@ TEST_F(CompactionPickerTest, MaxCompactionBytesNotHit) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 3U , compaction - > num_input_files ( 0 ) ) ;
@ -2430,7 +2430,7 @@ TEST_F(CompactionPickerTest, IsTrivialMoveOn) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_TRUE ( compaction - > IsTrivialMove ( ) ) ;
}
@ -2455,7 +2455,7 @@ TEST_F(CompactionPickerTest, L0TrivialMove1) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1 , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 2 , compaction - > num_input_files ( 0 ) ) ;
@ -2484,7 +2484,7 @@ TEST_F(CompactionPickerTest, L0TrivialMoveOneFile) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1 , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 1 , compaction - > num_input_files ( 0 ) ) ;
@ -2510,7 +2510,7 @@ TEST_F(CompactionPickerTest, L0TrivialMoveWholeL0) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1 , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 4 , compaction - > num_input_files ( 0 ) ) ;
@ -2541,7 +2541,7 @@ TEST_F(CompactionPickerTest, IsTrivialMoveOffSstPartitioned) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
// No trivial move, because partitioning is applied
ASSERT_TRUE ( ! compaction - > IsTrivialMove ( ) ) ;
@ -2564,7 +2564,7 @@ TEST_F(CompactionPickerTest, IsTrivialMoveOff) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_FALSE ( compaction - > IsTrivialMove ( ) ) ;
}
@ -2593,7 +2593,7 @@ TEST_F(CompactionPickerTest, TrivialMoveMultipleFiles1) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_TRUE ( compaction - > IsTrivialMove ( ) ) ;
ASSERT_EQ ( 1 , compaction - > num_input_levels ( ) ) ;
@ -2627,7 +2627,7 @@ TEST_F(CompactionPickerTest, TrivialMoveMultipleFiles2) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_TRUE ( compaction - > IsTrivialMove ( ) ) ;
ASSERT_EQ ( 1 , compaction - > num_input_levels ( ) ) ;
@ -2660,7 +2660,7 @@ TEST_F(CompactionPickerTest, TrivialMoveMultipleFiles3) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_TRUE ( compaction - > IsTrivialMove ( ) ) ;
ASSERT_EQ ( 1 , compaction - > num_input_levels ( ) ) ;
@ -2686,7 +2686,7 @@ TEST_F(CompactionPickerTest, TrivialMoveMultipleFiles4) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_TRUE ( compaction - > IsTrivialMove ( ) ) ;
ASSERT_EQ ( 1 , compaction - > num_input_levels ( ) ) ;
@ -2716,7 +2716,7 @@ TEST_F(CompactionPickerTest, TrivialMoveMultipleFiles5) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_TRUE ( compaction - > IsTrivialMove ( ) ) ;
ASSERT_EQ ( 1 , compaction - > num_input_levels ( ) ) ;
@ -2750,7 +2750,7 @@ TEST_F(CompactionPickerTest, TrivialMoveMultipleFiles6) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_TRUE ( compaction - > IsTrivialMove ( ) ) ;
ASSERT_EQ ( 1 , compaction - > num_input_levels ( ) ) ;
@ -2785,7 +2785,7 @@ TEST_F(CompactionPickerTest, CacheNextCompactionIndex) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -2795,7 +2795,7 @@ TEST_F(CompactionPickerTest, CacheNextCompactionIndex) {
compaction . reset ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 2U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 1U , compaction - > num_input_files ( 0 ) ) ;
@ -2805,7 +2805,7 @@ TEST_F(CompactionPickerTest, CacheNextCompactionIndex) {
compaction . reset ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) = = nullptr ) ;
ASSERT_EQ ( 4 , vstorage_ - > NextCompactionIndex ( 1 /* level */ ) ) ;
}
@ -2831,7 +2831,7 @@ TEST_F(CompactionPickerTest, IntraL0MaxCompactionBytesNotHit) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 5U , compaction - > num_input_files ( 0 ) ) ;
@ -2862,7 +2862,7 @@ TEST_F(CompactionPickerTest, IntraL0MaxCompactionBytesHit) {
std : : unique_ptr < Compaction > compaction ( level_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction . get ( ) ! = nullptr ) ;
ASSERT_EQ ( 1U , compaction - > num_input_levels ( ) ) ;
ASSERT_EQ ( 4U , compaction - > num_input_files ( 0 ) ) ;
@ -2928,7 +2928,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedCompactionFullOverlap) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
// Validate that its a compaction to reduce sorted runs
@ -2946,7 +2946,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedCompactionFullOverlap) {
std : : unique_ptr < Compaction > compaction2 (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_FALSE ( compaction2 ) ;
}
@ -2971,7 +2971,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedCompactionFullOverlap2) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
// Validate that its a delete triggered compaction
@ -2990,7 +2990,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedCompactionFullOverlap2) {
std : : unique_ptr < Compaction > compaction2 (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_FALSE ( compaction2 ) ;
}
@ -3031,7 +3031,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedCompactionStartOutputOverlap) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
// Validate that its a delete triggered compaction
@ -3062,7 +3062,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedCompactionStartOutputOverlap) {
std : : unique_ptr < Compaction > compaction2 (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_FALSE ( compaction2 ) ;
DeleteVersionStorage ( ) ;
}
@ -3088,7 +3088,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedL0NoOverlap) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
// Validate that its a delete triggered compaction
@ -3125,7 +3125,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedL0WithOverlap) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
// Validate that its a delete triggered compaction
@ -3159,7 +3159,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedL0Overlap2) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction ) ;
// Validate that its a delete triggered compaction
@ -3180,7 +3180,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedL0Overlap2) {
std : : unique_ptr < Compaction > compaction2 (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
ASSERT_TRUE ( compaction2 ) ;
ASSERT_EQ ( 3U , compaction - > num_input_files ( 0 ) ) ;
ASSERT_TRUE ( file_map_ [ 1 ] . first - > being_compacted ) ;
@ -3215,7 +3215,7 @@ TEST_F(CompactionPickerTest, UniversalMarkedManualCompaction) {
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
ColumnFamilyData : : kCompactAllLevels , 6 , CompactRangeOptions ( ) ,
nullptr , nullptr , & manual_end , & manual_conflict ,
std : : numeric_limits < uint64_t > : : max ( ) , " " , kMaxSequenceNumber ) ) ;
std : : numeric_limits < uint64_t > : : max ( ) , " " ) ) ;
ASSERT_TRUE ( compaction ) ;
@ -3256,7 +3256,7 @@ TEST_F(CompactionPickerTest, UniversalSizeAmpTierCompactionNonLastLevel) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
// Make sure it's a size amp compaction and includes all files
ASSERT_EQ ( compaction - > compaction_reason ( ) ,
@ -3292,7 +3292,7 @@ TEST_F(CompactionPickerTest, UniversalSizeRatioTierCompactionLastLevel) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
// Internally, size amp compaction is evaluated before size ratio compaction.
// Here to make sure it's size ratio compaction instead of size amp
@ -3329,7 +3329,7 @@ TEST_F(CompactionPickerTest, UniversalSizeAmpTierCompactionNotSuport) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
// size amp compaction is still triggered even preclude_last_level is set
ASSERT_EQ ( compaction - > compaction_reason ( ) ,
@ -3363,7 +3363,7 @@ TEST_F(CompactionPickerTest, UniversalSizeAmpTierCompactionLastLevel) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
// It's a Size Amp compaction, but doesn't include the last level file and
// output to the penultimate level.
@ -3471,7 +3471,7 @@ TEST_F(CompactionPickerU64TsTest, CannotTrivialMoveUniversal) {
std : : unique_ptr < Compaction > compaction (
universal_compaction_picker . PickCompaction (
cf_name_ , mutable_cf_options_ , mutable_db_options_ , vstorage_ . get ( ) ,
& log_buffer_ , kMaxSequenceNumber ) ) ;
& log_buffer_ ) ) ;
assert ( compaction ) ;
ASSERT_TRUE ( ! compaction - > is_trivial_move ( ) ) ;
}