proxygen
|
#include <HTTP2PriorityQueue.h>
Classes | |
class | Node |
Public Types | |
using | NextEgressResult = std::vector< std::pair< HTTPTransaction *, double >> |
Public Types inherited from proxygen::HTTP2PriorityQueueBase | |
using | Handle = BaseNode * |
Static Public Member Functions | |
static void | setNodeLifetime (std::chrono::milliseconds lifetime) |
Private Types | |
using | NodeMap = boost::intrusive::unordered_set< Node, boost::intrusive::constant_time_size< false >> |
typedef boost::intrusive::link_mode< boost::intrusive::auto_unlink > | link_mode |
Private Member Functions | |
Node * | find (HTTPCodec::StreamID id, uint64_t *depth=nullptr) |
Node * | findInternal (HTTPCodec::StreamID id) |
bool | allowDanglingNodes () const |
void | scheduleNodeExpiration (Node *node) |
void | updateEnqueuedWeight () |
Static Private Member Functions | |
static bool | nextEgressResult (HTTP2PriorityQueue &queue, HTTPCodec::StreamID id, HTTPTransaction *txn, double r) |
Private Attributes | |
NodeMap::bucket_type | nodeBuckets_ [kNumBuckets] |
NodeMap | nodes_ |
Node | root_ {*this, nullptr, 0, 1, nullptr} |
uint32_t | rebuildCount_ {0} |
uint64_t | activeCount_ {0} |
uint32_t | maxVirtualNodes_ {50} |
uint32_t | numVirtualNodes_ {0} |
bool | pendingWeightChange_ {false} |
WheelTimerInstance | timeout_ |
NextEgressResult * | nextEgressResults_ {nullptr} |
Static Private Attributes | |
static const size_t | kNumBuckets = 100 |
static uint32_t | kMaxRebuilds_ = 3 |
static std::chrono::milliseconds | kNodeLifetime_ |
Definition at line 59 of file HTTP2PriorityQueue.h.
|
private |
Definition at line 194 of file HTTP2PriorityQueue.h.
using proxygen::HTTP2PriorityQueue::NextEgressResult = std::vector<std::pair<HTTPTransaction*, double>> |
Definition at line 148 of file HTTP2PriorityQueue.h.
|
private |
Definition at line 64 of file HTTP2PriorityQueue.h.
|
inline |
Definition at line 70 of file HTTP2PriorityQueue.h.
|
inlineexplicit |
Definition at line 75 of file HTTP2PriorityQueue.h.
void proxygen::HTTP2PriorityQueue::addOrUpdatePriorityNode | ( | HTTPCodec::StreamID | id, |
http2::PriorityUpdate | pri | ||
) |
Definition at line 444 of file HTTP2PriorityQueue.cpp.
References addTransaction(), find(), and updatePriority().
Referenced by proxygen::HTTPSession::onPriority(), and proxygen::HTTPSession::sendPriority().
|
inlineoverridevirtual |
Implements proxygen::HTTPCodec::PriorityQueue.
Definition at line 95 of file HTTP2PriorityQueue.h.
References proxygen::HTTP2PriorityQueueBase::addTransaction(), and uint32_t.
|
overridevirtual |
Implements proxygen::HTTP2PriorityQueueBase.
Definition at line 458 of file HTTP2PriorityQueue.cpp.
References proxygen::HTTP2PriorityQueue::Node::convertVirtualNode(), proxygen::http2::DefaultPriority, proxygen::http2::PriorityUpdate::exclusive, find(), proxygen::HTTP2PriorityQueue::Node::getID(), maxVirtualNodes_, folly::gen::move, numVirtualNodes_, parent, pendingWeightChange_, root_, scheduleNodeExpiration(), proxygen::http2::PriorityUpdate::streamDependency, uint16_t, updatePriority(), and proxygen::http2::PriorityUpdate::weight.
Referenced by addOrUpdatePriorityNode(), and updatePriority().
|
inlineprivate |
Definition at line 175 of file HTTP2PriorityQueue.h.
Referenced by removeTransaction().
void proxygen::HTTP2PriorityQueue::attachThreadLocals | ( | const WheelTimerInstance & | timeout | ) |
class HTTP2PriorityQueue
Definition at line 433 of file HTTP2PriorityQueue.cpp.
References timeout_.
Referenced by proxygen::HTTPUpstreamSession::attachThreadLocals().
|
overridevirtual |
Implements proxygen::HTTP2PriorityQueueBase.
Definition at line 606 of file HTTP2PriorityQueue.cpp.
References activeCount_, and pendingWeightChange_.
void proxygen::HTTP2PriorityQueue::detachThreadLocals | ( | ) |
Definition at line 437 of file HTTP2PriorityQueue.cpp.
References proxygen::HTTP2PriorityQueue::Node::dropPriorityNodes(), and timeout_.
Referenced by proxygen::HTTPUpstreamSession::detachThreadLocals().
|
inline |
Definition at line 103 of file HTTP2PriorityQueue.h.
References proxygen::HTTP2PriorityQueueBase::addTransaction(), proxygen::HTTP2PriorityQueueBase::removeTransaction(), uint64_t, and proxygen::HTTP2PriorityQueueBase::updatePriority().
Referenced by proxygen::HTTPSession::~HTTPSession().
|
inline |
Definition at line 122 of file HTTP2PriorityQueue.h.
Referenced by proxygen::HTTPSession::getNextToSend(), proxygen::HTTPSession::hasMoreWrites(), proxygen::HTTPSession::onConnectionSendWindowClosed(), proxygen::HTTPSession::scheduleWrite(), and proxygen::HTTPSession::~HTTPSession().
|
private |
Definition at line 695 of file HTTP2PriorityQueue.cpp.
References nodes_.
Referenced by addOrUpdatePriorityNode(), addTransaction(), and updatePriority().
|
inlineprivate |
Definition at line 168 of file HTTP2PriorityQueue.h.
Referenced by iterateBFS().
|
inline |
Definition at line 160 of file HTTP2PriorityQueue.h.
|
inline |
Definition at line 161 of file HTTP2PriorityQueue.h.
References uint64_t.
|
inline |
Definition at line 135 of file HTTP2PriorityQueue.h.
References folly::gen::all().
void proxygen::HTTP2PriorityQueue::iterateBFS | ( | const std::function< bool(HTTP2PriorityQueue &, HTTPCodec::StreamID, HTTPTransaction *, double)> & | fn, |
const std::function< bool()> & | stopFn, | ||
bool | all | ||
) |
Definition at line 616 of file HTTP2PriorityQueue.cpp.
References folly::gen::all(), findInternal(), root_, stop(), folly::f14::swap(), proxygen::HTTP2PriorityQueue::Node::updateEnqueuedWeight(), and proxygen::HTTP2PriorityQueue::Node::visitBFS().
Referenced by proxygen::HTTPSession::resumeTransactions().
void proxygen::HTTP2PriorityQueue::nextEgress | ( | HTTP2PriorityQueue::NextEgressResult & | result, |
bool | spdyMode = false |
||
) |
Definition at line 648 of file HTTP2PriorityQueue.cpp.
References activeCount_, nextEgressResult(), nextEgressResults_, root_, stop(), folly::f14::swap(), proxygen::HTTP2PriorityQueue::Node::updateEnqueuedWeight(), and proxygen::HTTP2PriorityQueue::Node::visitBFS().
Referenced by proxygen::HTTPSession::getNextToSend().
|
staticprivate |
Definition at line 640 of file HTTP2PriorityQueue.cpp.
References nextEgressResults_.
Referenced by nextEgress().
|
inline |
Definition at line 127 of file HTTP2PriorityQueue.h.
Referenced by proxygen::HTTPSession::runLoopCallback().
|
inline |
Definition at line 131 of file HTTP2PriorityQueue.h.
void proxygen::HTTP2PriorityQueue::rebuildTree | ( | ) |
Error handling code.
Definition at line 722 of file HTTP2PriorityQueue.cpp.
References proxygen::HTTP2PriorityQueue::Node::flattenSubtree(), kMaxRebuilds_, rebuildCount_, and root_.
|
overridevirtual |
Implements proxygen::HTTP2PriorityQueueBase.
Definition at line 578 of file HTTP2PriorityQueue.cpp.
References allowDanglingNodes(), proxygen::HTTP2PriorityQueue::Node::clearPendingEgress(), proxygen::HTTP2PriorityQueue::Node::clearTransaction(), proxygen::HTTP2PriorityQueue::Node::getID(), proxygen::HTTP2PriorityQueue::Node::isEnqueued(), maxVirtualNodes_, numVirtualNodes_, pendingWeightChange_, proxygen::HTTP2PriorityQueue::Node::removeFromTree(), and scheduleNodeExpiration().
|
inlineprivate |
Definition at line 179 of file HTTP2PriorityQueue.h.
References proxygen::HTTP2PriorityQueue::Node::getID().
Referenced by addTransaction(), proxygen::HTTP2PriorityQueue::Node::detachChild(), and removeTransaction().
|
inline |
Definition at line 85 of file HTTP2PriorityQueue.h.
References proxygen::HTTP2PriorityQueueBase::clearPendingEgress(), h, and proxygen::HTTP2PriorityQueueBase::signalPendingEgress().
|
inlinestatic |
Definition at line 152 of file HTTP2PriorityQueue.h.
|
overridevirtual |
Implements proxygen::HTTP2PriorityQueueBase.
Definition at line 596 of file HTTP2PriorityQueue.cpp.
References activeCount_, proxygen::HTTP2PriorityQueueBase::BaseNode::isEnqueued(), and pendingWeightChange_.
|
private |
Definition at line 710 of file HTTP2PriorityQueue.cpp.
References activeCount_, pendingWeightChange_, root_, and proxygen::HTTP2PriorityQueue::Node::updateEnqueuedWeight().
|
overridevirtual |
Implements proxygen::HTTP2PriorityQueueBase.
Definition at line 529 of file HTTP2PriorityQueue.cpp.
References addTransaction(), proxygen::HTTP2PriorityQueueBase::BaseNode::calculateDepth(), proxygen::HTTP2PriorityQueue::Node::calculateDepth(), proxygen::http2::DefaultPriority, proxygen::http2::PriorityUpdate::exclusive, find(), proxygen::HTTP2PriorityQueue::Node::getID(), proxygen::HTTP2PriorityQueue::Node::getParent(), proxygen::HTTP2PriorityQueue::Node::isDescendantOf(), maxVirtualNodes_, numVirtualNodes_, proxygen::HTTP2PriorityQueue::Node::parentID(), pendingWeightChange_, proxygen::HTTP2PriorityQueue::Node::reparent(), root_, proxygen::http2::PriorityUpdate::streamDependency, uint16_t, proxygen::HTTP2PriorityQueue::Node::updateWeight(), and proxygen::http2::PriorityUpdate::weight.
Referenced by addOrUpdatePriorityNode(), and addTransaction().
|
private |
Definition at line 412 of file HTTP2PriorityQueue.h.
Referenced by clearPendingEgress(), nextEgress(), signalPendingEgress(), and updateEnqueuedWeight().
|
staticprivate |
Definition at line 411 of file HTTP2PriorityQueue.h.
Referenced by rebuildTree().
|
staticprivate |
Definition at line 419 of file HTTP2PriorityQueue.h.
|
staticprivate |
Definition at line 66 of file HTTP2PriorityQueue.h.
|
private |
Definition at line 413 of file HTTP2PriorityQueue.h.
Referenced by addTransaction(), removeTransaction(), and updatePriority().
|
private |
Definition at line 418 of file HTTP2PriorityQueue.h.
Referenced by nextEgress(), and nextEgressResult().
|
private |
Definition at line 407 of file HTTP2PriorityQueue.h.
|
private |
Definition at line 408 of file HTTP2PriorityQueue.h.
Referenced by find(), and proxygen::HTTP2PriorityQueue::Node::Node().
|
private |
Definition at line 414 of file HTTP2PriorityQueue.h.
Referenced by addTransaction(), proxygen::HTTP2PriorityQueue::Node::convertVirtualNode(), removeTransaction(), updatePriority(), and proxygen::HTTP2PriorityQueue::Node::~Node().
|
private |
Definition at line 415 of file HTTP2PriorityQueue.h.
Referenced by addTransaction(), clearPendingEgress(), removeTransaction(), signalPendingEgress(), updateEnqueuedWeight(), and updatePriority().
|
private |
Definition at line 410 of file HTTP2PriorityQueue.h.
Referenced by rebuildTree().
Definition at line 409 of file HTTP2PriorityQueue.h.
Referenced by addTransaction(), iterateBFS(), nextEgress(), rebuildTree(), updateEnqueuedWeight(), and updatePriority().
|
private |
Definition at line 416 of file HTTP2PriorityQueue.h.
Referenced by attachThreadLocals(), and detachThreadLocals().