public File getFsImageName ( StorageLocationType type , long txid ) { File lastCandidate = null ; for ( Iterator < StorageDirectory > it = dirIterator ( NameNodeDirType . IMAGE ) ; it . hasNext ( ) ; ) { StorageDirectory sd = it . next ( ) ; File fsImage = getStorageFile ( sd , NameNodeFile . IMAGE , txid ) ; if ( sd . getRoot ( ) . canRead ( ) && fsImage . exists ( ) ) { if ( isPreferred ( type , sd ) ) { return fsImage ; } lastCandidate = fsImage ; } } return lastCandidate ; }
Return the name of the image file preferring type images . Otherwise return any image .