Package io.grpc.internal
Class RetriableStream.State
java.lang.Object
io.grpc.internal.RetriableStream.State
- Enclosing class:
RetriableStream<ReqT>
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Collection
<RetriableStream.Substream> Unmodifiable collection of all the active hedging substreams.(package private) final List
<RetriableStream.BufferEntry> A list of buffered ClientStream runnables.(package private) final boolean
Not required to set to true when cancelled, but can short-circuit the draining process.(package private) final Collection
<RetriableStream.Substream> Unmodifiable collection of all the open substreams that are drained.(package private) final int
(package private) final boolean
No more hedging due to events like drop or pushback.(package private) final boolean
Committed and the winning substream drained.(package private) final RetriableStream.Substream
Null until committed. -
Constructor Summary
ConstructorsConstructorDescriptionState
(List<RetriableStream.BufferEntry> buffer, Collection<RetriableStream.Substream> drainedSubstreams, Collection<RetriableStream.Substream> activeHedges, RetriableStream.Substream winningSubstream, boolean cancelled, boolean passThrough, boolean hedgingFrozen, int hedgingAttemptCount) -
Method Summary
Modifier and TypeMethodDescription(package private) RetriableStream.State
addActiveHedge
(RetriableStream.Substream substream) (package private) RetriableStream.State
(package private) RetriableStream.State
committed
(RetriableStream.Substream winningSubstream) (package private) RetriableStream.State
(package private) RetriableStream.State
removeActiveHedge
(RetriableStream.Substream substream) (package private) RetriableStream.State
replaceActiveHedge
(RetriableStream.Substream oldOne, RetriableStream.Substream newOne) (package private) RetriableStream.State
substreamClosed
(RetriableStream.Substream substream) The given substream is closed.(package private) RetriableStream.State
substreamDrained
(RetriableStream.Substream substream) The given substream is drained.
-
Field Details
-
passThrough
final boolean passThroughCommitted and the winning substream drained. -
buffer
A list of buffered ClientStream runnables. Set to Null once passThrough. -
drainedSubstreams
Unmodifiable collection of all the open substreams that are drained. Singleton once passThrough; Empty if committed but not passTrough. -
activeHedges
Unmodifiable collection of all the active hedging substreams.A substream even with the attribute substream.closed being true may be considered still "active" at the moment as long as it is in this collection.
-
hedgingAttemptCount
final int hedgingAttemptCount -
winningSubstream
Null until committed. -
cancelled
final boolean cancelledNot required to set to true when cancelled, but can short-circuit the draining process. -
hedgingFrozen
final boolean hedgingFrozenNo more hedging due to events like drop or pushback.
-
-
Constructor Details
-
State
State(@Nullable List<RetriableStream.BufferEntry> buffer, Collection<RetriableStream.Substream> drainedSubstreams, Collection<RetriableStream.Substream> activeHedges, @Nullable RetriableStream.Substream winningSubstream, boolean cancelled, boolean passThrough, boolean hedgingFrozen, int hedgingAttemptCount)
-
-
Method Details
-
cancelled
-
substreamDrained
The given substream is drained. -
substreamClosed
The given substream is closed. -
committed
-
freezeHedging
-
addActiveHedge
-
removeActiveHedge
-
replaceActiveHedge
@CheckReturnValue RetriableStream.State replaceActiveHedge(RetriableStream.Substream oldOne, RetriableStream.Substream newOne)
-