private < T > T retryOnException ( ObjectStoreOperation < T > op , Supplier < String > description ) throws IOException { RetryPolicy retryPolicy = getRetryPolicy ( ) ; IOException thrownException = null ; while ( retryPolicy . attempt ( ) ) { try { return op . apply ( ) ; } catch ( IOException e ) { LOG . debug ( "Attempt {} to {} failed with exception : {}" , retryPolicy . getAttemptCount ( ) , description . get ( ) , e . toString ( ) ) ; thrownException = e ; } } throw thrownException ; }
Retries the given object store operation when it throws exceptions to resolve eventual consistency issue .