@@ -132,12 +132,15 @@ public static final class StreamInfo {
132132 private final CallOptions callOptions ;
133133 private final int previousAttempts ;
134134 private final boolean isTransparentRetry ;
135+ private final boolean isHedging ;
135136
136137 StreamInfo (
137- CallOptions callOptions , int previousAttempts , boolean isTransparentRetry ) {
138+ CallOptions callOptions , int previousAttempts , boolean isTransparentRetry ,
139+ boolean isHedging ) {
138140 this .callOptions = checkNotNull (callOptions , "callOptions" );
139141 this .previousAttempts = previousAttempts ;
140142 this .isTransparentRetry = isTransparentRetry ;
143+ this .isHedging = isHedging ;
141144 }
142145
143146 /**
@@ -165,6 +168,15 @@ public boolean isTransparentRetry() {
165168 return isTransparentRetry ;
166169 }
167170
171+ /**
172+ * Whether the stream is hedging.
173+ *
174+ * @since 1.74.0
175+ */
176+ public boolean isHedging () {
177+ return isHedging ;
178+ }
179+
168180 /**
169181 * Converts this StreamInfo into a new Builder.
170182 *
@@ -174,7 +186,9 @@ public Builder toBuilder() {
174186 return new Builder ()
175187 .setCallOptions (callOptions )
176188 .setPreviousAttempts (previousAttempts )
177- .setIsTransparentRetry (isTransparentRetry );
189+ .setIsTransparentRetry (isTransparentRetry )
190+ .setIsHedging (isHedging );
191+
178192 }
179193
180194 /**
@@ -192,6 +206,7 @@ public String toString() {
192206 .add ("callOptions" , callOptions )
193207 .add ("previousAttempts" , previousAttempts )
194208 .add ("isTransparentRetry" , isTransparentRetry )
209+ .add ("isHedging" , isHedging )
195210 .toString ();
196211 }
197212
@@ -204,6 +219,7 @@ public static final class Builder {
204219 private CallOptions callOptions = CallOptions .DEFAULT ;
205220 private int previousAttempts ;
206221 private boolean isTransparentRetry ;
222+ private boolean isHedging ;
207223
208224 Builder () {
209225 }
@@ -236,11 +252,21 @@ public Builder setIsTransparentRetry(boolean isTransparentRetry) {
236252 return this ;
237253 }
238254
255+ /**
256+ * Sets whether the stream is hedging.
257+ *
258+ * @since 1.74.0
259+ */
260+ public Builder setIsHedging (boolean isHedging ) {
261+ this .isHedging = isHedging ;
262+ return this ;
263+ }
264+
239265 /**
240266 * Builds a new StreamInfo.
241267 */
242268 public StreamInfo build () {
243- return new StreamInfo (callOptions , previousAttempts , isTransparentRetry );
269+ return new StreamInfo (callOptions , previousAttempts , isTransparentRetry , isHedging );
244270 }
245271 }
246272 }
0 commit comments