Modifier and Type | Field and Description |
---|---|
private int | connectionWindowSize
The connection Send Window size. |
private final ReentrantLock | |
pack-priv static final Logger | |
private static final int | DEFAULT_INITIAL_WINDOW_SIZE
Default initial connection Flow-Control Send Window size, as per HTTP/2. |
private final Map | pending
A Map of streams awaiting Send Window. |
private final Map | streams
A Map of the active streams, where the key is the stream id, and the value is the stream's Send Window size, which may be negative. |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
pack-priv void | adjustActiveStreams(int adjustAmount)
Adjusts, either increases or decreases, the active streams registered with this controller. |
pack-priv int | |
pack-priv boolean | Returns: false if, and only if, the addition of the given amount would cause the Send Window to exceed 2^31-1 (overflow), otherwise trueIncreases the Send Window size for the connection. |
pack-priv boolean | Returns: false if, and only if, the addition of the given amount would cause the Send Window to exceed 2^31-1 (overflow), otherwise trueIncreases the Send Window size for the given stream. |
pack-priv void | registerStream(int streamid, int initialStreamWindowSize)
Registers the given stream with this controller. |
pack-priv void | |
pack-priv int | |
pack-priv int | tryAcquire(int requestAmount, int streamid, Stream<?> stream)
Attempts to acquire the requested amount of Send Window for the given stream. |
connectionWindowSize | back to summary |
---|---|
private int connectionWindowSize The connection Send Window size. |
controllerLock | back to summary |
---|---|
private final ReentrantLock controllerLock |
debug | back to summary |
---|---|
pack-priv static final Logger debug |
DEFAULT_INITIAL_WINDOW_SIZE | back to summary |
---|---|
private static final int DEFAULT_INITIAL_WINDOW_SIZE Default initial connection Flow-Control Send Window size, as per HTTP/2. |
pending | back to summary |
---|---|
private final Map<Integer, Map. A Map of streams awaiting Send Window. The key is the stream id. The value is a pair of the Stream ( representing the key's stream id ) and the requested amount of send Window. |
streams | back to summary |
---|---|
private final Map<Integer, Integer> streams A Map of the active streams, where the key is the stream id, and the value is the stream's Send Window size, which may be negative. |
WindowController | back to summary |
---|---|
pack-priv WindowController() A Controller with the default initial window size. |
adjustActiveStreams | back to summary |
---|---|
pack-priv void adjustActiveStreams(int adjustAmount) Adjusts, either increases or decreases, the active streams registered with this controller. May result in a stream's Send Window size becoming negative. |
connectionWindowSize | back to summary |
---|---|
pack-priv int connectionWindowSize() Returns the Send Window size for the connection. |
increaseConnectionWindow | back to summary |
---|---|
pack-priv boolean increaseConnectionWindow(int amount) Increases the Send Window size for the connection.
A number of awaiting requesters, from unfulfilled tryAcquire requests,
may have their stream's
|
increaseStreamWindow | back to summary |
---|---|
pack-priv boolean increaseStreamWindow(int amount, int streamid) Increases the Send Window size for the given stream.
If the given stream is awaiting window size, from an unfulfilled
tryAcquire request, it will have its stream's
|
registerStream | back to summary |
---|---|
pack-priv void registerStream(int streamid, int initialStreamWindowSize) Registers the given stream with this controller. |
removeStream | back to summary |
---|---|
pack-priv void removeStream(int streamid) Removes/De-registers the given stream with this controller. |
streamWindowSize | back to summary |
---|---|
pack-priv int streamWindowSize(int streamid) Returns the Send Window size for the given stream. |
tryAcquire | back to summary |
---|---|
pack-priv int tryAcquire(int requestAmount, int streamid, Stream<?> stream) Attempts to acquire the requested amount of Send Window for the given
stream.
The actual amount of Send Window available may differ from the requested
amount. The actual amount, returned by this method, is the minimum of,
1) the requested amount, 2) the stream's Send Window, and 3) the
connection's Send Window.
A negative or zero value is returned if there's no window available.
When the result is negative or zero, this method arranges for the
given stream's |