synchronized long rollEditLog ( ) throws IOException { LOG . info ( "Rolling edit logs." ) ; long start = System . nanoTime ( ) ; endCurrentLogSegment ( true ) ; long nextTxId = getLastWrittenTxId ( ) + 1 ; startLogSegment ( nextTxId , true ) ; assert curSegmentTxId == nextTxId ; long rollTime = DFSUtil . getElapsedTimeMicroSeconds ( start ) ; if ( metrics != null ) { metrics . rollEditLogTime . inc ( rollTime ) ; metrics . tsLastEditsRoll . set ( System . currentTimeMillis ( ) ) ; } return nextTxId ; }
Finalizes the current edit log and opens a new log segment .