@ -3083,7 +3083,7 @@ TEST_F(DBTest, FIFOCompactionWithTTLAndMaxOpenFilesTest) {
Options options ;
options . compaction_style = kCompactionStyleFIFO ;
options . create_if_missing = true ;
options . compaction_options_fifo . ttl = 600 ; // seconds
options . ttl = 600 ; // seconds
// Check that it is not supported with max_open_files != -1.
options . max_open_files = 100 ;
@ -3099,7 +3099,7 @@ TEST_F(DBTest, FIFOCompactionWithTTLAndVariousTableFormatsTest) {
Options options ;
options . compaction_style = kCompactionStyleFIFO ;
options . create_if_missing = true ;
options . compaction_options_fifo . ttl = 600 ; // seconds
options . ttl = 600 ; // seconds
options = CurrentOptions ( options ) ;
options . table_factory . reset ( NewBlockBasedTableFactory ( ) ) ;
@ -3130,7 +3130,7 @@ TEST_F(DBTest, FIFOCompactionWithTTLTest) {
env_ - > addon_time_ . store ( 0 ) ;
options . compaction_options_fifo . max_table_files_size = 150 < < 10 ; // 150KB
options . compaction_options_fifo . allow_compaction = false ;
options . compaction_options_fifo . ttl = 1 * 60 * 60 ; // 1 hour
options . ttl = 1 * 60 * 60 ; // 1 hour
options = CurrentOptions ( options ) ;
DestroyAndReopen ( options ) ;
@ -3165,7 +3165,7 @@ TEST_F(DBTest, FIFOCompactionWithTTLTest) {
{
options . compaction_options_fifo . max_table_files_size = 150 < < 10 ; // 150KB
options . compaction_options_fifo . allow_compaction = false ;
options . compaction_options_fifo . ttl = 1 * 60 * 60 ; // 1 hour
options . ttl = 1 * 60 * 60 ; // 1 hour
options = CurrentOptions ( options ) ;
DestroyAndReopen ( options ) ;
@ -3207,7 +3207,7 @@ TEST_F(DBTest, FIFOCompactionWithTTLTest) {
options . write_buffer_size = 10 < < 10 ; // 10KB
options . compaction_options_fifo . max_table_files_size = 150 < < 10 ; // 150KB
options . compaction_options_fifo . allow_compaction = false ;
options . compaction_options_fifo . ttl = 1 * 60 * 60 ; // 1 hour
options . ttl = 1 * 60 * 60 ; // 1 hour
options = CurrentOptions ( options ) ;
DestroyAndReopen ( options ) ;
@ -3244,7 +3244,7 @@ TEST_F(DBTest, FIFOCompactionWithTTLTest) {
{
options . compaction_options_fifo . max_table_files_size = 150 < < 10 ; // 150KB
options . compaction_options_fifo . allow_compaction = true ;
options . compaction_options_fifo . ttl = 1 * 60 * 60 ; // 1 hour
options . ttl = 1 * 60 * 60 ; // 1 hour
options . level0_file_num_compaction_trigger = 6 ;
options = CurrentOptions ( options ) ;
DestroyAndReopen ( options ) ;
@ -3288,7 +3288,7 @@ TEST_F(DBTest, FIFOCompactionWithTTLTest) {
options . write_buffer_size = 20 < < 10 ; // 20K
options . compaction_options_fifo . max_table_files_size = 1500 < < 10 ; // 1.5MB
options . compaction_options_fifo . allow_compaction = true ;
options . compaction_options_fifo . ttl = 1 * 60 * 60 ; // 1 hour
options . ttl = 1 * 60 * 60 ; // 1 hour
options . level0_file_num_compaction_trigger = 6 ;
options = CurrentOptions ( options ) ;
DestroyAndReopen ( options ) ;
@ -4587,7 +4587,7 @@ TEST_F(DBTest, DynamicCompactionOptions) {
ASSERT_LT ( NumTableFilesAtLevel ( 0 ) , 4 ) ;
}
// Test dynamic FIFO cop maction options.
// Test dynamic FIFO comp action options.
// This test covers just option parsing and makes sure that the options are
// correctly assigned. Also look at DBOptionsTest.SetFIFOCompactionOptions
// test which makes sure that the FIFO compaction funcionality is working
@ -4601,7 +4601,7 @@ TEST_F(DBTest, DynamicFIFOCompactionOptions) {
// Initial defaults
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . max_table_files_size ,
1024 * 1024 * 1024 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . ttl , 0 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . ttl , 0 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . allow_compaction ,
false ) ;
@ -4609,21 +4609,21 @@ TEST_F(DBTest, DynamicFIFOCompactionOptions) {
{ { " compaction_options_fifo " , " {max_table_files_size=23;} " } } ) ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . max_table_files_size ,
23 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . ttl , 0 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . ttl , 0 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . allow_compaction ,
false ) ;
ASSERT_OK ( dbfull ( ) - > SetOptions ( { { " compaction_options_fifo " , " {ttl= 97} " } } ) ) ;
ASSERT_OK ( dbfull ( ) - > SetOptions ( { { " ttl " , " 97 " } } ) ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . max_table_files_size ,
23 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . ttl , 97 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . ttl , 97 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . allow_compaction ,
false ) ;
ASSERT_OK ( dbfull ( ) - > SetOptions ( { { " compaction_options_fifo " , " {ttl= 203;} " } } ) ) ;
ASSERT_OK ( dbfull ( ) - > SetOptions ( { { " ttl " , " 203 " } } ) ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . max_table_files_size ,
23 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . ttl , 203 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . ttl , 203 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . allow_compaction ,
false ) ;
@ -4631,24 +4631,25 @@ TEST_F(DBTest, DynamicFIFOCompactionOptions) {
{ { " compaction_options_fifo " , " {allow_compaction=true;} " } } ) ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . max_table_files_size ,
23 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . ttl , 203 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . ttl , 203 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . allow_compaction ,
true ) ;
ASSERT_OK ( dbfull ( ) - > SetOptions (
{ { " compaction_options_fifo " , " {max_table_files_size=31;ttl=19; } " } } ) ) ;
{ { " compaction_options_fifo " , " {max_table_files_size=31;} " } } ) ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . max_table_files_size ,
31 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . ttl , 19 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . ttl , 203 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . allow_compaction ,
true ) ;
ASSERT_OK ( dbfull ( ) - > SetOptions (
{ { " compaction_options_fifo " ,
" {max_table_files_size=51;ttl=49;allow_compaction=true;} " } } ) ) ;
" {max_table_files_size=51;allow_compaction=true;} " } } ) ) ;
ASSERT_OK ( dbfull ( ) - > SetOptions ( { { " ttl " , " 49 " } } ) ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . max_table_files_size ,
51 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . ttl , 49 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . ttl , 49 ) ;
ASSERT_EQ ( dbfull ( ) - > GetOptions ( ) . compaction_options_fifo . allow_compaction ,
true ) ;
}