public static boolean downloadUpdatedBlob ( Map conf , BlobStore blobStore , String key , Set < NimbusInfo > nimbusInfos ) throws TTransportException { NimbusClient client ; ClientBlobStore remoteBlobStore ; boolean isSuccess = false ; LOG . debug ( "Download blob NimbusInfos {}" , nimbusInfos ) ; for ( NimbusInfo nimbusInfo : nimbusInfos ) { if ( isSuccess ) { break ; } try { client = new NimbusClient ( conf , nimbusInfo . getHost ( ) , nimbusInfo . getPort ( ) , null ) ; remoteBlobStore = new NimbusBlobStore ( ) ; remoteBlobStore . setClient ( conf , client ) ; isSuccess = updateBlob ( blobStore , key , remoteBlobStore . getBlob ( key ) ) ; } catch ( IOException exception ) { throw new RuntimeException ( exception ) ; } catch ( KeyNotFoundException knf ) { // Catching and logging KeyNotFoundException because, if // there is a subsequent update and delete, the non-leader // nimbodes might throw an exception. LOG . info ( "KeyNotFoundException {}" , knf ) ; } catch ( Exception exp ) { // Logging an exception while client is connecting LOG . error ( "Exception {}" , exp ) ; } } if ( ! isSuccess ) { LOG . error ( "Could not update the blob with key" + key ) ; } return isSuccess ; }
Download updated blobs from potential nimbodes