@ -188,8 +188,8 @@ TEST_F(DBSecondaryTest, SimpleInternalCompaction) {
auto cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
auto cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
CompactionServiceResult result ;
CompactionServiceResult result ;
ASSERT_OK ( db_secondary_full ( ) - > TEST_CompactWithoutInstallation ( cfh , input ,
ASSERT_OK ( db_secondary_full ( ) - > TEST_CompactWithoutInstallation (
& result ) ) ;
OpenAndCompactOptions ( ) , cfh , input , & result ) ) ;
ASSERT_EQ ( result . output_files . size ( ) , 1 ) ;
ASSERT_EQ ( result . output_files . size ( ) , 1 ) ;
InternalKey smallest , largest ;
InternalKey smallest , largest ;
@ -248,8 +248,8 @@ TEST_F(DBSecondaryTest, InternalCompactionMultiLevels) {
OpenSecondary ( options ) ;
OpenSecondary ( options ) ;
auto cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
auto cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
CompactionServiceResult result ;
CompactionServiceResult result ;
ASSERT_OK ( db_secondary_full ( ) - > TEST_CompactWithoutInstallation ( cfh , input1 ,
ASSERT_OK ( db_secondary_full ( ) - > TEST_CompactWithoutInstallation (
& result ) ) ;
OpenAndCompactOptions ( ) , cfh , input1 , & result ) ) ;
ASSERT_OK ( result . status ) ;
ASSERT_OK ( result . status ) ;
// pick 2 files on level 1 for compaction, which has 6 overlap files on L2
// pick 2 files on level 1 for compaction, which has 6 overlap files on L2
@ -261,8 +261,8 @@ TEST_F(DBSecondaryTest, InternalCompactionMultiLevels) {
}
}
input2 . output_level = 2 ;
input2 . output_level = 2 ;
ASSERT_OK ( db_secondary_full ( ) - > TEST_CompactWithoutInstallation ( cfh , input2 ,
ASSERT_OK ( db_secondary_full ( ) - > TEST_CompactWithoutInstallation (
& result ) ) ;
OpenAndCompactOptions ( ) , cfh , input2 , & result ) ) ;
ASSERT_OK ( result . status ) ;
ASSERT_OK ( result . status ) ;
CloseSecondary ( ) ;
CloseSecondary ( ) ;
@ -273,15 +273,15 @@ TEST_F(DBSecondaryTest, InternalCompactionMultiLevels) {
}
}
OpenSecondary ( options ) ;
OpenSecondary ( options ) ;
cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
Status s = db_secondary_full ( ) - > TEST_CompactWithoutInstallation ( cfh , input2 ,
Status s = db_secondary_full ( ) - > TEST_CompactWithoutInstallation (
& result ) ;
OpenAndCompactOptions ( ) , cfh , input2 , & result ) ;
ASSERT_TRUE ( s . IsInvalidArgument ( ) ) ;
ASSERT_TRUE ( s . IsInvalidArgument ( ) ) ;
ASSERT_OK ( result . status ) ;
ASSERT_OK ( result . status ) ;
// TODO: L0 -> L1 compaction should success, currently version is not built
// TODO: L0 -> L1 compaction should success, currently version is not built
// if files is missing.
// if files is missing.
// ASSERT_OK(db_secondary_full()->TEST_CompactWithoutInstallation(cfh ,
// ASSERT_OK(db_secondary_full()->TEST_CompactWithoutInstallation(OpenAndCompactOptions() ,
// input1, &result));
// cfh, input1, &result));
}
}
TEST_F ( DBSecondaryTest , InternalCompactionCompactedFiles ) {
TEST_F ( DBSecondaryTest , InternalCompactionCompactedFiles ) {
@ -319,8 +319,8 @@ TEST_F(DBSecondaryTest, InternalCompactionCompactedFiles) {
auto cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
auto cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
CompactionServiceResult result ;
CompactionServiceResult result ;
Status s =
Status s = db_secondary_full ( ) - > TEST_CompactWithoutInstallation (
db_secondary_full ( ) - > TEST_CompactWithoutInstallation ( cfh , input , & result ) ;
OpenAndCompactOptions ( ) , cfh , input , & result ) ;
ASSERT_TRUE ( s . IsInvalidArgument ( ) ) ;
ASSERT_TRUE ( s . IsInvalidArgument ( ) ) ;
ASSERT_OK ( result . status ) ;
ASSERT_OK ( result . status ) ;
}
}
@ -356,15 +356,15 @@ TEST_F(DBSecondaryTest, InternalCompactionMissingFiles) {
auto cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
auto cfh = db_secondary_ - > DefaultColumnFamily ( ) ;
CompactionServiceResult result ;
CompactionServiceResult result ;
Status s =
Status s = db_secondary_full ( ) - > TEST_CompactWithoutInstallation (
db_secondary_full ( ) - > TEST_CompactWithoutInstallation ( cfh , input , & result ) ;
OpenAndCompactOptions ( ) , cfh , input , & result ) ;
ASSERT_TRUE ( s . IsInvalidArgument ( ) ) ;
ASSERT_TRUE ( s . IsInvalidArgument ( ) ) ;
ASSERT_OK ( result . status ) ;
ASSERT_OK ( result . status ) ;
input . input_files . erase ( input . input_files . begin ( ) ) ;
input . input_files . erase ( input . input_files . begin ( ) ) ;
ASSERT_OK ( db_secondary_full ( ) - > TEST_CompactWithoutInstallation ( cfh , input ,
ASSERT_OK ( db_secondary_full ( ) - > TEST_CompactWithoutInstallation (
& result ) ) ;
OpenAndCompactOptions ( ) , cfh , input , & result ) ) ;
ASSERT_OK ( result . status ) ;
ASSERT_OK ( result . status ) ;
}
}