question: protected synchronized T load ( ) throws IOException { long genLoaded = - 1 ; IOException ioe = null ; List < String > genFiles = new ArrayList < String > ( ) ; String [ ] files ; try { files = dir . listAll ( ) ; } catch ( IOException ioe2 ) { return null ; } T loaded = null ; for ( String file : files ) { if ( file . startsWith ( prefix ) ) { long gen = Long . parseLong ( file . substring ( prefix . length ( ) ) ) ; if ( genLoaded == - 1 || gen > genLoaded ) { genFiles . add ( file ) ; IndexInput in = dir . openInput ( file , IOContext . DEFAULT ) ; try { loaded = loadOne ( in ) ; } catch ( IOException ioe2 ) { if ( ioe == null ) { ioe = ioe2 ; } } finally { in . close ( ) ; } genLoaded = gen ; } } } if ( genLoaded == - 1 ) { if ( ioe != null ) { throw ioe ; } } else { if ( genFiles . size ( ) > 1 ) { String curFileName = prefix + genLoaded ; for ( String file : genFiles ) { long gen = Long . parseLong ( file . substring ( prefix . length ( ) ) ) ; if ( canDelete ( gen ) && ! curFileName . equals ( file ) ) { dir . deleteFile ( file ) ; } } } nextWriteGen = 1 + genLoaded ; } return loaded ; }
target:  Loads the most recent generation file. 