Top Description Inners Fields Constructors Methods
io.undertow.protocols.http2

public Class Http2PriorityTree

extends Object
Class Inheritance
Imports
java.util.Comparator, .HashMap, .Map

A structure that represents HTTP2 priority information. Note that this structure is not thread safe, it is intended to be protected by an external lock
Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int[]
evictionQueue

fixed length queue of completed streams that have no dependents, they are kept around for a short time then expired.

private int
private final Map<Integer, Http2PriorityTree.Http2PriorityNode>
private final Http2PriorityTree.Http2PriorityNode

Constructor Summary

AccessConstructor and Description
public
Http2PriorityTree()

The maximum number of streams that we store priority information for

Method Summary

Modifier and TypeMethod and Description
public Comparator<Integer>
comparator()

Creates a priority queue

private double
public void
priorityFrame(int streamId, int streamDependency, int weight, boolean exlusive)

public void
registerStream(int
The stream id
streamId
,
int
The stream this stream depends on, if no stream is specified this should be zero
dependency
,
int
The weighting. If no weighting is specified this should be 16
weighting
,
boolean exclusive)

Resisters a stream, with its dependency and dependent information

public void
streamRemoved(int
id of the stream removed
streamId
)

Method that is invoked when a stream has been removed

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

evictionQueueback to summary
private int[] evictionQueue

fixed length queue of completed streams that have no dependents, they are kept around for a short time then expired.

evictionQueuePositionback to summary
private int evictionQueuePosition
nodesByIDback to summary
private final Map<Integer, Http2PriorityTree.Http2PriorityNode> nodesByID
rootNodeback to summary
private final Http2PriorityTree.Http2PriorityNode rootNode

Constructor Detail

Http2PriorityTreeback to summary
public Http2PriorityTree()

The maximum number of streams that we store priority information for

Method Detail

comparatorback to summary
public Comparator<Integer> comparator()

Creates a priority queue

createWeightingProportionback to summary
private double createWeightingProportion(Http2PriorityTree.Http2PriorityNode n1)
priorityFrameback to summary
public void priorityFrame(int streamId, int streamDependency, int weight, boolean exlusive)
registerStreamback to summary
public void registerStream(int streamId, int dependency, int weighting, boolean exclusive)

Resisters a stream, with its dependency and dependent information

Parameters
streamId:int

The stream id

dependency:int

The stream this stream depends on, if no stream is specified this should be zero

weighting:int

The weighting. If no weighting is specified this should be 16

streamRemovedback to summary
public void streamRemoved(int streamId)

Method that is invoked when a stream has been removed

Parameters
streamId:int

id of the stream removed

io.undertow.protocols.http2 back to summary

private Class Http2PriorityTree.Http2PriorityNode

extends Object
Class Inheritance
  • java.lang.Object
  • io.undertow.protocols.http2.Http2PriorityTree.Http2PriorityNode

Field Summary

Modifier and TypeField and Description
private Http2PriorityTree.Http2PriorityNode[]
dependents

streams that depend on this stream, in weighted order.

private Http2PriorityTree.Http2PriorityNode
private final int
streamId

This stream id of this node

pack-priv int
totalWeights

The sum of all dependencies weights

pack-priv int
weighting

The stream weighting

Constructor Summary

AccessConstructor and Description
pack-priv
Http2PriorityNode(int streamId, int weighting)

Method Summary

Modifier and TypeMethod and Description
public void
public void
pack-priv boolean
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dependentsback to summary
private Http2PriorityTree.Http2PriorityNode[] dependents

streams that depend on this stream, in weighted order. May contains null at the end of the list

parentback to summary
private Http2PriorityTree.Http2PriorityNode parent
streamIdback to summary
private final int streamId

This stream id of this node

totalWeightsback to summary
pack-priv int totalWeights

The sum of all dependencies weights

weightingback to summary
pack-priv int weighting

The stream weighting

Constructor Detail

Http2PriorityNodeback to summary
pack-priv Http2PriorityNode(int streamId, int weighting)

Method Detail

addDependentback to summary
public void addDependent(Http2PriorityTree.Http2PriorityNode node)
exclusiveback to summary
public void exclusive(Http2PriorityTree.Http2PriorityNode node)
hasDependentsback to summary
pack-priv boolean hasDependents()
removeDependentback to summary
pack-priv void removeDependent(Http2PriorityTree.Http2PriorityNode node)