question: protected Tuple < BlobStoreIndexShardSnapshots , Integer > buildBlobStoreIndexShardSnapshots ( Map < String , BlobMetaData > blobs ) { int latest = - 1 ; for ( String name : blobs . keySet ( ) ) { if ( name . startsWith ( SNAPSHOT_INDEX_PREFIX ) ) { try { int gen = Integer . parseInt ( name . substring ( SNAPSHOT_INDEX_PREFIX . length ( ) ) ) ; if ( gen > latest ) { latest = gen ; } } catch ( NumberFormatException ex ) { logger . warn ( "failed to parse index file name [{}]" , name ) ; } } } if ( latest >= 0 ) { try { return new Tuple < > ( indexShardSnapshotsFormat . read ( blobContainer , Integer . toString ( latest ) ) , latest ) ; } catch ( IOException e ) { logger . warn ( "failed to read index file  [{}]" , e , SNAPSHOT_INDEX_PREFIX + latest ) ; } } List < SnapshotFiles > snapshots = new ArrayList < > ( ) ; for ( String name : blobs . keySet ( ) ) { try { BlobStoreIndexShardSnapshot snapshot = null ; if ( name . startsWith ( SNAPSHOT_PREFIX ) ) { snapshot = indexShardSnapshotFormat . readBlob ( blobContainer , name ) ; } else if ( name . startsWith ( LEGACY_SNAPSHOT_PREFIX ) ) { snapshot = indexShardSnapshotLegacyFormat . readBlob ( blobContainer , name ) ; } if ( snapshot != null ) { snapshots . add ( new SnapshotFiles ( snapshot . snapshot ( ) , snapshot . indexFiles ( ) ) ) ; } } catch ( IOException e ) { logger . warn ( "failed to read commit point [{}]" , e , name ) ; } } return new Tuple < > ( new BlobStoreIndexShardSnapshots ( snapshots ) , - 1 ) ; }
target:  Loads all available snapshots in the repository