@ -1322,8 +1322,9 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
if ( s . ok ( ) & & old_manifest_file_number < manifest_file_number_ ) {
// delete old manifest file
Log ( options_ - > info_log ,
" Deleting manifest %llu current manifest %llu \n " ,
old_manifest_file_number , manifest_file_number_ ) ;
" Deleting manifest %lu current manifest %lu \n " ,
( unsigned long ) old_manifest_file_number ,
( unsigned long ) manifest_file_number_ ) ;
// we don't care about an error here, PurgeObsoleteFiles will take care
// of it later
env_ - > DeleteFile ( DescriptorFileName ( dbname_ , old_manifest_file_number ) ) ;
@ -1348,8 +1349,8 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
prev_log_number_ = edit - > prev_log_number_ ;
} else {
Log ( options_ - > info_log , " Error in committing version %ll u " ,
v - > GetVersionNumber ( ) ) ;
Log ( options_ - > info_log , " Error in committing version %lu " ,
( unsigned long ) v - > GetVersionNumber ( ) ) ;
delete v ;
if ( ! new_manifest_file . empty ( ) ) {
descriptor_log_ . reset ( ) ;
@ -1521,11 +1522,15 @@ Status VersionSet::Recover() {
prev_log_number_ = prev_log_number ;
Log ( options_ - > info_log , " Recovered from manifest file:%s succeeded, "
" manifest_file_number is %llu, next_file_number is %llu, "
" last_sequence is %llu, log_number is %llu, "
" prev_log_number is %llu \n " ,
current . c_str ( ) , manifest_file_number_ , next_file_number_ ,
last_sequence_ , log_number_ , prev_log_number_ ) ;
" manifest_file_number is %lu, next_file_number is %lu, "
" last_sequence is %lu, log_number is %lu, "
" prev_log_number is %lu \n " ,
current . c_str ( ) ,
( unsigned long ) manifest_file_number_ ,
( unsigned long ) next_file_number_ ,
( unsigned long ) last_sequence_ ,
( unsigned long ) log_number_ ,
( unsigned long ) prev_log_number_ ) ;
}
return s ;
@ -1647,10 +1652,13 @@ Status VersionSet::DumpManifest(Options& options, std::string& dscname,
log_number_ = log_number ;
prev_log_number_ = prev_log_number ;
printf ( " manifest_file_number %llu next_file_number %llu last_sequence "
" %llu log_number %llu prev_log_number %llu \n " ,
manifest_file_number_ , next_file_number_ ,
last_sequence , log_number , prev_log_number ) ;
printf ( " manifest_file_number %lu next_file_number %lu last_sequence "
" %lu log_number %lu prev_log_number %lu \n " ,
( unsigned long ) manifest_file_number_ ,
( unsigned long ) next_file_number_ ,
( unsigned long ) last_sequence ,
( unsigned long ) log_number ,
( unsigned long ) prev_log_number ) ;
printf ( " %s \n " , v - > DebugString ( hex ) . c_str ( ) ) ;
}
@ -1864,8 +1872,8 @@ const char* VersionSet::LevelDataSizeSummary(
int len = snprintf ( scratch - > buffer , sizeof ( scratch - > buffer ) , " files_size[ " ) ;
for ( int i = 0 ; i < NumberLevels ( ) ; i + + ) {
int sz = sizeof ( scratch - > buffer ) - len ;
int ret = snprintf ( scratch - > buffer + len , sz , " %ll u " ,
NumLevelBytes ( i ) ) ;
int ret = snprintf ( scratch - > buffer + len , sz , " %lu " ,
( unsigned long ) NumLevelBytes ( i ) ) ;
if ( ret < 0 | | ret > = sz )
break ;
len + = ret ;
@ -1881,9 +1889,11 @@ const char* VersionSet::LevelFileSummary(
FileMetaData * f = current_ - > files_ [ level ] [ i ] ;
int sz = sizeof ( scratch - > buffer ) - len ;
int ret = snprintf ( scratch - > buffer + len , sz ,
" #%llu(seq=%llu,sz=%llu,%d) " ,
f - > number , f - > smallest_seqno ,
f - > file_size , f - > being_compacted ) ;
" #%lu(seq=%lu,sz=%lu,%lu) " ,
( unsigned long ) f - > number ,
( unsigned long ) f - > smallest_seqno ,
( unsigned long ) f - > file_size ,
( unsigned long ) f - > being_compacted ) ;
if ( ret < 0 | | ret > = sz )
break ;
len + = ret ;
@ -2221,16 +2231,20 @@ Compaction* VersionSet::PickCompactionUniversalSizeAmp(
start_index = loop ; // Consider this as the first candidate.
break ;
}
Log ( options_ - > info_log , " Universal: skipping file %llu[%d] compacted %s " ,
f - > number , loop , " cannot be a candidate to reduce size amp. \n " ) ;
Log ( options_ - > info_log , " Universal: skipping file %lu[%d] compacted %s " ,
( unsigned long ) f - > number ,
loop ,
" cannot be a candidate to reduce size amp. \n " ) ;
f = nullptr ;
}
if ( f = = nullptr ) {
return nullptr ; // no candidate files
}
Log ( options_ - > info_log , " Universal: First candidate file %llu[%d] %s " ,
f - > number , start_index , " to reduce size amp. \n " ) ;
Log ( options_ - > info_log , " Universal: First candidate file %lu[%d] %s " ,
( unsigned long ) f - > number ,
start_index ,
" to reduce size amp. \n " ) ;
// keep adding up all the remaining files
for ( unsigned int loop = start_index ; loop < file_by_time . size ( ) - 1 ;
@ -2239,7 +2253,9 @@ Compaction* VersionSet::PickCompactionUniversalSizeAmp(
f = current_ - > files_ [ level ] [ index ] ;
if ( f - > being_compacted ) {
Log ( options_ - > info_log ,
" Universal: Possible candidate file %llu[%d] %s. " , f - > number , loop ,
" Universal: Possible candidate file %lu[%d] %s. " ,
( unsigned long ) f - > number ,
loop ,
" is already being compacted. No size amp reduction possible. \n " ) ;
return nullptr ;
}
@ -2257,15 +2273,17 @@ Compaction* VersionSet::PickCompactionUniversalSizeAmp(
// size amplification = percentage of additional size
if ( candidate_size * 100 < ratio * earliest_file_size ) {
Log ( options_ - > info_log ,
" Universal: size amp not needed. newer-files-total-size %llu "
" earliest-file-size %llu " ,
candidate_size , earliest_file_size ) ;
" Universal: size amp not needed. newer-files-total-size %lu "
" earliest-file-size %lu " ,
( unsigned long ) candidate_size ,
( unsigned long ) earliest_file_size ) ;
return nullptr ;
} else {
Log ( options_ - > info_log ,
" Universal: size amp needed. newer-files-total-size %llu "
" earliest-file-size %llu " ,
candidate_size , earliest_file_size ) ;
" Universal: size amp needed. newer-files-total-size %lu "
" earliest-file-size %lu " ,
( unsigned long ) candidate_size ,
( unsigned long ) earliest_file_size ) ;
}
assert ( start_index > = 0 & & start_index < file_by_time . size ( ) - 1 ) ;
@ -2280,8 +2298,10 @@ Compaction* VersionSet::PickCompactionUniversalSizeAmp(
f = current_ - > files_ [ level ] [ index ] ;
c - > inputs_ [ 0 ] . push_back ( f ) ;
Log ( options_ - > info_log ,
" Universal: size amp picking file %llu[%d] with size %llu " ,
f - > number , index , f - > file_size ) ;
" Universal: size amp picking file %lu[%d] with size %lu " ,
( unsigned long ) f - > number ,
index ,
( unsigned long ) f - > file_size ) ;
}
return c ;
}
@ -2327,8 +2347,8 @@ Compaction* VersionSet::PickCompactionUniversalReadAmp(
break ;
}
Log ( options_ - > info_log ,
" Universal: file %ll u[%d] being compacted, skipping " ,
f - > number , loop ) ;
" Universal: file %lu[%d] being compacted, skipping " ,
( unsigned long ) f - > number , loop ) ;
f = nullptr ;
}
@ -2336,8 +2356,8 @@ Compaction* VersionSet::PickCompactionUniversalReadAmp(
// first candidate to be compacted.
uint64_t candidate_size = f ! = nullptr ? f - > file_size : 0 ;
if ( f ! = nullptr ) {
Log ( options_ - > info_log , " Universal: Possible candidate file %ll u[%d]. " ,
f - > number , loop ) ;
Log ( options_ - > info_log , " Universal: Possible candidate file %lu[%d]. " ,
( unsigned long ) f - > number , loop ) ;
}
// Check if the suceeding files need compaction.
@ -2370,8 +2390,11 @@ Compaction* VersionSet::PickCompactionUniversalReadAmp(
int index = file_by_time [ i ] ;
FileMetaData * f = current_ - > files_ [ level ] [ index ] ;
Log ( options_ - > info_log ,
" Universal: Skipping file %llu[%d] with size %llu %d \n " ,
f - > number , i , f - > file_size , f - > being_compacted ) ;
" Universal: Skipping file %lu[%d] with size %lu %d \n " ,
( unsigned long ) f - > number ,
i ,
( unsigned long ) f - > file_size ,
f - > being_compacted ) ;
}
}
}
@ -2405,8 +2428,10 @@ Compaction* VersionSet::PickCompactionUniversalReadAmp(
int index = file_by_time [ i ] ;
FileMetaData * f = current_ - > files_ [ level ] [ index ] ;
c - > inputs_ [ 0 ] . push_back ( f ) ;
Log ( options_ - > info_log , " Universal: Picking file %llu[%d] with size %llu \n " ,
f - > number , i , f - > file_size ) ;
Log ( options_ - > info_log , " Universal: Picking file %lu[%d] with size %lu \n " ,
( unsigned long ) f - > number ,
i ,
( unsigned long ) f - > file_size ) ;
}
return c ;
}
@ -2792,16 +2817,17 @@ void VersionSet::SetupOtherInputs(Compaction* c) {
if ( expanded1 . size ( ) = = c - > inputs_ [ 1 ] . size ( ) & &
! FilesInCompaction ( expanded1 ) ) {
Log ( options_ - > info_log ,
" Expanding@%d %d+%d (%llu+%llu bytes) to %d+%d (%llu+%llu bytes) \n " ,
level ,
int ( c - > inputs_ [ 0 ] . size ( ) ) ,
int ( c - > inputs_ [ 1 ] . size ( ) ) ,
inputs0_size ,
inputs1_size ,
int ( expanded0 . size ( ) ) ,
int ( expanded1 . size ( ) ) ,
expanded0_size ,
inputs1_size ) ;
" Expanding@%lu %lu+%lu (%lu+%lu bytes) to %lu+%lu (%lu+%lu bytes) "
" \n " ,
( unsigned long ) level ,
( unsigned long ) ( c - > inputs_ [ 0 ] . size ( ) ) ,
( unsigned long ) ( c - > inputs_ [ 1 ] . size ( ) ) ,
( unsigned long ) inputs0_size ,
( unsigned long ) inputs1_size ,
( unsigned long ) ( expanded0 . size ( ) ) ,
( unsigned long ) ( expanded1 . size ( ) ) ,
( unsigned long ) expanded0_size ,
( unsigned long ) inputs1_size ) ;
smallest = new_start ;
largest = new_limit ;
c - > inputs_ [ 0 ] = expanded0 ;
@ -3091,9 +3117,9 @@ static void InputSummary(std::vector<FileMetaData*>& files,
int write = 0 ;
for ( unsigned int i = 0 ; i < files . size ( ) ; i + + ) {
int sz = len - write ;
int ret = snprintf ( output + write , sz , " %ll u(%l lu) " ,
files . at ( i ) - > number ,
files . at ( i ) - > file_size ) ;
int ret = snprintf ( output + write , sz , " %lu(%lu) " ,
( unsigned long ) files . at ( i ) - > number ,
( unsigned long ) files . at ( i ) - > file_size ) ;
if ( ret < 0 | | ret > = sz )
break ;
write + = ret ;
@ -3102,8 +3128,10 @@ static void InputSummary(std::vector<FileMetaData*>& files,
void Compaction : : Summary ( char * output , int len ) {
int write = snprintf ( output , len ,
" Base version %llu Base level %d, seek compaction:%d, inputs: " ,
input_version_ - > GetVersionNumber ( ) , level_ , seek_compaction_ ) ;
" Base version %lu Base level %d, seek compaction:%d, inputs: " ,
( unsigned long ) input_version_ - > GetVersionNumber ( ) ,
level_ ,
seek_compaction_ ) ;
if ( write < 0 | | write > len ) {
return ;
}