synchronized boolean hasUnfinalizedSegments ( long fromTxId ) { List < EditLogInputStream > streams = new ArrayList < EditLogInputStream > ( ) ; for ( JournalAndStream jas : journals ) { if ( jas . isDisabled ( ) ) { continue ; } try { // get all streams, including inProgress ones. jas . getManager ( ) . selectInputStreams ( streams , fromTxId , true , false ) ; for ( EditLogInputStream elis : streams ) { if ( elis . isInProgress ( ) ) { // we found an input stream that is in progress return true ; } } } catch ( IOException ioe ) { LOG . warn ( "Unable to determine input streams from " + jas . getManager ( ) + ". Skipping." , ioe ) ; } } // all streams are finalized return false ; }
Check if any journal manager has unfinalized segments .