/** * The maximum number of streams that we store priority information for */ public Http2PriorityTree() { this.rootNode = new Http2PriorityNode(0, 0); nodesByID.put(0, this.rootNode); this.evictionQueue = new int[10]; //todo: make this size customisable }
/** * Resisters a stream, with its dependency and dependent information * @param streamId The stream id * @param dependency The stream this stream depends on, if no stream is specified this should be zero * @param weighting The weighting. If no weighting is specified this should be 16 */ public void registerStream(int streamId, int dependency, int weighting, boolean exclusive) { final Http2PriorityNode node = new Http2PriorityNode(streamId, weighting); if(exclusive) { Http2PriorityNode existing = nodesByID.get(dependency); if(existing != null) { existing.exclusive(node); } } else { Http2PriorityNode existing = nodesByID.get(dependency); if(existing != null) { existing.addDependent(node); } } nodesByID.put(streamId, node); }
/** * The maximum number of streams that we store priority information for */ public Http2PriorityTree() { this.rootNode = new Http2PriorityNode(0, 0); nodesByID.put(0, this.rootNode); this.evictionQueue = new int[10]; //todo: make this size customisable }
/** * Resisters a stream, with its dependency and dependent information * @param streamId The stream id * @param dependency The stream this stream depends on, if no stream is specified this should be zero * @param weighting The weighting. If no weighting is specified this should be 16 */ public void registerStream(int streamId, int dependency, int weighting, boolean exclusive) { final Http2PriorityNode node = new Http2PriorityNode(streamId, weighting); if(exclusive) { Http2PriorityNode existing = nodesByID.get(dependency); if(existing != null) { existing.exclusive(node); } } else { Http2PriorityNode existing = nodesByID.get(dependency); if(existing != null) { existing.addDependent(node); } } nodesByID.put(streamId, node); }
/** * Resisters a stream, with its dependency and dependent information * @param streamId The stream id * @param dependency The stream this stream depends on, if no stream is specified this should be zero * @param weighting The weighting. If no weighting is specified this should be 16 */ public void registerStream(int streamId, int dependency, int weighting, boolean exclusive) { final Http2PriorityNode node = new Http2PriorityNode(streamId, weighting); if(exclusive) { Http2PriorityNode existing = nodesByID.get(dependency); if(existing != null) { existing.exclusive(node); } } else { Http2PriorityNode existing = nodesByID.get(dependency); if(existing != null) { existing.addDependent(node); } } nodesByID.put(streamId, node); }
/** * The maximum number of streams that we store priority information for */ public Http2PriorityTree() { this.rootNode = new Http2PriorityNode(0, 0); nodesByID.put(0, this.rootNode); this.evictionQueue = new int[10]; //todo: make this size customisable }