boolean recoverLease ( final DistributedFileSystem dfs , final int nbAttempt , final Path p , final long startWaiting ) throws FileNotFoundException { boolean recovered = false ; try { recovered = dfs . recoverLease ( p ) ; LOG . info ( "recoverLease=" + recovered + ", " + getLogMessageDetail ( nbAttempt , p , startWaiting ) ) ; } catch ( IOException e ) { if ( e instanceof LeaseExpiredException && e . getMessage ( ) . contains ( "File does not exist" ) ) { // This exception comes out instead of FNFE, fix it throw new FileNotFoundException ( "The given file wasn't found at " + p ) ; } else if ( e instanceof FileNotFoundException ) { throw ( FileNotFoundException ) e ; } LOG . warn ( getLogMessageDetail ( nbAttempt , p , startWaiting ) , e ) ; } return recovered ; }
Try to recover the lease .