public static < T > T executeWithBackOff ( AbstractGoogleClientRequest < T > client , String error ) throws IOException , InterruptedException { Sleeper sleeper = Sleeper . DEFAULT ; BackOff backOff = BackOffAdapter . toGcpBackOff ( FluentBackoff . DEFAULT . withMaxRetries ( MAX_RETRIES ) . withInitialBackoff ( INITIAL_BACKOFF_TIME ) . backoff ( ) ) ; T result = null ; while ( true ) { try { result = client . execute ( ) ; break ; } catch ( IOException e ) { LOG . error ( "{}" , error , e ) ; if ( ! BackOffUtils . next ( sleeper , backOff ) ) { String errorMessage = String . format ( "%s Failing to execute job after %d attempts." , error , MAX_RETRIES + 1 ) ; LOG . error ( "{}" , errorMessage , e ) ; throw new IOException ( errorMessage , e ) ; } } } return result ; }
formatter parameter .