Class RetryManager
- java.lang.Object
-
- com.linkedin.venice.fastclient.meta.RetryManager
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class RetryManager extends java.lang.Object implements java.io.Closeable
This class offers advanced client retry behaviors. Specifically enforcing a retry budget and relevant monitoring to avoid retry storm and alert users when the retry threshold is misconfigured or service is degrading.
-
-
Constructor Summary
Constructors Constructor Description RetryManager(io.tehuti.metrics.MetricsRepository metricsRepository, java.lang.String metricNamePrefix, long enforcementWindowInMs, double retryBudgetInPercentDecimal)
RetryManager(io.tehuti.metrics.MetricsRepository metricsRepository, java.lang.String metricNamePrefix, long enforcementWindowInMs, double retryBudgetInPercentDecimal, java.time.Clock clock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
TokenBucket
getRetryTokenBucket()
boolean
isRetryAllowed()
void
recordRequest()
-
-
-
Constructor Detail
-
RetryManager
public RetryManager(io.tehuti.metrics.MetricsRepository metricsRepository, java.lang.String metricNamePrefix, long enforcementWindowInMs, double retryBudgetInPercentDecimal, java.time.Clock clock)
-
RetryManager
public RetryManager(io.tehuti.metrics.MetricsRepository metricsRepository, java.lang.String metricNamePrefix, long enforcementWindowInMs, double retryBudgetInPercentDecimal)
-
-
Method Detail
-
recordRequest
public void recordRequest()
-
isRetryAllowed
public boolean isRetryAllowed()
-
getRetryTokenBucket
public TokenBucket getRetryTokenBucket()
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-