public void logSyncIfNeeded ( ) { boolean doSync = false ; synchronized ( this ) { if ( txid > synctxid + maxBufferedTransactions ) { FSNamesystem . LOG . info ( "Out of band log sync triggered " + " because there are " + ( txid - synctxid ) + " buffered transactions which " + " is more than the configured limit of " + maxBufferedTransactions ) ; doSync = true ; } if ( shouldForceSync ( ) ) { FSNamesystem . LOG . info ( "Log sync triggered by the output stream" ) ; doSync = true ; } } if ( doSync ) { logSync ( ) ; } }
if there are too many transactions that are yet to be synced then sync them . Otherwise the in - memory buffer that keeps the transactions would grow to be very very big . This can happen when there are a large number of listStatus calls which update the access time of files .