This implementation is specifically designed for managing connections in an HTTP route context and provides methods for probing and backing off connections based on the performance of the route.
The exponential backoff algorithm is primarily implemented in the getBackedOffPoolSize
method, which calculates the new connection pool size based on the current pool size, growth rate,
and the number of time intervals.
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public | ExponentialBackoffManager(final ConnPoolControl<HttpRoute>
the connection pool control to be used for managing connections connPerRoute)Constructs a new ExponentialBackoffManager with the specified connection pool control. |
| Modifier and Type | Method and Description |
|---|---|
| protected int | Returns: the new pool size after applying the backoffthe current pool size curr)Implements abstract org. |
| public void | setBackoffFactor(final double
the backoff factor to be set rate)Implements abstract org. |
| LOG | back to summary |
|---|---|
| private static final Logger LOG Hides org. | |
| ExponentialBackoffManager | back to summary |
|---|---|
| public ExponentialBackoffManager(final ConnPoolControl<HttpRoute> connPerRoute) Constructs a new ExponentialBackoffManager with the specified connection pool control.
| |
| getBackedOffPoolSize | back to summary |
|---|---|
| protected int getBackedOffPoolSize(final int curr) Implements abstract org. Calculates the new pool size after applying the exponential backoff algorithm. The new pool size is calculated using the formula: floor(curr / (1 + growthRate) ^ t), where curr is the current pool size, growthRate is the exponential growth rate, and t is the time interval.
| |
| setBackoffFactor | back to summary |
|---|---|
| public void setBackoffFactor(final double rate) Implements abstract org. Doc from org. Sets the backoff factor for the backoff algorithm. The backoff factor should be a value between 0.0 and 1.0. The specific implementation of how the backoff factor is used should be provided by subclasses.
| |