Package io.grpc.internal
Class RetriableStream.State
- java.lang.Object
-
- io.grpc.internal.RetriableStream.State
-
- Enclosing class:
- RetriableStream<ReqT>
private static final class RetriableStream.State extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Collection<RetriableStream.Substream>
activeHedges
Unmodifiable collection of all the active hedging substreams.(package private) java.util.List<RetriableStream.BufferEntry>
buffer
A list of buffered ClientStream runnables.(package private) boolean
cancelled
Not required to set to true when cancelled, but can short-circuit the draining process.(package private) java.util.Collection<RetriableStream.Substream>
drainedSubstreams
Unmodifiable collection of all the open substreams that are drained.(package private) int
hedgingAttemptCount
(package private) boolean
hedgingFrozen
No more hedging due to events like drop or pushback.(package private) boolean
passThrough
Committed and the winning substream drained.(package private) RetriableStream.Substream
winningSubstream
Null until committed.
-
Constructor Summary
Constructors Constructor Description State(java.util.List<RetriableStream.BufferEntry> buffer, java.util.Collection<RetriableStream.Substream> drainedSubstreams, java.util.Collection<RetriableStream.Substream> activeHedges, RetriableStream.Substream winningSubstream, boolean cancelled, boolean passThrough, boolean hedgingFrozen, int hedgingAttemptCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) RetriableStream.State
addActiveHedge(RetriableStream.Substream substream)
(package private) RetriableStream.State
cancelled()
(package private) RetriableStream.State
committed(RetriableStream.Substream winningSubstream)
(package private) RetriableStream.State
freezeHedging()
(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 Detail
-
passThrough
final boolean passThrough
Committed and the winning substream drained.
-
buffer
@Nullable final java.util.List<RetriableStream.BufferEntry> buffer
A list of buffered ClientStream runnables. Set to Null once passThrough.
-
drainedSubstreams
final java.util.Collection<RetriableStream.Substream> drainedSubstreams
Unmodifiable collection of all the open substreams that are drained. Singleton once passThrough; Empty if committed but not passTrough.
-
activeHedges
final java.util.Collection<RetriableStream.Substream> 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
@Nullable final RetriableStream.Substream winningSubstream
Null until committed.
-
cancelled
final boolean cancelled
Not required to set to true when cancelled, but can short-circuit the draining process.
-
hedgingFrozen
final boolean hedgingFrozen
No more hedging due to events like drop or pushback.
-
-
Constructor Detail
-
State
State(@Nullable java.util.List<RetriableStream.BufferEntry> buffer, java.util.Collection<RetriableStream.Substream> drainedSubstreams, java.util.Collection<RetriableStream.Substream> activeHedges, @Nullable RetriableStream.Substream winningSubstream, boolean cancelled, boolean passThrough, boolean hedgingFrozen, int hedgingAttemptCount)
-
-
Method Detail
-
cancelled
@CheckReturnValue RetriableStream.State cancelled()
-
substreamDrained
@CheckReturnValue RetriableStream.State substreamDrained(RetriableStream.Substream substream)
The given substream is drained.
-
substreamClosed
@CheckReturnValue RetriableStream.State substreamClosed(RetriableStream.Substream substream)
The given substream is closed.
-
committed
@CheckReturnValue RetriableStream.State committed(RetriableStream.Substream winningSubstream)
-
freezeHedging
@CheckReturnValue RetriableStream.State freezeHedging()
-
addActiveHedge
@CheckReturnValue RetriableStream.State addActiveHedge(RetriableStream.Substream substream)
-
removeActiveHedge
@CheckReturnValue RetriableStream.State removeActiveHedge(RetriableStream.Substream substream)
-
replaceActiveHedge
@CheckReturnValue RetriableStream.State replaceActiveHedge(RetriableStream.Substream oldOne, RetriableStream.Substream newOne)
-
-