Priority FIFO replacement policy. More...
#include <daemon/table/cs-policy-priority-fifo.hpp>
Public Types | |
using | EntryRef = Table::const_iterator |
a reference to an CS entry More... | |
Public Member Functions | |
PriorityFifoPolicy () | |
~PriorityFifoPolicy () override | |
void | afterInsert (EntryRef i) |
invoked by CS after a new entry is inserted More... | |
void | afterRefresh (EntryRef i) |
invoked by CS after an existing entry is refreshed by same Data More... | |
void | beforeErase (EntryRef i) |
invoked by CS before an entry is erased due to management command More... | |
void | beforeUse (EntryRef i) |
invoked by CS before an entry is used to match a lookup More... | |
Cs * | getCs () const |
gets cs More... | |
size_t | getLimit () const |
gets hard limit (in number of entries) More... | |
const std::string & | getName () const |
void | setCs (Cs *cs) |
sets cs More... | |
void | setLimit (size_t nMaxEntries) |
sets hard limit (in number of entries) More... | |
Static Public Member Functions | |
static unique_ptr< Policy > | create (const std::string &policyName) |
static std::set< std::string > | getPolicyNames () |
template<typename P > | |
static void | registerPolicy (const std::string &policyName=P::POLICY_NAME) |
Public Attributes | |
signal::Signal< Policy, EntryRef > | beforeEvict |
emits when an entry is being evicted More... | |
Static Public Attributes | |
static const std::string | POLICY_NAME = "priority_fifo" |
Priority FIFO replacement policy.
This policy maintains a set of cleanup queues to decide the eviction order of CS entries. The cleanup queues are three doubly linked lists that store EntryRefs. The three queues keep track of unsolicited, stale, and fresh Data packet, respectively. EntryRef is placed into, removed from, and moved between suitable queues whenever an Entry is added, removed, or has other attribute changes. Each Entry should be in exactly one queue at any moment. Within each queue, the EntryRefs are kept in first-in-first-out order. Eviction procedure exhausts the first queue before moving onto the next queue, in the order of unsolicited, stale, and fresh queue.
Definition at line 65 of file cs-policy-priority-fifo.hpp.
|
inherited |
a reference to an CS entry
Definition at line 111 of file cs-policy.hpp.
nfd::cs::priority_fifo::PriorityFifoPolicy::PriorityFifoPolicy | ( | ) |
Definition at line 37 of file cs-policy-priority-fifo.cpp.
|
override |
Definition at line 42 of file cs-policy-priority-fifo.cpp.
|
inherited |
invoked by CS after a new entry is inserted
The policy may evict entries if necessary. During this process, i
might be evicted.
Definition at line 76 of file cs-policy.cpp.
|
inherited |
invoked by CS after an existing entry is refreshed by same Data
The policy may witness this refresh to make better eviction decisions in the future.
Definition at line 83 of file cs-policy.cpp.
|
inherited |
invoked by CS before an entry is erased due to management command
Definition at line 90 of file cs-policy.cpp.
|
inherited |
invoked by CS before an entry is used to match a lookup
The policy may witness this usage to make better eviction decisions in the future.
Definition at line 97 of file cs-policy.cpp.
|
staticinherited |
policyName
, or nullptr if policyName
is unknown Definition at line 46 of file cs-policy.cpp.
|
inlineinherited |
gets cs
Definition at line 77 of file cs-policy.hpp.
|
inlineinherited |
gets hard limit (in number of entries)
Definition at line 93 of file cs-policy.hpp.
|
inlineinherited |
Definition at line 69 of file cs-policy.hpp.
|
staticinherited |
Definition at line 54 of file cs-policy.cpp.
|
inlinestaticinherited |
Definition at line 43 of file cs-policy.hpp.
|
inlineinherited |
sets cs
Definition at line 85 of file cs-policy.hpp.
|
inherited |
sets hard limit (in number of entries)
The policy may evict entries if necessary.
Definition at line 68 of file cs-policy.cpp.
emits when an entry is being evicted
A policy implementation should emit this signal to cause CS to erase an entry from its index. CS should connect to this signal and erase the entry upon signal emission.
Definition at line 118 of file cs-policy.hpp.
|
static |
Definition at line 73 of file cs-policy-priority-fifo.hpp.