MCPcopy Create free account
hub / github.com/apache/trafficserver / dequeue

Method dequeue

src/proxy/http/PreWarmManager.cc:775–813  ·  view source on GitHub ↗

Use open_list as FILO to adjust size of list. ( A new sm is pushed in front of the list by PreWarmQeueu::push() ) When the list has redundant sm(s), they will be closed by inactivity timeout. */

Source from the content-addressed store, hash-verified

773 When the list has redundant sm(s), they will be closed by inactivity timeout.
774 */
775PreWarmSM *
776PreWarmQueue::dequeue(const PreWarm::SPtrConstDst &target)
777{
778 PreWarmSM *sm = nullptr;
779
780 auto res = _map.find(target);
781 if (res == _map.end()) {
782 // no such pool
783 return nullptr;
784 }
785
786 const PreWarm::SPtrConstDst &dst = res->first;
787 Info &info = res->second;
788
789 Queue *q = info.open_list;
790 while (!q->empty()) {
791 sm = q->front();
792 q->pop_front();
793
794 if (sm->handler == &PreWarmSM::state_open) {
795 _cop_list.remove(sm);
796 break;
797 }
798
799 _delete_prewarm_sm(sm);
800 sm = nullptr;
801 }
802
803 // stat
804 if (sm == nullptr) {
805 ++info.stat.miss;
806 } else {
807 ++info.stat.hit;
808 }
809
810 _prewarm_on_dequeue(dst, info);
811
812 return sm;
813}
814
815void
816PreWarmQueue::_new_prewarm_sm(const PreWarm::SPtrConstDst &dst, const PreWarm::SPtrConstConf &conf,

Callers 15

_tickMethod · 0.45
RamCacheCLFUS.ccFile · 0.45
putMethod · 0.45
putMethod · 0.45
signal_readersMethod · 0.45
aggWriteDoneMethod · 0.45
aggWriteMethod · 0.45
ClearConfigVolFunction · 0.45
ClearCacheVolListFunction · 0.45
recv_dnsMethod · 0.45
postAllEventMethod · 0.45

Calls 4

findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
removeMethod · 0.45

Tested by 2

ClearConfigVolFunction · 0.36
ClearCacheVolListFunction · 0.36