|
30 | 30 | package com.google.api.gax.retrying; |
31 | 31 |
|
32 | 32 | import com.google.auto.value.AutoValue; |
| 33 | +import com.google.common.annotations.VisibleForTesting; |
33 | 34 | import java.io.Serializable; |
34 | 35 | import org.threeten.bp.Duration; |
35 | 36 |
|
@@ -112,7 +113,11 @@ public abstract class RetrySettings implements Serializable { |
112 | 113 | * <pre>{@code actualDelay = rand_between(0, min(maxRetryDelay, delay))}</pre> |
113 | 114 | * |
114 | 115 | * The default value is {@code true}. |
| 116 | + * |
| 117 | + * @deprecated Retries always jitter. |
115 | 118 | */ |
| 119 | + @Deprecated |
| 120 | + @VisibleForTesting |
116 | 121 | public abstract boolean isJittered(); |
117 | 122 |
|
118 | 123 | /** |
@@ -194,13 +199,17 @@ public abstract static class Builder { |
194 | 199 | public abstract Builder setMaxAttempts(int maxAttempts); |
195 | 200 |
|
196 | 201 | /** |
197 | | - * Jitter determines if the delay time should be randomized. In most cases, if jitter is set to |
198 | | - * {@code true} the actual delay time is calculated in the following way: |
| 202 | + * Jitter determines if the delay time should be randomized. If jitter is set to {@code true} |
| 203 | + * the actual delay time is calculated in the following way: |
199 | 204 | * |
200 | 205 | * <pre>{@code actualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))}</pre> |
201 | 206 | * |
202 | | - * The default value is {@code true}. |
| 207 | + * The default value is {@code true}, and this method will be a no-op soon. |
| 208 | + * |
| 209 | + * @deprecated Retries always jitter. |
203 | 210 | */ |
| 211 | + @Deprecated |
| 212 | + @VisibleForTesting |
204 | 213 | public abstract Builder setJittered(boolean jittered); |
205 | 214 |
|
206 | 215 | /** |
|
0 commit comments