@ -1245,8 +1245,7 @@ void VersionStorageInfo::EstimateCompactionBytesNeeded(
}
}
void VersionStorageInfo : : ComputeCompactionScore (
void VersionStorageInfo : : ComputeCompactionScore (
const MutableCFOptions & mutable_cf_options ,
const MutableCFOptions & mutable_cf_options ) {
const CompactionOptionsFIFO & compaction_options_fifo ) {
for ( int level = 0 ; level < = MaxInputLevel ( ) ; level + + ) {
for ( int level = 0 ; level < = MaxInputLevel ( ) ; level + + ) {
double score ;
double score ;
if ( level = = 0 ) {
if ( level = = 0 ) {
@ -1282,7 +1281,7 @@ void VersionStorageInfo::ComputeCompactionScore(
if ( compaction_style_ = = kCompactionStyleFIFO ) {
if ( compaction_style_ = = kCompactionStyleFIFO ) {
score = static_cast < double > ( total_size ) /
score = static_cast < double > ( total_size ) /
compaction_options_fifo . max_table_files_size ;
mutable_cf_options . compaction_options_fifo . max_table_files_size ;
} else {
} else {
score = static_cast < double > ( num_sorted_runs ) /
score = static_cast < double > ( num_sorted_runs ) /
mutable_cf_options . level0_file_num_compaction_trigger ;
mutable_cf_options . level0_file_num_compaction_trigger ;
@ -2138,8 +2137,7 @@ void VersionSet::AppendVersion(ColumnFamilyData* column_family_data,
Version * v ) {
Version * v ) {
// compute new compaction score
// compute new compaction score
v - > storage_info ( ) - > ComputeCompactionScore (
v - > storage_info ( ) - > ComputeCompactionScore (
* column_family_data - > GetLatestMutableCFOptions ( ) ,
* column_family_data - > GetLatestMutableCFOptions ( ) ) ;
column_family_data - > ioptions ( ) - > compaction_options_fifo ) ;
// Mark v finalized
// Mark v finalized
v - > storage_info_ . SetFinalized ( ) ;
v - > storage_info_ . SetFinalized ( ) ;